From owner-svn-src-stable-7@FreeBSD.ORG Sun Jul 24 23:44:16 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E15751065674; Sun, 24 Jul 2011 23:44:16 +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 D0BC58FC0C; Sun, 24 Jul 2011 23:44: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 p6ONiG7R029188; Sun, 24 Jul 2011 23:44:16 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6ONiG3S029186; Sun, 24 Jul 2011 23:44:16 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201107242344.p6ONiG3S029186@svn.freebsd.org> From: Doug Barton Date: Sun, 24 Jul 2011 23:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224300 - stable/7/etc X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jul 2011 23:44:17 -0000 Author: dougb Date: Sun Jul 24 23:44:16 2011 New Revision: 224300 URL: http://svn.freebsd.org/changeset/base/224300 Log: MFC r197728: Add OpenVPN IANA assigned port number. Modified: stable/7/etc/services Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/services ============================================================================== --- stable/7/etc/services Sun Jul 24 23:43:40 2011 (r224299) +++ stable/7/etc/services Sun Jul 24 23:44:16 2011 (r224300) @@ -1521,6 +1521,8 @@ nfa 1155/tcp #Network File Access nfa 1155/udp #Network File Access phone 1167/udp #conference calling skkserv 1178/tcp #SKK (kanji input) +openvpn 1194/tcp #OpenVPN +openvpn 1194/udp #OpenVPN lupa 1212/tcp lupa 1212/udp nerv 1222/tcp #SNI R&D network From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 14:33:37 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 663DF1065673; Mon, 25 Jul 2011 14:33:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54F898FC19; Mon, 25 Jul 2011 14:33:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEXbBK060287; Mon, 25 Jul 2011 14:33:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEXbh0060285; Mon, 25 Jul 2011 14:33:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251433.p6PEXbh0060285@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:33: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: r224310 - stable/7/sys/sparc64/include X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:33:37 -0000 Author: marius Date: Mon Jul 25 14:33:37 2011 New Revision: 224310 URL: http://svn.freebsd.org/changeset/base/224310 Log: MFC: r216016 Define VM_KMEM_SIZE_MAX on sparc64. Otherwise kernel built with DEBUG_MEMGUARD panics early in kmeminit() with the message "kmem_suballoc: bad status return of 1" because of zero "size" argument passed to kmem_suballoc() due to "vm_kmem_size_max" being zero. The problem also exists on ia64. Modified: stable/7/sys/sparc64/include/vmparam.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/vmparam.h ============================================================================== --- stable/7/sys/sparc64/include/vmparam.h Mon Jul 25 14:30:44 2011 (r224309) +++ stable/7/sys/sparc64/include/vmparam.h Mon Jul 25 14:33:37 2011 (r224310) @@ -230,6 +230,14 @@ #endif /* + * Ceiling on amount of kmem_map kva space. + */ +#ifndef VM_KMEM_SIZE_MAX +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ + VM_MIN_KERNEL_ADDRESS + 1) * 3 / 5) +#endif + +/* * Initial pagein size of beginning of executable file. */ #ifndef VM_INITIAL_PAGEIN From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 14:34:31 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0704B106566B; Mon, 25 Jul 2011 14:34: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 E9A418FC13; Mon, 25 Jul 2011 14:34:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PEYUif060395; Mon, 25 Jul 2011 14:34:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEYUYv060393; Mon, 25 Jul 2011 14:34:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251434.p6PEYUYv060393@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224311 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:34:31 -0000 Author: marius Date: Mon Jul 25 14:34:30 2011 New Revision: 224311 URL: http://svn.freebsd.org/changeset/base/224311 Log: MFC: r219782 On Serengeti-class machines the OFW root isn't the parent of the CPU nodes. Modified: stable/7/sys/sparc64/sparc64/tick.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/7/sys/sparc64/sparc64/tick.c Mon Jul 25 14:33:37 2011 (r224310) +++ stable/7/sys/sparc64/sparc64/tick.c Mon Jul 25 14:34:30 2011 (r224311) @@ -118,8 +118,8 @@ cpu_initclocks(void) sclock = 0; if (PCPU_GET(impl) == CPU_IMPL_SPARC64V || PCPU_GET(impl) >= CPU_IMPL_ULTRASPARCIII) { - if (OF_getprop(OF_parent(PCPU_GET(node)), "stick-frequency", - &sclock, sizeof(sclock)) == -1) { + if (OF_getprop(OF_peer(0), "stick-frequency", &sclock, + sizeof(sclock)) == -1) { panic("%s: could not determine STICK frequency", __func__); } From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 14:44:01 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E8B6106566B; Mon, 25 Jul 2011 14:44: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 2CB618FC12; Mon, 25 Jul 2011 14:44: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 p6PEi1eH060874; Mon, 25 Jul 2011 14:44:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEi0XM060865; Mon, 25 Jul 2011 14:44:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251444.p6PEi0XM060865@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224315 - stable/7/sys/dev/mii X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:44:01 -0000 Author: marius Date: Mon Jul 25 14:44:00 2011 New Revision: 224315 URL: http://svn.freebsd.org/changeset/base/224315 Log: MFC: r220938 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/dev/mii/brgphyreg.h stable/7/sys/dev/mii/ciphyreg.h stable/7/sys/dev/mii/e1000phy.c stable/7/sys/dev/mii/e1000phyreg.h stable/7/sys/dev/mii/mii_physubr.c stable/7/sys/dev/mii/miivar.h stable/7/sys/dev/mii/rgephyreg.h stable/7/sys/dev/mii/xmphyreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mii/brgphyreg.h ============================================================================== --- stable/7/sys/dev/mii/brgphyreg.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/brgphyreg.h Mon Jul 25 14:44:00 2011 (r224315) @@ -59,7 +59,7 @@ #define BRGPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define BRGPHY_BMSR_PRESUB 0x0040 /* Preamble surpression */ #define BRGPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define BRGPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define BRGPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define BRGPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define BRGPHY_BMSR_LINK 0x0004 /* Link status */ #define BRGPHY_BMSR_JABBER 0x0002 /* Jabber detected */ Modified: stable/7/sys/dev/mii/ciphyreg.h ============================================================================== --- stable/7/sys/dev/mii/ciphyreg.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/ciphyreg.h Mon Jul 25 14:44:00 2011 (r224315) @@ -68,7 +68,7 @@ #define CIPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define CIPHY_BMSR_PRESUB 0x0040 /* Preamble surpression */ #define CIPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define CIPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define CIPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define CIPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define CIPHY_BMSR_LINK 0x0004 /* Link status */ #define CIPHY_BMSR_JABBER 0x0002 /* Jabber detected */ @@ -170,7 +170,7 @@ /* Vendor-specific PHY registers */ -/* 100baseTX status extention register */ +/* 100baseTX status extension register */ #define CIPHY_MII_100STS 0x10 #define CIPHY_100STS_DESLCK 0x8000 /* descrambler locked */ #define CIPHY_100STS_LKCERR 0x4000 /* lock error detected/lock lost */ @@ -181,7 +181,7 @@ #define CIPHY_100STS_SSDERR 0x0200 /* false carrier error detected */ #define CIPHY_100STS_ESDERR 0x0100 /* premature end of stream error */ -/* 1000BT status extention register #2 */ +/* 1000BT status extension register #2 */ #define CIPHY_MII_1000STS2 0x11 #define CIPHY_1000STS2_DESLCK 0x8000 /* descrambler locked */ #define CIPHY_1000STS2_LKCERR 0x4000 /* lock error detected/lock lost */ @@ -191,7 +191,7 @@ #define CIPHY_1000STS2_TXERR 0x0400 /* transmit error detected */ #define CIPHY_1000STS2_SSDERR 0x0200 /* false carrier error detected */ #define CIPHY_1000STS2_ESDERR 0x0100 /* premature end of stream error */ -#define CIPHY_1000STS2_CARREXT 0x0080 /* carrier extention err detected */ +#define CIPHY_1000STS2_CARREXT 0x0080 /* carrier extension err detected */ #define CIPHY_1000STS2_BCM5400 0x0040 /* non-complient BCM5400 detected */ /* Bypass control register */ @@ -332,7 +332,7 @@ #define CIPHY_LED_LINKACTBLINK 0x0004 /* enable link/activity LED blink */ #define CIPHY_LED_BLINKRATE 0x0002 /* blink rate 0=10hz, 1=5hz */ -/* Auxilliary control and status register */ +/* Auxiliary control and status register */ #define CIPHY_MII_AUXCSR 0x1C #define CIPHY_AUXCSR_ANEGDONE 0x8000 /* Autoneg complete */ #define CIPHY_AUXCSR_ANEGOFF 0x4000 /* Autoneg disabled */ Modified: stable/7/sys/dev/mii/e1000phy.c ============================================================================== --- stable/7/sys/dev/mii/e1000phy.c Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/e1000phy.c Mon Jul 25 14:44:00 2011 (r224315) @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Additonal Copyright (c) 2001 by Traakan Software under same licence. + * Additional Copyright (c) 2001 by Traakan Software under same licence. * Secondary Author: Matthew Jacob */ Modified: stable/7/sys/dev/mii/e1000phyreg.h ============================================================================== --- stable/7/sys/dev/mii/e1000phyreg.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/e1000phyreg.h Mon Jul 25 14:44:00 2011 (r224315) @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Additonal Copyright (c) 2001 by Traakan Software under same licence. + * Additional Copyright (c) 2001 by Traakan Software under same licence. * Secondary Author: Matthew Jacob */ Modified: stable/7/sys/dev/mii/mii_physubr.c ============================================================================== --- stable/7/sys/dev/mii/mii_physubr.c Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/mii_physubr.c Mon Jul 25 14:44:00 2011 (r224315) @@ -109,7 +109,7 @@ mii_phy_setmedia(struct mii_softc *sc) /* * Force renegotiation if MIIF_DOPAUSE or MIIF_FORCEANEG. * The former is necessary as we might switch from flow- - * control advertisment being off to on or vice versa. + * control advertisement being off to on or vice versa. */ if ((PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN) == 0 || (sc->mii_flags & (MIIF_DOPAUSE | MIIF_FORCEANEG)) != 0) Modified: stable/7/sys/dev/mii/miivar.h ============================================================================== --- stable/7/sys/dev/mii/miivar.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/miivar.h Mon Jul 25 14:44:00 2011 (r224315) @@ -134,7 +134,7 @@ typedef struct mii_softc mii_softc_t; #define MIIF_IS_HPNA 0x00000200 /* is a HomePNA device */ #define MIIF_FORCEANEG 0x00000400 /* force auto-negotiation */ #define MIIF_NOMANPAUSE 0x00100000 /* no manual PAUSE selection */ -#define MIIF_FORCEPAUSE 0x00200000 /* force PAUSE advertisment */ +#define MIIF_FORCEPAUSE 0x00200000 /* force PAUSE advertisement */ #define MIIF_MACPRIV0 0x01000000 /* private to the MAC driver */ #define MIIF_MACPRIV1 0x02000000 /* private to the MAC driver */ #define MIIF_MACPRIV2 0x04000000 /* private to the MAC driver */ Modified: stable/7/sys/dev/mii/rgephyreg.h ============================================================================== --- stable/7/sys/dev/mii/rgephyreg.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/rgephyreg.h Mon Jul 25 14:44:00 2011 (r224315) @@ -66,7 +66,7 @@ #define RGEPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define RGEPHY_BMSR_PRESUB 0x0040 /* Preamble surpression */ #define RGEPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define RGEPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define RGEPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define RGEPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define RGEPHY_BMSR_LINK 0x0004 /* Link status */ #define RGEPHY_BMSR_JABBER 0x0002 /* Jabber detected */ Modified: stable/7/sys/dev/mii/xmphyreg.h ============================================================================== --- stable/7/sys/dev/mii/xmphyreg.h Mon Jul 25 14:43:51 2011 (r224314) +++ stable/7/sys/dev/mii/xmphyreg.h Mon Jul 25 14:44:00 2011 (r224315) @@ -51,7 +51,7 @@ #define XMPHY_MII_BMSR 0x01 #define XMPHY_BMSR_EXTSTS 0x0100 /* Extended status present */ #define XMPHY_BMSR_ACOMP 0x0020 /* Autoneg complete */ -#define XMPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occured */ +#define XMPHY_BMSR_RFAULT 0x0010 /* Remote fault condition occurred */ #define XMPHY_BMSR_ANEG 0x0008 /* Autoneg capable */ #define XMPHY_BMSR_LINK 0x0004 /* Link status */ #define XMPHY_BMSR_EXT 0x0001 /* Extended capability */ From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 14:45:14 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A26D1065670; Mon, 25 Jul 2011 14:45: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 EC0078FC0C; Mon, 25 Jul 2011 14:45: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 p6PEjD40061000; Mon, 25 Jul 2011 14:45:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEjDC4060993; Mon, 25 Jul 2011 14:45:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251445.p6PEjDC4060993@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224316 - in stable/7/sys/sparc64: include sbus sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:45:14 -0000 Author: marius Date: Mon Jul 25 14:45:13 2011 New Revision: 224316 URL: http://svn.freebsd.org/changeset/base/224316 Log: MFC: r220939 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/sparc64/include/cpufunc.h stable/7/sys/sparc64/sbus/lsi64854.c stable/7/sys/sparc64/sbus/ofw_sbus.h stable/7/sys/sparc64/sparc64/exception.S stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/cpufunc.h ============================================================================== --- stable/7/sys/sparc64/include/cpufunc.h Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/include/cpufunc.h Mon Jul 25 14:45:13 2011 (r224316) @@ -187,7 +187,7 @@ int fasword32(u_long asi, void *addr, ui /* * Macro intended to be used instead of wr(asr23, val, xorval) for writing to * the TICK_COMPARE register in order to avoid a bug in BlackBird CPUs that - * can cause these writes to fail under certain condidtions which in turn + * can cause these writes to fail under certain conditions which in turn * causes the hardclock to stop. The workaround is to read the TICK_COMPARE * register back immediately after writing to it with these two instructions * aligned to a quadword boundary in order to ensure that I$ misses won't Modified: stable/7/sys/sparc64/sbus/lsi64854.c ============================================================================== --- stable/7/sys/sparc64/sbus/lsi64854.c Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/sbus/lsi64854.c Mon Jul 25 14:45:13 2011 (r224316) @@ -528,7 +528,7 @@ lsi64854_scsi_intr(void *arg) } trans = sc->sc_dmasize - resid; - if (trans < 0) { /* transfered < 0? */ + if (trans < 0) { /* transferred < 0? */ #if 0 /* * This situation can happen in perfectly normal operation @@ -718,7 +718,7 @@ lsi64854_pp_intr(void *arg) sc->sc_active = 0; trans = sc->sc_dmasize - resid; - if (trans < 0) /* transfered < 0? */ + if (trans < 0) /* transferred < 0? */ trans = sc->sc_dmasize; *sc->sc_dmalen -= trans; *sc->sc_dmaaddr += trans; Modified: stable/7/sys/sparc64/sbus/ofw_sbus.h ============================================================================== --- stable/7/sys/sparc64/sbus/ofw_sbus.h Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/sbus/ofw_sbus.h Mon Jul 25 14:45:13 2011 (r224316) @@ -41,7 +41,7 @@ struct sbus_regs { u_int32_t sbr_size; }; -/* Address translation accross busses */ +/* Address translation across busses */ struct sbus_ranges { u_int32_t cspace; /* Client space */ u_int32_t coffset; /* Client offset */ Modified: stable/7/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 14:45:13 2011 (r224316) @@ -377,7 +377,7 @@ END(rsf_fatal) * Due to its size a trap table is an inherently hard thing to represent in * code in a clean way. There are approximately 1024 vectors, of 8 or 32 * instructions each, many of which are identical. The way that this is - * layed out is the instructions (8 or 32) for the actual trap vector appear + * laid out is the instructions (8 or 32) for the actual trap vector appear * as an AS macro. In general this code branches to tl0_trap or tl1_trap, * but if not supporting code can be placed just after the definition of the * macro. The macros are then instantiated in a different section (.trap), @@ -2405,7 +2405,7 @@ ENTRY(tl0_ret) * Check for pending asts atomically with returning. We must raise * the PIL before checking, and if no asts are found the PIL must * remain raised until the retry is executed, or we risk missing asts - * caused by interrupts occuring after the test. If the PIL is + * caused by interrupts occurring after the test. If the PIL is * lowered, as it is when we call ast, the check must be re-executed. */ wrpr %g0, PIL_TICK, %pil Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/sparc64/machdep.c Mon Jul 25 14:45:13 2011 (r224316) @@ -557,7 +557,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * is necessary in order to set obp-control-relinquished to true * within the PROM so obtaining /virtual-memory/translations doesn't * trigger a fatal reset error or worse things further down the road. - * XXX it should be possible to use this soley instead of writing + * XXX it should be possible to use this solely instead of writing * %tba in cpu_setregs(). Doing so causes a hang however. */ sun4u_set_traptable(tl0_base); Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 14:44:00 2011 (r224315) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 14:45:13 2011 (r224316) @@ -930,7 +930,7 @@ pmap_kenter(vm_offset_t va, vm_page_t m) /* * Map a wired page into kernel virtual address space. This additionally - * takes a flag argument wich is or'ed to the TTE data. This is used by + * takes a flag argument which is or'ed to the TTE data. This is used by * sparc64_bus_mem_map(). * NOTE: if the mapping is non-cacheable, it's the caller's responsibility * to flush entries that might still be in the cache, if applicable. From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 14:46:25 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 762B8106564A; Mon, 25 Jul 2011 14:46:25 +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 4B72A8FC1F; Mon, 25 Jul 2011 14:46: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 p6PEkPdW061166; Mon, 25 Jul 2011 14:46:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PEkPkp061163; Mon, 25 Jul 2011 14:46:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251446.p6PEkPkp061163@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 14:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224319 - stable/7/sys/dev/hme X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 14:46:25 -0000 Author: marius Date: Mon Jul 25 14:46:24 2011 New Revision: 224319 URL: http://svn.freebsd.org/changeset/base/224319 Log: MFC: r220940 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/dev/hme/if_hme.c stable/7/sys/dev/hme/if_hmereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hme/if_hme.c ============================================================================== --- stable/7/sys/dev/hme/if_hme.c Mon Jul 25 14:46:24 2011 (r224318) +++ stable/7/sys/dev/hme/if_hme.c Mon Jul 25 14:46:24 2011 (r224319) @@ -203,7 +203,7 @@ hme_config(struct hme_softc *sc) * the DMA bus tag: * sc_dmatag * - * the bus handles, tags and offsets (splitted for SBus compatability): + * the bus handles, tags and offsets (splitted for SBus compatibility): * sc_seb{t,h,o} (Shared Ethernet Block registers) * sc_erx{t,h,o} (Receiver Unit registers) * sc_etx{t,h,o} (Transmitter Unit registers) @@ -1559,7 +1559,7 @@ hme_mediachange_locked(struct hme_softc * If both PHYs are present reset them. This is required for * unisolating the previously isolated PHY when switching PHYs. * As the above hme_mifinit() call will set the MII drivers in - * the XIF configuration register accoring to the currently + * the XIF configuration register according to the currently * selected media, there should be no window during which the * data paths of both transceivers are open at the same time, * even if the PHY device drivers use MIIF_NOISOLATE. Modified: stable/7/sys/dev/hme/if_hmereg.h ============================================================================== --- stable/7/sys/dev/hme/if_hmereg.h Mon Jul 25 14:46:24 2011 (r224318) +++ stable/7/sys/dev/hme/if_hmereg.h Mon Jul 25 14:46:24 2011 (r224319) @@ -79,7 +79,7 @@ #define HME_SEB_STAT_TXEACK 0x04000000 /* error during tx DMA */ #define HME_SEB_STAT_TXLERR 0x08000000 /* late error during tx DMA */ #define HME_SEB_STAT_TXPERR 0x10000000 /* parity error during tx DMA */ -#define HME_SEB_STAT_TXTERR 0x20000000 /* tag error durig tx DMA */ +#define HME_SEB_STAT_TXTERR 0x20000000 /* tag error during tx DMA */ #define HME_SEB_STAT_SLVERR 0x40000000 /* pio access error */ #define HME_SEB_STAT_SLVPERR 0x80000000 /* pio access parity error */ #define HME_SEB_STAT_BITS "\177\020" \ From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 15:01:40 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C86F106564A; Mon, 25 Jul 2011 15:01:40 +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 6B3B78FC0A; Mon, 25 Jul 2011 15:01: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 p6PF1ewf061766; Mon, 25 Jul 2011 15:01:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PF1eqf061764; Mon, 25 Jul 2011 15:01:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251501.p6PF1eqf061764@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 15:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224321 - stable/7/sys/dev/gem X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:01:40 -0000 Author: marius Date: Mon Jul 25 15:01:40 2011 New Revision: 224321 URL: http://svn.freebsd.org/changeset/base/224321 Log: MFC: r220941 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/dev/gem/if_gem.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/gem/if_gem.c ============================================================================== --- stable/7/sys/dev/gem/if_gem.c Mon Jul 25 15:01:37 2011 (r224320) +++ stable/7/sys/dev/gem/if_gem.c Mon Jul 25 15:01:40 2011 (r224321) @@ -1069,7 +1069,7 @@ gem_init_locked(struct gem_softc *sc) /* step 14. Issue Transmit Pending command. */ - /* step 15. Give the reciever a swift kick. */ + /* step 15. Give the receiver a swift kick. */ GEM_BANK1_WRITE_4(sc, GEM_RX_KICK, GEM_NRXDESC - 4); ifp->if_drv_flags |= IFF_DRV_RUNNING; From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 15:05:37 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A51D7106564A; Mon, 25 Jul 2011 15:05:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93B208FC1E; Mon, 25 Jul 2011 15:05: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 p6PF5bHB061988; Mon, 25 Jul 2011 15:05:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PF5bv4061986; Mon, 25 Jul 2011 15:05:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251505.p6PF5bv4061986@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 15:05: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: r224322 - stable/7/sys/dev/cas X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:05:37 -0000 Author: marius Date: Mon Jul 25 15:05:37 2011 New Revision: 224322 URL: http://svn.freebsd.org/changeset/base/224322 Log: MFC: r220943 Correct spelling in a comment. Submitted by: brucec Modified: stable/7/sys/dev/cas/if_cas.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/cas/if_cas.c ============================================================================== --- stable/7/sys/dev/cas/if_cas.c Mon Jul 25 15:01:40 2011 (r224321) +++ stable/7/sys/dev/cas/if_cas.c Mon Jul 25 15:05:37 2011 (r224322) @@ -1153,7 +1153,7 @@ cas_init_locked(struct cas_softc *sc) /* step 14. Issue Transmit Pending command. */ - /* step 15. Give the reciever a swift kick. */ + /* step 15. Give the receiver a swift kick. */ CAS_WRITE_4(sc, CAS_RX_KICK, CAS_NRXDESC - 4); CAS_WRITE_4(sc, CAS_RX_COMP_TAIL, 0); if ((sc->sc_flags & CAS_REG_PLUS) != 0) From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 15:10:53 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9B081065673; Mon, 25 Jul 2011 15:10:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7B168FC1C; Mon, 25 Jul 2011 15:10: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 p6PFArc2062294; Mon, 25 Jul 2011 15:10:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PFArgw062289; Mon, 25 Jul 2011 15:10:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251510.p6PFArgw062289@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 15:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224325 - stable/7/sys/dev/sym X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 15:10:53 -0000 Author: marius Date: Mon Jul 25 15:10:53 2011 New Revision: 224325 URL: http://svn.freebsd.org/changeset/base/224325 Log: MFC: r220944, r220950 - Correct spelling. [1] - Remove variables which are unused besides initialization. [2] Submitted by: brucec, N.J. Mann [1], Christoph Mallon [2] Modified: stable/7/sys/dev/sym/README.sym stable/7/sys/dev/sym/sym_fw1.h stable/7/sys/dev/sym/sym_fw2.h stable/7/sys/dev/sym/sym_hipd.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sym/README.sym ============================================================================== --- stable/7/sys/dev/sym/README.sym Mon Jul 25 15:10:52 2011 (r224324) +++ stable/7/sys/dev/sym/README.sym Mon Jul 25 15:10:53 2011 (r224325) @@ -70,7 +70,7 @@ using `man sym' for driver usage and fea I haven't removed this README file from the repository since I may have to provide additional documentation to people interested in understanding the driver sources and/or in helping -driver development and maintainance. +driver development and maintenance. As a result, this file is now under reconstruction. :-) Modified: stable/7/sys/dev/sym/sym_fw1.h ============================================================================== --- stable/7/sys/dev/sym/sym_fw1.h Mon Jul 25 15:10:52 2011 (r224324) +++ stable/7/sys/dev/sym/sym_fw1.h Mon Jul 25 15:10:53 2011 (r224325) @@ -1027,7 +1027,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ * It shall be a tagged command. * Read SIMPLE+TAG. * The C code will deal with errors. - * Agressive optimization, is'nt it? :) + * Aggressive optimization, isn't it? :) */ SCR_MOVE_ABS (2) ^ SCR_MSG_IN, HADDR_1 (msgin), @@ -1051,7 +1051,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ RADDR_1 (dsa), /* * The SIDL still contains the TAG value. - * Agressive optimization, isn't it? :):) + * Aggressive optimization, isn't it? :):) */ SCR_REG_SFBR (sidl, SCR_SHL, 0), 0, @@ -1352,7 +1352,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ * some target to reset or some disconnected * job to abort. Since error recovery is a serious * busyness, we will really reset the SCSI BUS, if - * case of a SCSI interrupt occuring in this path. + * case of a SCSI interrupt occurring in this path. */ /* @@ -1461,7 +1461,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ PADDR_B (msg_weird_seen), /* * We donnot handle extended messages from SCRIPTS. - * Read the amount of data correponding to the + * Read the amount of data corresponding to the * message length and call the C code. */ SCR_COPY (1), Modified: stable/7/sys/dev/sym/sym_fw2.h ============================================================================== --- stable/7/sys/dev/sym/sym_fw2.h Mon Jul 25 15:10:52 2011 (r224324) +++ stable/7/sys/dev/sym/sym_fw2.h Mon Jul 25 15:10:53 2011 (r224325) @@ -945,7 +945,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ * It shall be a tagged command. * Read SIMPLE+TAG. * The C code will deal with errors. - * Agressive optimization, is'nt it? :) + * Aggressive optimization, isn't it? :) */ SCR_MOVE_ABS (2) ^ SCR_MSG_IN, HADDR_1 (msgin), @@ -957,7 +957,7 @@ static const struct SYM_FWA_SCR SYM_FWA_ offsetof(struct sym_lcb, head.itlq_tbl_sa), /* * The SIDL still contains the TAG value. - * Agressive optimization, isn't it? :):) + * Aggressive optimization, isn't it? :):) */ SCR_REG_SFBR (sidl, SCR_SHL, 0), 0, @@ -1213,7 +1213,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ * some target to reset or some disconnected * job to abort. Since error recovery is a serious * busyness, we will really reset the SCSI BUS, if - * case of a SCSI interrupt occuring in this path. + * case of a SCSI interrupt occurring in this path. */ /* @@ -1320,7 +1320,7 @@ static const struct SYM_FWB_SCR SYM_FWB_ PADDR_B (msg_weird_seen), /* * We donnot handle extended messages from SCRIPTS. - * Read the amount of data correponding to the + * Read the amount of data corresponding to the * message length and call the C code. */ SCR_STORE_REL (scratcha, 1), Modified: stable/7/sys/dev/sym/sym_hipd.c ============================================================================== --- stable/7/sys/dev/sym/sym_hipd.c Mon Jul 25 15:10:52 2011 (r224324) +++ stable/7/sys/dev/sym/sym_hipd.c Mon Jul 25 15:10:53 2011 (r224325) @@ -366,7 +366,7 @@ static void MDELAY(int ms) { while (ms-- * from the SCRIPTS code. In addition, cache line alignment * is guaranteed for power of 2 cache line size. * - * This allocator has been developped for the Linux sym53c8xx + * This allocator has been developed for the Linux sym53c8xx * driver, since this O/S does not provide naturally aligned * allocations. * It has the advantage of allowing the driver to use private @@ -1959,10 +1959,8 @@ static void sym_fw1_setup(hcb_p np, const struct sym_fw *fw) { struct sym_fw1a_scr *scripta0; - struct sym_fw1b_scr *scriptb0; scripta0 = (struct sym_fw1a_scr *) np->scripta0; - scriptb0 = (struct sym_fw1b_scr *) np->scriptb0; /* * Fill variable parts in scripts. @@ -1983,10 +1981,8 @@ static void sym_fw2_setup(hcb_p np, const struct sym_fw *fw) { struct sym_fw2a_scr *scripta0; - struct sym_fw2b_scr *scriptb0; scripta0 = (struct sym_fw2a_scr *) np->scripta0; - scriptb0 = (struct sym_fw2b_scr *) np->scriptb0; /* * Fill variable parts in scripts. @@ -2294,7 +2290,7 @@ static void sym_nvram_setup_target (hcb_ static int sym_read_nvram (hcb_p np, struct sym_nvram *nvp); /* - * Print something which allows to retrieve the controler type, + * Print something which allows to retrieve the controller type, * unit, target, lun concerned by a kernel message. */ static void PRINT_TARGET (hcb_p np, int target) @@ -4300,7 +4296,7 @@ static void sym_int_ma (hcb_p np) } /* - * The data in the dma fifo has not been transfered to + * The data in the dma fifo has not been transferred to * the target -> add the amount to the rest * and clear the data. * Check the sstat2 register in case of wide transfer. @@ -7520,7 +7516,7 @@ static void sym_action(struct cam_sim *s } /* - * Retreive the target and lun descriptors. + * Retrieve the target and lun descriptors. */ tp = &np->target[ccb_h->target_id]; lp = sym_lp(np, tp, ccb_h->target_lun); From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 16:11:52 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E080D106566C; Mon, 25 Jul 2011 16:11:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEB488FC1A; Mon, 25 Jul 2011 16:11:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGBqka064184; Mon, 25 Jul 2011 16:11:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGBq7O064179; Mon, 25 Jul 2011 16:11:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251611.p6PGBq7O064179@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:11:52 +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: r224327 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:11:53 -0000 Author: marius Date: Mon Jul 25 16:11:52 2011 New Revision: 224327 URL: http://svn.freebsd.org/changeset/base/224327 Log: MFC: r198262 Use callout_init_mtx on FreeBSD versions recent enough. This closes the race where interrupt thread can complete the request for which timeout has fired and while mpt_timeout has blocked on mpt_lock. Modified: stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_raid.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Mon Jul 25 15:14:03 2011 (r224326) +++ stable/7/sys/dev/mpt/mpt.c Mon Jul 25 16:11:52 2011 (r224327) @@ -1239,7 +1239,6 @@ retry: req->state = REQ_STATE_ALLOCATED; req->chain = NULL; mpt_assign_serno(mpt, req); - mpt_callout_init(&req->callout); } else if (sleep_ok != 0) { mpt->getreqwaiter = 1; mpt_sleep(mpt, &mpt->request_free_list, PUSER, "mptgreq", 0); @@ -2252,6 +2251,7 @@ mpt_core_attach(struct mpt_softc *mpt) for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { request_t *req = &mpt->request_pool[val]; req->state = REQ_STATE_ALLOCATED; + mpt_callout_init(mpt, &req->callout); mpt_free_request(mpt, req); } MPT_UNLOCK(mpt); @@ -2335,10 +2335,18 @@ mpt_core_shutdown(struct mpt_softc *mpt) void mpt_core_detach(struct mpt_softc *mpt) { + int val; + /* * XXX: FREE MEMORY */ mpt_disable_ints(mpt); + + /* Make sure no request has pending timeouts. */ + for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { + request_t *req = &mpt->request_pool[val]; + mpt_callout_drain(mpt, &req->callout); + } } int Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Mon Jul 25 15:14:03 2011 (r224326) +++ stable/7/sys/dev/mpt/mpt.h Mon Jul 25 16:11:52 2011 (r224327) @@ -303,13 +303,6 @@ void mpt_map_rquest(void *, bus_dma_segm kthread_exit(status) #endif -/****************************** Timer Facilities ******************************/ -#if __FreeBSD_version > 500000 -#define mpt_callout_init(c) callout_init(c, /*mpsafe*/1); -#else -#define mpt_callout_init(c) callout_init(c); -#endif - /********************************** Endianess *********************************/ #define MPT_2_HOST64(ptr, tag) ptr->tag = le64toh(ptr->tag) #define MPT_2_HOST32(ptr, tag) ptr->tag = le32toh(ptr->tag) @@ -897,6 +890,10 @@ mpt_sleep(struct mpt_softc *mpt, void *i callout_reset(&(req)->callout, (ticks), (func), (arg)); #define mpt_req_untimeout(req, func, arg) \ callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init(c) +#define mpt_callout_drain(mpt, c) \ + callout_stop(c) #else #if 1 @@ -919,9 +916,13 @@ mpt_sleep(struct mpt_softc *mpt, void *i #define mpt_sleep(mpt, ident, priority, wmesg, timo) \ msleep(ident, &(mpt)->mpt_lock, priority, wmesg, timo) #define mpt_req_timeout(req, ticks, func, arg) \ - callout_reset(&(req)->callout, (ticks), (func), (arg)); + callout_reset(&(req)->callout, (ticks), (func), (arg)) #define mpt_req_untimeout(req, func, arg) \ callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init_mtx(c, &(mpt)->mpt_lock, 0) +#define mpt_callout_drain(mpt, c) \ + callout_drain(c) #else @@ -934,18 +935,18 @@ mpt_sleep(struct mpt_softc *mpt, void *i #define MPTLOCK_2_CAMLOCK(mpt) #define CAMLOCK_2_MPTLOCK(mpt) +#define mpt_req_timeout(req, ticks, func, arg) \ + callout_reset(&(req)->callout, (ticks), (func), (arg)) +#define mpt_req_untimeout(req, func, arg) \ + callout_stop(&(req)->callout) +#define mpt_callout_init(mpt, c) \ + callout_init(c, 0) +#define mpt_callout_drain(mpt, c) \ + callout_drain(c) + static __inline int mpt_sleep(struct mpt_softc *, void *, int, const char *, int); -#define mpt_ccb_timeout(ccb, ticks, func, arg) \ - do { \ - (ccb)->ccb_h.timeout_ch = timeout((func), (arg), (ticks)); \ - } while (0) -#define mpt_ccb_untimeout(ccb, func, arg) \ - untimeout((func), (arg), (ccb)->ccb_h.timeout_ch) -#define mpt_ccb_timeout_init(ccb) \ - callout_handle_init(&(ccb)->ccb_h.timeout_ch) - static __inline int mpt_sleep(struct mpt_softc *mpt, void *i, int p, const char *w, int t) { Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 15:14:03 2011 (r224326) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:11:52 2011 (r224327) @@ -1250,7 +1250,10 @@ mpt_timeout(void *arg) ccb = (union ccb *)arg; mpt = ccb->ccb_h.ccb_mpt_ptr; +#if __FreeBSD_version < 500000 MPT_LOCK(mpt); +#endif + MPT_LOCK_ASSERT(mpt); req = ccb->ccb_h.ccb_req_ptr; mpt_prt(mpt, "request %p:%u timed out for ccb %p (req->ccb %p)\n", req, req->serno, ccb, req->ccb); @@ -1261,7 +1264,9 @@ mpt_timeout(void *arg) req->state |= REQ_STATE_TIMEDOUT; mpt_wakeup_recovery_thread(mpt); } +#if __FreeBSD_version < 500000 MPT_UNLOCK(mpt); +#endif } /* Modified: stable/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 15:14:03 2011 (r224326) +++ stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 16:11:52 2011 (r224327) @@ -271,7 +271,7 @@ mpt_raid_attach(struct mpt_softc *mpt) mpt_handler_t handler; int error; - mpt_callout_init(&mpt->raid_timer); + mpt_callout_init(mpt, &mpt->raid_timer); error = mpt_spawn_raid_thread(mpt); if (error != 0) { @@ -320,10 +320,10 @@ mpt_raid_detach(struct mpt_softc *mpt) struct ccb_setasync csa; mpt_handler_t handler; - callout_stop(&mpt->raid_timer); + mpt_callout_drain(mpt, &mpt->raid_timer); + MPT_LOCK(mpt); mpt_terminate_raid_thread(mpt); - handler.reply_handler = mpt_raid_reply_handler; mpt_deregister_handler(mpt, MPT_HANDLER_REPLY, handler, raid_handler_id); @@ -1570,9 +1570,14 @@ mpt_raid_timer(void *arg) struct mpt_softc *mpt; mpt = (struct mpt_softc *)arg; +#if __FreeBSD_version < 500000 MPT_LOCK(mpt); +#endif + MPT_LOCK_ASSERT(mpt); mpt_raid_wakeup(mpt); +#if __FreeBSD_version < 500000 MPT_UNLOCK(mpt); +#endif } void From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 16:14:37 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16C361065692; Mon, 25 Jul 2011 16:14:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 057548FC12; Mon, 25 Jul 2011 16:14: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 p6PGEajT064313; Mon, 25 Jul 2011 16:14:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGEaHl064311; Mon, 25 Jul 2011 16:14:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251614.p6PGEaHl064311@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:14:36 +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: r224328 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:14:37 -0000 Author: marius Date: Mon Jul 25 16:14:36 2011 New Revision: 224328 URL: http://svn.freebsd.org/changeset/base/224328 Log: MFC: r207543 Print IR_RESYNC updates informatively. Obtained from: pluknet Modified: stable/7/sys/dev/mpt/mpt_cam.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:11:52 2011 (r224327) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:14:36 2011 (r224328) @@ -2574,6 +2574,10 @@ mpt_cam_event(struct mpt_softc *mpt, req CAMLOCK_2_MPTLOCK(mpt); break; } + case MPI_EVENT_IR_RESYNC_UPDATE: + mpt_prt(mpt, "IR resync update %d completed\n", + (data0 >> 16) & 0xff); + break; case MPI_EVENT_EVENT_CHANGE: case MPI_EVENT_INTEGRATED_RAID: case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 16:20:02 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3820106564A; Mon, 25 Jul 2011 16:20:02 +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 A8EA28FC13; Mon, 25 Jul 2011 16:20:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PGK2ce064583; Mon, 25 Jul 2011 16:20:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGK2HM064582; Mon, 25 Jul 2011 16:20:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251620.p6PGK2HM064582@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224330 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:20:02 -0000 Author: marius Date: Mon Jul 25 16:20:02 2011 New Revision: 224330 URL: http://svn.freebsd.org/changeset/base/224330 Log: MFC: r210943 Figure which is the IO and MEM bars- do not assume that they are in a fixed order. PR: 149220 Obtained from: John Baldwin Modified: stable/7/sys/dev/mpt/mpt_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:20:00 2011 (r224329) +++ stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:20:02 2011 (r224330) @@ -194,8 +194,6 @@ __FBSDID("$FreeBSD$"); #endif -#define MPT_IO_BAR 0 -#define MPT_MEM_BAR 1 static int mpt_pci_probe(device_t); static int mpt_pci_attach(device_t); @@ -420,6 +418,7 @@ mpt_pci_attach(device_t dev) struct mpt_softc *mpt; int iqd; uint32_t data, cmd; + int mpt_io_bar, mpt_mem_bar; /* Allocate the softc structure */ mpt = (struct mpt_softc*)device_get_softc(dev); @@ -505,11 +504,25 @@ mpt_pci_attach(device_t dev) } /* + * Figure out which are the I/O and MEM Bars + */ + data = pci_read_config(dev, PCIR_BAR(0), 4); + if (PCI_BAR_IO(data)) { + /* BAR0 is IO, BAR1 is memory */ + mpt_io_bar = 0; + mpt_mem_bar = 1; + } else { + /* BAR0 is memory, BAR1 is IO */ + mpt_mem_bar = 0; + mpt_io_bar = 1; + } + + /* * Set up register access. PIO mode is required for * certain reset operations (but must be disabled for * some cards otherwise). */ - mpt->pci_pio_rid = PCIR_BAR(MPT_IO_BAR); + mpt->pci_pio_rid = PCIR_BAR(mpt_io_bar); mpt->pci_pio_reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &mpt->pci_pio_rid, RF_ACTIVE); if (mpt->pci_pio_reg == NULL) { @@ -520,7 +533,7 @@ mpt_pci_attach(device_t dev) mpt->pci_pio_sh = rman_get_bushandle(mpt->pci_pio_reg); /* Allocate kernel virtual memory for the 9x9's Mem0 region */ - mpt->pci_mem_rid = PCIR_BAR(MPT_MEM_BAR); + mpt->pci_mem_rid = PCIR_BAR(mpt_mem_bar); mpt->pci_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &mpt->pci_mem_rid, RF_ACTIVE); if (mpt->pci_reg == NULL) { From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 16:24:27 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C99D2106566B; Mon, 25 Jul 2011 16:24:27 +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 B85578FC1A; Mon, 25 Jul 2011 16:24: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 p6PGORYj064771; Mon, 25 Jul 2011 16:24:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGORJT064768; Mon, 25 Jul 2011 16:24:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251624.p6PGORJT064768@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:24:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224331 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:24:27 -0000 Author: marius Date: Mon Jul 25 16:24:27 2011 New Revision: 224331 URL: http://svn.freebsd.org/changeset/base/224331 Log: MFC: r203484 Do not release device, when changing number of openings. Modified: stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_raid.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:20:02 2011 (r224330) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:24:27 2011 (r224331) @@ -2563,6 +2563,7 @@ mpt_cam_event(struct mpt_softc *mpt, req } xpt_setup_ccb(&crs.ccb_h, tmppath, 5); crs.ccb_h.func_code = XPT_REL_SIMQ; + crs.ccb_h.flags = CAM_DEV_QFREEZE; crs.release_flags = RELSIM_ADJUST_OPENINGS; crs.openings = pqf->CurrentDepth - 1; xpt_action((union ccb *)&crs); Modified: stable/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 16:20:02 2011 (r224330) +++ stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 16:24:27 2011 (r224331) @@ -1062,6 +1062,7 @@ mpt_adjust_queue_depth(struct mpt_softc xpt_setup_ccb(&crs.ccb_h, path, /*priority*/5); crs.ccb_h.func_code = XPT_REL_SIMQ; + crs.ccb_h.flags = CAM_DEV_QFREEZE; crs.release_flags = RELSIM_ADJUST_OPENINGS; crs.openings = mpt->raid_queue_depth; xpt_action((union ccb *)&crs); From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 16:45:13 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FB031065670; Mon, 25 Jul 2011 16:45:13 +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 0D45B8FC15; Mon, 25 Jul 2011 16:45: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 p6PGjDTm065506; Mon, 25 Jul 2011 16:45:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGjC1i065500; Mon, 25 Jul 2011 16:45:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251645.p6PGjC1i065500@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224332 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:45:13 -0000 Author: marius Date: Mon Jul 25 16:45:12 2011 New Revision: 224332 URL: http://svn.freebsd.org/changeset/base/224332 Log: MFC: r209599 (partial), r209960: r209960 | marius - Make the maxsize parameter of the data buffer DMA tag match maxio, which was missed in r209599. Reported and tested by: Michael Moll - Declare mpt_dma_buf_alloc() static just like mpt_dma_buf_free(), both are used in mpt.c only. Reviewed by: ken MFC after: r209599 r209599 | ken Change the mpt driver to allow larger I/O sizes. The mpt driver previously didn't report a 'maxio' size to CAM, and so the da(4) driver limited I/O sizes to DFLTPHYS (64K) by default. The number of scatter gather segments allowed, as reported to busdma, was (128K / PAGE_SIZE) + 1, or 33 on architectures with 4K pages. Change things around so that we wait until we've determined how many segments the adapter can support before creating the busdma tag used for buffers, so we can potentially support more S/G segments and therefore larger I/O sizes. Also, fix some things that were broken about the module unload path. It still gets hung up inside CAM, though. mpt.c: Move some busdma initialization calls in here, and call them just after we've gotten the IOCFacts, and know how many S/G segments this adapter can support. mpt.h: Add max_cam_seg_cnt. mpt_cam.c: Fix the locking in mpt_cam_detach(). mpt_pci.c: Pull some busdma initialization and teardown out and put it in mpt.c. We now delay it until we know many scatter gather segments the adapter can support, and therefore how to setup our busdma tags. mpt_raid.c: Make sure we wake up the right wait channel to get the raid thread to wake up when we're trying to shut it down. Reviewed by: gibbs, mjacob MFC after: 2 weeks Modified: stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_pci.c stable/7/sys/dev/mpt/mpt_raid.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Mon Jul 25 16:24:27 2011 (r224331) +++ stable/7/sys/dev/mpt/mpt.c Mon Jul 25 16:45:12 2011 (r224332) @@ -128,6 +128,8 @@ static void mpt_send_event_ack(struct mp static int mpt_send_event_request(struct mpt_softc *mpt, int onoff); static int mpt_soft_reset(struct mpt_softc *mpt); static void mpt_hard_reset(struct mpt_softc *mpt); +static int mpt_dma_buf_alloc(struct mpt_softc *mpt); +static void mpt_dma_buf_free(struct mpt_softc *mpt); static int mpt_configure_ioc(struct mpt_softc *mpt, int, int); static int mpt_enable_ioc(struct mpt_softc *mpt, int); @@ -2247,14 +2249,6 @@ mpt_core_attach(struct mpt_softc *mpt) TAILQ_INIT(&mpt->request_pending_list); TAILQ_INIT(&mpt->request_free_list); TAILQ_INIT(&mpt->request_timeout_list); - MPT_LOCK(mpt); - for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { - request_t *req = &mpt->request_pool[val]; - req->state = REQ_STATE_ALLOCATED; - mpt_callout_init(mpt, &req->callout); - mpt_free_request(mpt, req); - } - MPT_UNLOCK(mpt); for (val = 0; val < MPT_MAX_LUNS; val++) { STAILQ_INIT(&mpt->trt[val].atios); STAILQ_INIT(&mpt->trt[val].inots); @@ -2347,6 +2341,8 @@ mpt_core_detach(struct mpt_softc *mpt) request_t *req = &mpt->request_pool[val]; mpt_callout_drain(mpt, &req->callout); } + + mpt_dma_buf_free(mpt); } int @@ -2481,6 +2477,105 @@ mpt_download_fw(struct mpt_softc *mpt) return (0); } +static int +mpt_dma_buf_alloc(struct mpt_softc *mpt) +{ + struct mpt_map_info mi; + uint8_t *vptr; + uint32_t pptr, end; + int i, error; + + /* Create a child tag for data buffers */ + if (mpt_dma_tag_create(mpt, mpt->parent_dmat, 1, + 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, + NULL, NULL, (mpt->max_cam_seg_cnt - 1) * PAGE_SIZE, + mpt->max_cam_seg_cnt, BUS_SPACE_MAXSIZE_32BIT, 0, + &mpt->buffer_dmat) != 0) { + mpt_prt(mpt, "cannot create a dma tag for data buffers\n"); + return (1); + } + + /* Create a child tag for request buffers */ + if (mpt_dma_tag_create(mpt, mpt->parent_dmat, PAGE_SIZE, 0, + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, + NULL, NULL, MPT_REQ_MEM_SIZE(mpt), 1, BUS_SPACE_MAXSIZE_32BIT, 0, + &mpt->request_dmat) != 0) { + mpt_prt(mpt, "cannot create a dma tag for requests\n"); + return (1); + } + + /* Allocate some DMA accessable memory for requests */ + if (bus_dmamem_alloc(mpt->request_dmat, (void **)&mpt->request, + BUS_DMA_NOWAIT, &mpt->request_dmap) != 0) { + mpt_prt(mpt, "cannot allocate %d bytes of request memory\n", + MPT_REQ_MEM_SIZE(mpt)); + return (1); + } + + mi.mpt = mpt; + mi.error = 0; + + /* Load and lock it into "bus space" */ + bus_dmamap_load(mpt->request_dmat, mpt->request_dmap, mpt->request, + MPT_REQ_MEM_SIZE(mpt), mpt_map_rquest, &mi, 0); + + if (mi.error) { + mpt_prt(mpt, "error %d loading dma map for DMA request queue\n", + mi.error); + return (1); + } + mpt->request_phys = mi.phys; + + /* + * Now create per-request dma maps + */ + i = 0; + pptr = mpt->request_phys; + vptr = mpt->request; + end = pptr + MPT_REQ_MEM_SIZE(mpt); + while(pptr < end) { + request_t *req = &mpt->request_pool[i]; + req->index = i++; + + /* Store location of Request Data */ + req->req_pbuf = pptr; + req->req_vbuf = vptr; + + pptr += MPT_REQUEST_AREA; + vptr += MPT_REQUEST_AREA; + + req->sense_pbuf = (pptr - MPT_SENSE_SIZE); + req->sense_vbuf = (vptr - MPT_SENSE_SIZE); + + error = bus_dmamap_create(mpt->buffer_dmat, 0, &req->dmap); + if (error) { + mpt_prt(mpt, "error %d creating per-cmd DMA maps\n", + error); + return (1); + } + } + + return (0); +} + +static void +mpt_dma_buf_free(struct mpt_softc *mpt) +{ + int i; + if (mpt->request_dmat == 0) { + mpt_lprt(mpt, MPT_PRT_DEBUG, "already released dma memory\n"); + return; + } + for (i = 0; i < MPT_MAX_REQUESTS(mpt); i++) { + bus_dmamap_destroy(mpt->buffer_dmat, mpt->request_pool[i].dmap); + } + bus_dmamap_unload(mpt->request_dmat, mpt->request_dmap); + bus_dmamem_free(mpt->request_dmat, mpt->request, mpt->request_dmap); + bus_dma_tag_destroy(mpt->request_dmat); + mpt->request_dmat = 0; + bus_dma_tag_destroy(mpt->buffer_dmat); +} + /* * Allocate/Initialize data structures for the controller. Called * once at instance startup. @@ -2489,7 +2584,7 @@ static int mpt_configure_ioc(struct mpt_softc *mpt, int tn, int needreset) { PTR_MSG_PORT_FACTS_REPLY pfp; - int error, port; + int error, port, val; size_t len; if (tn == MPT_MAX_TRYS) { @@ -2549,7 +2644,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, /* limited by the number of chain areas the card will support */ if (mpt->max_seg_cnt > mpt->ioc_facts.MaxChainDepth) { - mpt_lprt(mpt, MPT_PRT_DEBUG, + mpt_lprt(mpt, MPT_PRT_INFO, "chain depth limited to %u (from %u)\n", mpt->ioc_facts.MaxChainDepth, mpt->max_seg_cnt); mpt->max_seg_cnt = mpt->ioc_facts.MaxChainDepth; @@ -2558,17 +2653,37 @@ mpt_configure_ioc(struct mpt_softc *mpt, /* converted to the number of simple sges in chain segments. */ mpt->max_seg_cnt *= (MPT_NSGL(mpt) - 1); - mpt_lprt(mpt, MPT_PRT_DEBUG, "Maximum Segment Count: %u\n", - mpt->max_seg_cnt); - mpt_lprt(mpt, MPT_PRT_DEBUG, "MsgLength=%u IOCNumber = %d\n", + /* + * Use this as the basis for reporting the maximum I/O size to CAM. + */ + mpt->max_cam_seg_cnt = min(mpt->max_seg_cnt, (MAXPHYS / PAGE_SIZE) + 1); + + error = mpt_dma_buf_alloc(mpt); + if (error != 0) { + mpt_prt(mpt, "mpt_dma_buf_alloc() failed!\n"); + return (EIO); + } + + for (val = 0; val < MPT_MAX_REQUESTS(mpt); val++) { + request_t *req = &mpt->request_pool[val]; + req->state = REQ_STATE_ALLOCATED; + mpt_callout_init(mpt, &req->callout); + mpt_free_request(mpt, req); + } + + mpt_lprt(mpt, MPT_PRT_INFO, "Maximum Segment Count: %u, Maximum " + "CAM Segment Count: %u\n", mpt->max_seg_cnt, + mpt->max_cam_seg_cnt); + + mpt_lprt(mpt, MPT_PRT_INFO, "MsgLength=%u IOCNumber = %d\n", mpt->ioc_facts.MsgLength, mpt->ioc_facts.IOCNumber); - mpt_lprt(mpt, MPT_PRT_DEBUG, + mpt_lprt(mpt, MPT_PRT_INFO, "IOCFACTS: GlobalCredits=%d BlockSize=%u bytes " "Request Frame Size %u bytes Max Chain Depth %u\n", mpt->ioc_facts.GlobalCredits, mpt->ioc_facts.BlockSize, mpt->ioc_facts.RequestFrameSize << 2, mpt->ioc_facts.MaxChainDepth); - mpt_lprt(mpt, MPT_PRT_DEBUG, "IOCFACTS: Num Ports %d, FWImageSize %d, " + mpt_lprt(mpt, MPT_PRT_INFO, "IOCFACTS: Num Ports %d, FWImageSize %d, " "Flags=%#x\n", mpt->ioc_facts.NumberOfPorts, mpt->ioc_facts.FWImageSize, mpt->ioc_facts.Flags); @@ -2758,7 +2873,7 @@ mpt_enable_ioc(struct mpt_softc *mpt, in mpt_send_event_request(mpt, 1); if (mpt_send_port_enable(mpt, 0) != MPT_OK) { - mpt_prt(mpt, "failed to enable port 0\n"); + mpt_prt(mpt, "%s: failed to enable port 0\n", __func__); return (ENXIO); } } Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Mon Jul 25 16:24:27 2011 (r224331) +++ stable/7/sys/dev/mpt/mpt.h Mon Jul 25 16:45:12 2011 (r224332) @@ -743,6 +743,7 @@ struct mpt_softc { bus_addr_t request_phys; /* BusAddr of request memory */ uint32_t max_seg_cnt; /* calculated after IOC facts */ + uint32_t max_cam_seg_cnt;/* calculated from MAXPHYS*/ /* * Hardware management Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:24:27 2011 (r224331) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:45:12 2011 (r224332) @@ -1205,25 +1205,21 @@ mpt_cam_detach(struct mpt_softc *mpt) free(mpt->sas_portinfo, M_DEVBUF); mpt->sas_portinfo = NULL; } - MPT_UNLOCK(mpt); if (mpt->sim != NULL) { xpt_free_path(mpt->path); - MPT_LOCK(mpt); xpt_bus_deregister(cam_sim_path(mpt->sim)); - MPT_UNLOCK(mpt); cam_sim_free(mpt->sim, TRUE); mpt->sim = NULL; } if (mpt->phydisk_sim != NULL) { xpt_free_path(mpt->phydisk_path); - MPT_LOCK(mpt); xpt_bus_deregister(cam_sim_path(mpt->phydisk_sim)); - MPT_UNLOCK(mpt); cam_sim_free(mpt->phydisk_sim, TRUE); mpt->phydisk_sim = NULL; } + MPT_UNLOCK(mpt); } /* This routine is used after a system crash to dump core onto the swap device. @@ -3586,6 +3582,10 @@ mpt_action(struct cam_sim *sim, union cc cpi->target_sprt = 0; cpi->hba_eng_cnt = 0; cpi->max_target = mpt->port_facts[0].MaxDevices - 1; +#if 0 + cpi->maxio = (mpt->max_cam_seg_cnt - 1) * PAGE_SIZE; +#endif + /* * FC cards report MAX_DEVICES of 512, but * the MSG_SCSI_IO_REQUEST target id field @@ -4226,7 +4226,7 @@ mpt_fc_post_els(struct mpt_softc *mpt, r /* * Okay, set up ELS buffer pointers. ELS buffer pointers * consist of a TE SGL element (with details length of zero) - * followe by a SIMPLE SGL element which holds the address + * followed by a SIMPLE SGL element which holds the address * of the buffer. */ Modified: stable/7/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:24:27 2011 (r224331) +++ stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 16:45:12 2011 (r224332) @@ -733,9 +733,6 @@ mpt_pci_shutdown(device_t dev) static int mpt_dma_mem_alloc(struct mpt_softc *mpt) { - int i, error, nsegs; - uint8_t *vptr; - uint32_t pptr, end; size_t len; struct mpt_map_info mi; @@ -808,82 +805,6 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) } mpt->reply_phys = mi.phys; - /* Create a child tag for data buffers */ - - /* - * XXX: we should say that nsegs is 'unrestricted, but that - * XXX: tickles a horrible bug in the busdma code. Instead, - * XXX: we'll derive a reasonable segment limit from MAXPHYS - */ - nsegs = (MAXPHYS / PAGE_SIZE) + 1; - if (mpt_dma_tag_create(mpt, mpt->parent_dmat, 1, - 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, - NULL, NULL, MAXBSIZE, nsegs, BUS_SPACE_MAXSIZE_32BIT, 0, - &mpt->buffer_dmat) != 0) { - mpt_prt(mpt, "cannot create a dma tag for data buffers\n"); - return (1); - } - - /* Create a child tag for request buffers */ - if (mpt_dma_tag_create(mpt, mpt->parent_dmat, PAGE_SIZE, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, - NULL, NULL, MPT_REQ_MEM_SIZE(mpt), 1, BUS_SPACE_MAXSIZE_32BIT, 0, - &mpt->request_dmat) != 0) { - mpt_prt(mpt, "cannot create a dma tag for requests\n"); - return (1); - } - - /* Allocate some DMA accessable memory for requests */ - if (bus_dmamem_alloc(mpt->request_dmat, (void **)&mpt->request, - BUS_DMA_NOWAIT, &mpt->request_dmap) != 0) { - mpt_prt(mpt, "cannot allocate %d bytes of request memory\n", - MPT_REQ_MEM_SIZE(mpt)); - return (1); - } - - mi.mpt = mpt; - mi.error = 0; - - /* Load and lock it into "bus space" */ - bus_dmamap_load(mpt->request_dmat, mpt->request_dmap, mpt->request, - MPT_REQ_MEM_SIZE(mpt), mpt_map_rquest, &mi, 0); - - if (mi.error) { - mpt_prt(mpt, "error %d loading dma map for DMA request queue\n", - mi.error); - return (1); - } - mpt->request_phys = mi.phys; - - /* - * Now create per-request dma maps - */ - i = 0; - pptr = mpt->request_phys; - vptr = mpt->request; - end = pptr + MPT_REQ_MEM_SIZE(mpt); - while(pptr < end) { - request_t *req = &mpt->request_pool[i]; - req->index = i++; - - /* Store location of Request Data */ - req->req_pbuf = pptr; - req->req_vbuf = vptr; - - pptr += MPT_REQUEST_AREA; - vptr += MPT_REQUEST_AREA; - - req->sense_pbuf = (pptr - MPT_SENSE_SIZE); - req->sense_vbuf = (vptr - MPT_SENSE_SIZE); - - error = bus_dmamap_create(mpt->buffer_dmat, 0, &req->dmap); - if (error) { - mpt_prt(mpt, "error %d creating per-cmd DMA maps\n", - error); - return (1); - } - } - return (0); } @@ -894,7 +815,6 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) static void mpt_dma_mem_free(struct mpt_softc *mpt) { - int i; /* Make sure we aren't double destroying */ if (mpt->reply_dmat == 0) { @@ -902,13 +822,6 @@ mpt_dma_mem_free(struct mpt_softc *mpt) return; } - for (i = 0; i < MPT_MAX_REQUESTS(mpt); i++) { - bus_dmamap_destroy(mpt->buffer_dmat, mpt->request_pool[i].dmap); - } - bus_dmamap_unload(mpt->request_dmat, mpt->request_dmap); - bus_dmamem_free(mpt->request_dmat, mpt->request, mpt->request_dmap); - bus_dma_tag_destroy(mpt->request_dmat); - bus_dma_tag_destroy(mpt->buffer_dmat); bus_dmamap_unload(mpt->reply_dmat, mpt->reply_dmap); bus_dmamem_free(mpt->reply_dmat, mpt->reply, mpt->reply_dmap); bus_dma_tag_destroy(mpt->reply_dmat); Modified: stable/7/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 16:24:27 2011 (r224331) +++ stable/7/sys/dev/mpt/mpt_raid.c Mon Jul 25 16:45:12 2011 (r224332) @@ -647,7 +647,7 @@ mpt_terminate_raid_thread(struct mpt_sof return; } mpt->shutdwn_raid = 1; - wakeup(mpt->raid_volumes); + wakeup(&mpt->raid_volumes); /* * Sleep on a slightly different location * for this interlock just for added safety. From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 16:54:32 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13F01106566B; Mon, 25 Jul 2011 16:54:32 +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 DDDD38FC12; Mon, 25 Jul 2011 16:54: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 p6PGsVh9065901; Mon, 25 Jul 2011 16:54:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGsVp9065899; Mon, 25 Jul 2011 16:54:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251654.p6PGsVp9065899@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:54:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224334 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:54:32 -0000 Author: marius Date: Mon Jul 25 16:54:31 2011 New Revision: 224334 URL: http://svn.freebsd.org/changeset/base/224334 Log: MFC: r195274 Change explicit maximium numbers to the defined macro MPT_MAX_LUNS. Modified: stable/7/sys/dev/mpt/mpt_cam.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:45:47 2011 (r224333) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:54:31 2011 (r224334) @@ -2158,7 +2158,7 @@ mpt_start(struct cam_sim *sim, union ccb mpt_req->TargetID = tgt; /* We assume a single level LUN type */ - if (ccb->ccb_h.target_lun >= 256) { + if (ccb->ccb_h.target_lun >= MPT_MAX_LUNS) { mpt_req->LUN[0] = 0x40 | ((ccb->ccb_h.target_lun >> 8) & 0x3f); mpt_req->LUN[1] = ccb->ccb_h.target_lun & 0xff; } else { @@ -4043,7 +4043,7 @@ mpt_scsi_send_tmf(struct mpt_softc *mpt, tmf_req->MsgFlags = flags; tmf_req->MsgContext = htole32(mpt->tmf_req->index | scsi_tmf_handler_id); - if (lun > 256) { + if (lun > MPT_MAX_LUNS) { tmf_req->LUN[0] = 0x40 | ((lun >> 8) & 0x3f); tmf_req->LUN[1] = lun & 0xff; } else { @@ -4517,7 +4517,7 @@ mpt_target_start_io(struct mpt_softc *mp ta->Function = MPI_FUNCTION_TARGET_ASSIST; ta->MsgContext = htole32(req->index | mpt->scsi_tgt_handler_id); ta->ReplyWord = htole32(tgt->reply_desc); - if (csio->ccb_h.target_lun > 256) { + if (csio->ccb_h.target_lun > MPT_MAX_LUNS) { ta->LUN[0] = 0x40 | ((csio->ccb_h.target_lun >> 8) & 0x3f); ta->LUN[1] = csio->ccb_h.target_lun & 0xff; @@ -4669,7 +4669,7 @@ mpt_scsi_tgt_local(struct mpt_softc *mpt ta->Function = MPI_FUNCTION_TARGET_ASSIST; ta->MsgContext = htole32(req->index | mpt->scsi_tgt_handler_id); ta->ReplyWord = htole32(tgt->reply_desc); - if (lun > 256) { + if (lun > MPT_MAX_LUNS) { ta->LUN[0] = 0x40 | ((lun >> 8) & 0x3f); ta->LUN[1] = lun & 0xff; } else { From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 16:59:42 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 065A51065673; Mon, 25 Jul 2011 16:59:42 +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 E8C648FC19; Mon, 25 Jul 2011 16:59: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 p6PGxfbZ066096; Mon, 25 Jul 2011 16:59:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PGxfas066092; Mon, 25 Jul 2011 16:59:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251659.p6PGxfas066092@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 16:59:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224335 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 16:59:42 -0000 Author: marius Date: Mon Jul 25 16:59:41 2011 New Revision: 224335 URL: http://svn.freebsd.org/changeset/base/224335 Log: MFC: r219335 - Allocate the DMA memory shared between the host and the controller as coherent. - Add some missing bus_dmamap_sync() calls. This includes putting such calls before calling reply handlers instead of calling bus_dmamap_sync() for the request queue from individual reply handlers as these handlers generally read back updates by the controller. Tested on amd64 and sparc64. Modified: stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_user.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Mon Jul 25 16:54:31 2011 (r224334) +++ stable/7/sys/dev/mpt/mpt.c Mon Jul 25 16:59:41 2011 (r224335) @@ -718,15 +718,16 @@ mpt_intr(void *arg) uint32_t ctxt_idx; u_int cb_index; u_int req_index; + u_int offset; int free_rf; req = NULL; reply_frame = NULL; reply_baddr = 0; + offset = 0; if ((reply_desc & MPI_ADDRESS_REPLY_A_BIT) != 0) { - u_int offset; /* - * Insure that the reply frame is coherent. + * Ensure that the reply frame is coherent. */ reply_baddr = MPT_REPLY_BADDR(reply_desc); offset = reply_baddr - (mpt->reply_phys & 0xFFFFFFFF); @@ -808,10 +809,15 @@ mpt_intr(void *arg) " 0x%x)\n", req_index, reply_desc); } + bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); free_rf = mpt_reply_handlers[cb_index](mpt, req, reply_desc, reply_frame); if (reply_frame != NULL && free_rf) { + bus_dmamap_sync_range(mpt->reply_dmat, + mpt->reply_dmap, offset, MPT_REPLY_SIZE, + BUS_DMASYNC_PREREAD); mpt_free_reply(mpt, reply_baddr); } @@ -844,6 +850,8 @@ mpt_complete_request_chain(struct mpt_so MSG_REQUEST_HEADER *msg_hdr; u_int cb_index; + bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); msg_hdr = (MSG_REQUEST_HEADER *)req->req_vbuf; ioc_status_frame.Function = msg_hdr->Function; ioc_status_frame.MsgContext = msg_hdr->MsgContext; @@ -1167,7 +1175,7 @@ mpt_free_request(struct mpt_softc *mpt, { request_t *nxt; struct mpt_evtf_record *record; - uint32_t reply_baddr; + uint32_t offset, reply_baddr; if (req == NULL || req != &mpt->request_pool[req->index]) { panic("mpt_free_request bad req ptr\n"); @@ -1216,8 +1224,10 @@ mpt_free_request(struct mpt_softc *mpt, req->state = REQ_STATE_ALLOCATED; mpt_assign_serno(mpt, req); mpt_send_event_ack(mpt, req, &record->reply, record->context); - reply_baddr = (uint32_t)((uint8_t *)record - mpt->reply) - + (mpt->reply_phys & 0xFFFFFFFF); + offset = (uint32_t)((uint8_t *)record - mpt->reply); + reply_baddr = offset + (mpt->reply_phys & 0xFFFFFFFF); + bus_dmamap_sync_range(mpt->reply_dmat, mpt->reply_dmap, offset, + MPT_REPLY_SIZE, BUS_DMASYNC_PREREAD); mpt_free_reply(mpt, reply_baddr); } @@ -1257,7 +1267,7 @@ mpt_send_cmd(struct mpt_softc *mpt, requ mpt_dump_request(mpt, req); } bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); req->state |= REQ_STATE_QUEUED; KASSERT(mpt_req_on_free_list(mpt, req) == 0, ("req %p:%u func %x on freelist list in mpt_send_cmd", @@ -1696,8 +1706,6 @@ mpt_read_extcfg_page(struct mpt_softc *m mpt_free_request(mpt, req); return (-1); } - bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_POSTREAD); memcpy(buf, ((uint8_t *)req->req_vbuf)+MPT_RQSL(mpt), len); mpt_free_request(mpt, req); return (0); @@ -1795,8 +1803,6 @@ mpt_read_cfg_page(struct mpt_softc *mpt, mpt_free_request(mpt, req); return (-1); } - bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_POSTREAD); memcpy(hdr, ((uint8_t *)req->req_vbuf)+MPT_RQSL(mpt), len); mpt_free_request(mpt, req); return (0); @@ -2383,10 +2389,12 @@ mpt_upload_fw(struct mpt_softc *mpt) flags <<= MPI_SGE_FLAGS_SHIFT; sge->FlagsLength = htole32(flags | mpt->fw_image_size); sge->Address = htole32(mpt->fw_phys); + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_PREREAD); error = mpt_send_handshake_cmd(mpt, sizeof(fw_req_buf), &fw_req_buf); if (error) return(error); error = mpt_recv_handshake_reply(mpt, sizeof(fw_reply), &fw_reply); + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_POSTREAD); return (error); } @@ -2431,8 +2439,10 @@ mpt_download_fw(struct mpt_softc *mpt) MPI_DIAG_RW_ENABLE|MPI_DIAG_DISABLE_ARM); fw_hdr = (MpiFwHeader_t *)mpt->fw_image; + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_PREWRITE); mpt_diag_outsl(mpt, fw_hdr->LoadStartAddress, (uint32_t*)fw_hdr, fw_hdr->ImageSize); + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, BUS_DMASYNC_POSTWRITE); ext_offset = fw_hdr->NextImageHeaderOffset; while (ext_offset != 0) { @@ -2440,9 +2450,12 @@ mpt_download_fw(struct mpt_softc *mpt) ext = (MpiExtImageHeader_t *)((uintptr_t)fw_hdr + ext_offset); ext_offset = ext->NextImageHeaderOffset; - + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, + BUS_DMASYNC_PREWRITE); mpt_diag_outsl(mpt, ext->LoadStartAddress, (uint32_t*)ext, ext->ImageSize); + bus_dmamap_sync(mpt->fw_dmat, mpt->fw_dmap, + BUS_DMASYNC_POSTWRITE); } if (mpt->is_sas) { @@ -2506,7 +2519,7 @@ mpt_dma_buf_alloc(struct mpt_softc *mpt) /* Allocate some DMA accessable memory for requests */ if (bus_dmamem_alloc(mpt->request_dmat, (void **)&mpt->request, - BUS_DMA_NOWAIT, &mpt->request_dmap) != 0) { + BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &mpt->request_dmap) != 0) { mpt_prt(mpt, "cannot allocate %d bytes of request memory\n", MPT_REQ_MEM_SIZE(mpt)); return (1); @@ -2714,11 +2727,12 @@ mpt_configure_ioc(struct mpt_softc *mpt, mpt->fw_image_size, 1, mpt->fw_image_size, 0, &mpt->fw_dmat); if (error != 0) { - mpt_prt(mpt, "cannot create firmwarew dma tag\n"); + mpt_prt(mpt, "cannot create firmware dma tag\n"); return (ENOMEM); } error = bus_dmamem_alloc(mpt->fw_dmat, - (void **)&mpt->fw_image, BUS_DMA_NOWAIT, &mpt->fw_dmap); + (void **)&mpt->fw_image, BUS_DMA_NOWAIT | + BUS_DMA_COHERENT, &mpt->fw_dmap); if (error != 0) { mpt_prt(mpt, "cannot allocate firmware memory\n"); bus_dma_tag_destroy(mpt->fw_dmat); Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:54:31 2011 (r224334) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 16:59:41 2011 (r224335) @@ -3585,7 +3585,6 @@ mpt_action(struct cam_sim *sim, union cc #if 0 cpi->maxio = (mpt->max_cam_seg_cnt - 1) * PAGE_SIZE; #endif - /* * FC cards report MAX_DEVICES of 512, but * the MSG_SCSI_IO_REQUEST target id field @@ -5026,15 +5025,6 @@ mpt_scsi_tgt_atio(struct mpt_softc *mpt, uint8_t *cdbp; /* - * First, DMA sync the received command- - * which is in the *request* * phys area. - * - * XXX: We could optimize this for a range - */ - bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_POSTREAD); - - /* * Stash info for the current command where we can get at it later. */ vbuf = req->req_vbuf; Modified: stable/7/sys/dev/mpt/mpt_user.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_user.c Mon Jul 25 16:54:31 2011 (r224334) +++ stable/7/sys/dev/mpt/mpt_user.c Mon Jul 25 16:59:41 2011 (r224335) @@ -204,7 +204,7 @@ mpt_alloc_buffer(struct mpt_softc *mpt, if (error) return (error); error = bus_dmamem_alloc(page_mem->tag, &page_mem->vaddr, - BUS_DMA_NOWAIT, &page_mem->map); + BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &page_mem->map); if (error) { bus_dma_tag_destroy(page_mem->tag); return (error); @@ -302,6 +302,8 @@ mpt_user_read_cfg_page(struct mpt_softc params.PageNumber = hdr->PageNumber; params.PageType = hdr->PageType & MPI_CONFIG_PAGETYPE_MASK; params.PageAddress = le32toh(page_req->page_address); + bus_dmamap_sync(mpt_page->tag, mpt_page->map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); error = mpt_issue_cfg_req(mpt, req, ¶ms, mpt_page->paddr, le32toh(page_req->len), TRUE, 5000); if (error != 0) { @@ -312,7 +314,7 @@ mpt_user_read_cfg_page(struct mpt_softc page_req->ioc_status = htole16(req->IOCStatus); if ((req->IOCStatus & MPI_IOCSTATUS_MASK) == MPI_IOCSTATUS_SUCCESS) bus_dmamap_sync(mpt_page->tag, mpt_page->map, - BUS_DMASYNC_POSTREAD); + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); mpt_free_request(mpt, req); return (0); } @@ -390,6 +392,8 @@ mpt_user_read_extcfg_page(struct mpt_sof params.PageAddress = le32toh(ext_page_req->page_address); params.ExtPageType = hdr->ExtPageType; params.ExtPageLength = hdr->ExtPageLength; + bus_dmamap_sync(mpt_page->tag, mpt_page->map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); error = mpt_issue_cfg_req(mpt, req, ¶ms, mpt_page->paddr, le32toh(ext_page_req->len), TRUE, 5000); if (error != 0) { @@ -400,7 +404,7 @@ mpt_user_read_extcfg_page(struct mpt_sof ext_page_req->ioc_status = htole16(req->IOCStatus); if ((req->IOCStatus & MPI_IOCSTATUS_MASK) == MPI_IOCSTATUS_SUCCESS) bus_dmamap_sync(mpt_page->tag, mpt_page->map, - BUS_DMASYNC_POSTREAD); + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); mpt_free_request(mpt, req); return (0); } @@ -435,7 +439,8 @@ mpt_user_write_cfg_page(struct mpt_softc if (req == NULL) return (ENOMEM); - bus_dmamap_sync(mpt_page->tag, mpt_page->map, BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(mpt_page->tag, mpt_page->map, BUS_DMASYNC_PREREAD | + BUS_DMASYNC_PREWRITE); /* * There isn't any point in restoring stripped out attributes @@ -462,6 +467,8 @@ mpt_user_write_cfg_page(struct mpt_softc } page_req->ioc_status = htole16(req->IOCStatus); + bus_dmamap_sync(mpt_page->tag, mpt_page->map, BUS_DMASYNC_POSTREAD | + BUS_DMASYNC_POSTWRITE); mpt_free_request(mpt, req); return (0); } @@ -477,8 +484,6 @@ mpt_user_reply_handler(struct mpt_softc return (TRUE); if (reply_frame != NULL) { - bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap, - BUS_DMASYNC_POSTREAD); reply = (MSG_RAID_ACTION_REPLY *)reply_frame; req->IOCStatus = le16toh(reply->IOCStatus); res = (struct mpt_user_raid_action_result *) @@ -535,7 +540,7 @@ mpt_user_raid_action(struct mpt_softc *m se = (SGE_SIMPLE32 *)&rap->ActionDataSGE; if (mpt_page->vaddr != NULL && raid_act->len != 0) { bus_dmamap_sync(mpt_page->tag, mpt_page->map, - BUS_DMASYNC_PREWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); se->Address = htole32(mpt_page->paddr); MPI_pSGE_SET_LENGTH(se, le32toh(raid_act->len)); MPI_pSGE_SET_FLAGS(se, (MPI_SGE_FLAGS_SIMPLE_ELEMENT | @@ -574,7 +579,7 @@ mpt_user_raid_action(struct mpt_softc *m sizeof(res->action_data)); if (mpt_page->vaddr != NULL) bus_dmamap_sync(mpt_page->tag, mpt_page->map, - BUS_DMASYNC_POSTREAD); + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); mpt_free_request(mpt, req); return (0); } From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 17:01:15 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0062F106568D; Mon, 25 Jul 2011 17:01: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 E30B88FC23; Mon, 25 Jul 2011 17:01: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 p6PH1EIM066271; Mon, 25 Jul 2011 17:01:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PH1EJY066265; Mon, 25 Jul 2011 17:01:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251701.p6PH1EJY066265@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:01:14 +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: r224337 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:01:15 -0000 Author: marius Date: Mon Jul 25 17:01:14 2011 New Revision: 224337 URL: http://svn.freebsd.org/changeset/base/224337 Log: MFC: r220945 Correct spelling. Submitted by: brucec Modified: stable/7/sys/dev/mpt/mpt.c stable/7/sys/dev/mpt/mpt.h stable/7/sys/dev/mpt/mpt_cam.c stable/7/sys/dev/mpt/mpt_debug.c stable/7/sys/dev/mpt/mpt_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt.c ============================================================================== --- stable/7/sys/dev/mpt/mpt.c Mon Jul 25 17:01:13 2011 (r224336) +++ stable/7/sys/dev/mpt/mpt.c Mon Jul 25 17:01:14 2011 (r224337) @@ -304,28 +304,28 @@ mpt_modevent(module_t mod, int type, voi int mpt_stdload(struct mpt_personality *pers) { - /* Load is always successfull. */ + /* Load is always successful. */ return (0); } int mpt_stdprobe(struct mpt_softc *mpt) { - /* Probe is always successfull. */ + /* Probe is always successful. */ return (0); } int mpt_stdattach(struct mpt_softc *mpt) { - /* Attach is always successfull. */ + /* Attach is always successful. */ return (0); } int mpt_stdenable(struct mpt_softc *mpt) { - /* Enable is always successfull. */ + /* Enable is always successful. */ return (0); } @@ -361,7 +361,7 @@ mpt_stddetach(struct mpt_softc *mpt) int mpt_stdunload(struct mpt_personality *pers) { - /* Unload is always successfull. */ + /* Unload is always successful. */ return (0); } @@ -659,7 +659,7 @@ mpt_core_event(struct mpt_softc *mpt, re { int i; - /* Some error occured that LSI wants logged */ + /* Some error occurred that LSI wants logged */ mpt_prt(mpt, "EvtLogData: IOCLogInfo: 0x%08x\n", msg->IOCLogInfo); mpt_prt(mpt, "\tEvtLogData: Event Data:"); @@ -2354,7 +2354,7 @@ mpt_core_detach(struct mpt_softc *mpt) int mpt_core_unload(struct mpt_personality *pers) { - /* Unload is always successfull. */ + /* Unload is always successful. */ return (0); } @@ -2517,7 +2517,7 @@ mpt_dma_buf_alloc(struct mpt_softc *mpt) return (1); } - /* Allocate some DMA accessable memory for requests */ + /* Allocate some DMA accessible memory for requests */ if (bus_dmamem_alloc(mpt->request_dmat, (void **)&mpt->request, BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &mpt->request_dmap) != 0) { mpt_prt(mpt, "cannot allocate %d bytes of request memory\n", @@ -2715,7 +2715,7 @@ mpt_configure_ioc(struct mpt_softc *mpt, /* * In some configurations, the IOC's firmware is * stored in a shared piece of system NVRAM that - * is only accessable via the BIOS. In this + * is only accessible via the BIOS. In this * case, the firmware keeps a copy of firmware in * RAM until the OS driver retrieves it. Once * retrieved, we are responsible for re-downloading Modified: stable/7/sys/dev/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Mon Jul 25 17:01:13 2011 (r224336) +++ stable/7/sys/dev/mpt/mpt.h Mon Jul 25 17:01:14 2011 (r224337) @@ -371,7 +371,7 @@ struct req_entry { mpt_req_state_t state; /* Request State Information */ uint16_t index; /* Index of this entry */ uint16_t IOCStatus; /* Completion status */ - uint16_t ResponseCode; /* TMF Reponse Code */ + uint16_t ResponseCode; /* TMF Response Code */ uint16_t serno; /* serial number */ union ccb *ccb; /* CAM request */ void *req_vbuf; /* Virtual Address of Entry */ @@ -714,7 +714,7 @@ struct mpt_softc { */ int pci_msi_count; struct resource * pci_irq; /* Interrupt map for chip */ - void * ih; /* Interupt handle */ + void * ih; /* Interrupt handle */ struct mpt_pci_cfg pci_cfg; /* saved PCI conf registers */ /* @@ -1052,7 +1052,7 @@ mpt_pop_reply_queue(struct mpt_softc *mp void mpt_complete_request_chain(struct mpt_softc *, struct req_queue *, u_int); -/************************** Scatter Gather Managment **************************/ +/************************** Scatter Gather Management **************************/ /* MPT_RQSL- size of request frame, in bytes */ #define MPT_RQSL(mpt) (mpt->ioc_facts.RequestFrameSize << 2) Modified: stable/7/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 17:01:13 2011 (r224336) +++ stable/7/sys/dev/mpt/mpt_cam.c Mon Jul 25 17:01:14 2011 (r224337) @@ -3015,7 +3015,7 @@ mpt_fc_els_reply_handler(struct mpt_soft elsbuf[1] = htobe32((ox_id << 16) | rx_id); elsbuf[2] = htobe32(0x000ffff); /* - * Dork with the reply frame so that the reponse to it + * Dork with the reply frame so that the response to it * will be correct. */ rp->Rctl_Did += ((BA_ACC - ABTS) << MPI_FC_RCTL_SHIFT); @@ -3142,7 +3142,7 @@ XXXX mpt_set_ccb_status(ccb, CAM_AUTOSENSE_FAIL); } else if ((sstate & MPI_SCSI_STATE_RESPONSE_INFO_VALID) != 0) { - /* XXX Handle SPI-Packet and FCP-2 reponse info. */ + /* XXX Handle SPI-Packet and FCP-2 response info. */ mpt_set_ccb_status(ccb, CAM_REQ_CMP_ERR); } else mpt_set_ccb_status(ccb, CAM_REQ_CMP); Modified: stable/7/sys/dev/mpt/mpt_debug.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_debug.c Mon Jul 25 17:01:13 2011 (r224336) +++ stable/7/sys/dev/mpt/mpt_debug.c Mon Jul 25 17:01:14 2011 (r224337) @@ -119,15 +119,15 @@ static const struct Error_Map IOC_Status { MPI_IOCSTATUS_TARGET_NO_CONNECTION, "SCSI Target: No Connection" }, { MPI_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH,"SCSI Target: Transfer Count Mismatch" }, { MPI_IOCSTATUS_TARGET_FC_ABORTED, "FC: Aborted" }, -{ MPI_IOCSTATUS_TARGET_FC_RX_ID_INVALID, "FC: Recieve ID Invalid" }, -{ MPI_IOCSTATUS_TARGET_FC_DID_INVALID, "FC: Recieve DID Invalid" }, +{ MPI_IOCSTATUS_TARGET_FC_RX_ID_INVALID, "FC: Receive ID Invalid" }, +{ MPI_IOCSTATUS_TARGET_FC_DID_INVALID, "FC: Receive DID Invalid" }, { MPI_IOCSTATUS_TARGET_FC_NODE_LOGGED_OUT,"FC: Node Logged Out" }, { MPI_IOCSTATUS_LAN_DEVICE_NOT_FOUND, "LAN: Device Not Found" }, { MPI_IOCSTATUS_LAN_DEVICE_FAILURE, "LAN: Device Not Failure" }, { MPI_IOCSTATUS_LAN_TRANSMIT_ERROR, "LAN: Transmit Error" }, { MPI_IOCSTATUS_LAN_TRANSMIT_ABORTED, "LAN: Transmit Aborted" }, -{ MPI_IOCSTATUS_LAN_RECEIVE_ERROR, "LAN: Recieve Error" }, -{ MPI_IOCSTATUS_LAN_RECEIVE_ABORTED, "LAN: Recieve Aborted" }, +{ MPI_IOCSTATUS_LAN_RECEIVE_ERROR, "LAN: Receive Error" }, +{ MPI_IOCSTATUS_LAN_RECEIVE_ABORTED, "LAN: Receive Aborted" }, { MPI_IOCSTATUS_LAN_PARTIAL_PACKET, "LAN: Partial Packet" }, { MPI_IOCSTATUS_LAN_CANCELED, "LAN: Canceled" }, { -1, 0}, Modified: stable/7/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 17:01:13 2011 (r224336) +++ stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 17:01:14 2011 (r224337) @@ -783,7 +783,7 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) return (1); } - /* Allocate some DMA accessable memory for replies */ + /* Allocate some DMA accessible memory for replies */ if (bus_dmamem_alloc(mpt->reply_dmat, (void **)&mpt->reply, BUS_DMA_NOWAIT, &mpt->reply_dmap) != 0) { mpt_prt(mpt, "cannot allocate %lu bytes of reply memory\n", From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 17:12:56 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12855106564A; Mon, 25 Jul 2011 17:12: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 020238FC1A; Mon, 25 Jul 2011 17:12: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 p6PHCtQD066715; Mon, 25 Jul 2011 17:12:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHCt0A066713; Mon, 25 Jul 2011 17:12:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251712.p6PHCt0A066713@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224339 - stable/7/sys/dev/esp X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:12:56 -0000 Author: marius Date: Mon Jul 25 17:12:55 2011 New Revision: 224339 URL: http://svn.freebsd.org/changeset/base/224339 Log: MFC: r220951 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/dev/esp/ncr53c9x.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/esp/ncr53c9x.c ============================================================================== --- stable/7/sys/dev/esp/ncr53c9x.c Mon Jul 25 17:12:52 2011 (r224338) +++ stable/7/sys/dev/esp/ncr53c9x.c Mon Jul 25 17:12:55 2011 (r224339) @@ -2560,7 +2560,7 @@ again: * XXX This will cause a chip reset and will * prevent us from finding out the real * problem with the device. However, it's - * neccessary until a way can be found to + * necessary until a way can be found to * safely cancel the DMA that is in * progress. */ From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 17:14:57 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C43E0106576B; Mon, 25 Jul 2011 17:14: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 00C298FC15; Mon, 25 Jul 2011 17:14: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 p6PHEtBw066870; Mon, 25 Jul 2011 17:14:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHEt3J066868; Mon, 25 Jul 2011 17:14:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251714.p6PHEt3J066868@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224341 - stable/7/sys/dev/bge X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:14:57 -0000 Author: marius Date: Mon Jul 25 17:14:55 2011 New Revision: 224341 URL: http://svn.freebsd.org/changeset/base/224341 Log: MFC: r221344 Correct spelling in comments. Submitted by: brucec Modified: stable/7/sys/dev/bge/if_bge.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Mon Jul 25 17:14:49 2011 (r224340) +++ stable/7/sys/dev/bge/if_bge.c Mon Jul 25 17:14:55 2011 (r224341) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); * * The Broadcom BCM5700 is based on technology originally developed by * Alteon Networks as part of the Tigon I and Tigon II gigabit ethernet - * MAC chips. The BCM5700, sometimes refered to as the Tigon III, has + * MAC chips. The BCM5700, sometimes referred to as the Tigon III, has * two on-board MIPS R4000 CPUs and can have as much as 16MB of external * SSRAM. The BCM5700 supports TCP, UDP and IP checksum offload, jumbo * frames, highly configurable RX filtering, and 16 RX and TX queues @@ -3513,7 +3513,7 @@ bge_reset(struct bge_softc *sc) pci_write_config(dev, sc->bge_pcixcap + PCIXR_COMMAND, devctl, 2); } - /* Re-enable MSI, if neccesary, and enable the memory arbiter. */ + /* Re-enable MSI, if necessary, and enable the memory arbiter. */ if (BGE_IS_5714_FAMILY(sc)) { /* This chip disables MSI on reset. */ if (sc->bge_flags & BGE_FLAG_MSI) { From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 17:18:48 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54AA21065673; Mon, 25 Jul 2011 17:18:48 +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 444658FC12; Mon, 25 Jul 2011 17:18:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHImwY067085; Mon, 25 Jul 2011 17:18:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHIm88067083; Mon, 25 Jul 2011 17:18:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251718.p6PHIm88067083@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:18:48 +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: r224343 - stable/7/sbin/ifconfig X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:18:48 -0000 Author: marius Date: Mon Jul 25 17:18:47 2011 New Revision: 224343 URL: http://svn.freebsd.org/changeset/base/224343 Log: MFC: r221954 When setting media always and not just in case of switching to IFM_AUTO clear the options of the current media, i.e. only inherit the instance, which matches what NetBSD does. Without this it's really non-intuitive that the following sequence: ifconfig bge0 media 1000baseT mediaopt full-duplex ifconfig bge0 media 100baseTX results in 100baseTX full-duplex to be set or that: ifconfig bge0 media autoselect mediaopt flowcontrol ifconfig bge0 media 1000baseT mediaopt full-duplex tries to set 1000baseT full-duplex with flowcontrol, which isn't suported und thus fails while the following: ifconfig re0 media 1000baseT mediaopt flowcontrol,full-duplex ifconfig re0 media autoselect just switches to autoselection without flowcontrol. Modified: stable/7/sbin/ifconfig/ifmedia.c Directory Properties: stable/7/sbin/ifconfig/ (props changed) Modified: stable/7/sbin/ifconfig/ifmedia.c ============================================================================== --- stable/7/sbin/ifconfig/ifmedia.c Mon Jul 25 17:18:46 2011 (r224342) +++ stable/7/sbin/ifconfig/ifmedia.c Mon Jul 25 17:18:47 2011 (r224343) @@ -263,13 +263,9 @@ setmedia(const char *val, int d, int s, subtype = get_media_subtype(IFM_TYPE(ifmr->ifm_ulist[0]), val); strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)); - ifr.ifr_media = (ifmr->ifm_current & ~(IFM_NMASK|IFM_TMASK)) | + ifr.ifr_media = (ifmr->ifm_current & IFM_IMASK) | IFM_TYPE(ifmr->ifm_ulist[0]) | subtype; - if ((ifr.ifr_media & IFM_TMASK) == 0) { - ifr.ifr_media &= ~(IFM_GMASK | IFM_OMASK); - } - ifmr->ifm_current = ifr.ifr_media; callback_register(setifmediacallback, (void *)ifmr); } From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 17:20:33 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 963F51065675; Mon, 25 Jul 2011 17:20:33 +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 6CCDB8FC1C; Mon, 25 Jul 2011 17:20: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 p6PHKXid067208; Mon, 25 Jul 2011 17:20:33 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHKX1a067206; Mon, 25 Jul 2011 17:20:33 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251720.p6PHKX1a067206@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:20: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: r224344 - stable/7/sys/net X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:20:33 -0000 Author: marius Date: Mon Jul 25 17:20:33 2011 New Revision: 224344 URL: http://svn.freebsd.org/changeset/base/224344 Log: MFC: r221955 - Add 10baseT as an alias for 10baseT/UTP. - Add shorthand aliases for common media+option combinations as announced by miibus(4) so that one can actually supply the media strings found in the dmesg output to ifconfig(8). Obtained from: NetBSD (in principle) Modified: stable/7/sys/net/if_media.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net/if_media.h ============================================================================== --- stable/7/sys/net/if_media.h Mon Jul 25 17:18:47 2011 (r224343) +++ stable/7/sys/net/if_media.h Mon Jul 25 17:20:33 2011 (r224344) @@ -369,6 +369,7 @@ struct ifmedia_description { } #define IFM_SUBTYPE_ETHERNET_ALIASES { \ + { IFM_10_T, "10baseT" }, \ { IFM_10_T, "UTP" }, \ { IFM_10_T, "10UTP" }, \ { IFM_10_2, "BNC" }, \ @@ -388,6 +389,23 @@ struct ifmedia_description { { IFM_1000_T, "1000TX" }, \ { IFM_1000_T, "1000T" }, \ { IFM_2500_SX, "2500SX" }, \ + \ + /* \ + * Shorthands for common media+option combinations as announced \ + * by miibus(4) \ + */ \ + { IFM_10_T | IFM_FDX, "10baseT-FDX" }, \ + { IFM_10_T | IFM_FDX | IFM_FLOW, "10baseT-FDX-flow" }, \ + { IFM_100_TX | IFM_FDX, "100baseTX-FDX" }, \ + { IFM_100_TX | IFM_FDX | IFM_FLOW, "100baseTX-FDX-flow" }, \ + { IFM_1000_T | IFM_FDX, "1000baseT-FDX" }, \ + { IFM_1000_T | IFM_FDX | IFM_FLOW, "1000baseT-FDX-flow" }, \ + { IFM_1000_T | IFM_FDX | IFM_FLOW | IFM_ETH_MASTER, \ + "1000baseT-FDX-flow-master" }, \ + { IFM_1000_T | IFM_FDX | IFM_ETH_MASTER, \ + "1000baseT-FDX-master" }, \ + { IFM_1000_T | IFM_ETH_MASTER, "1000baseT-master" }, \ + \ { 0, NULL }, \ } @@ -580,6 +598,13 @@ struct ifmedia_description { #define IFM_SUBTYPE_SHARED_ALIASES { \ { IFM_AUTO, "auto" }, \ + \ + /* \ + * Shorthands for common media+option combinations as announced \ + * by miibus(4) \ + */ \ + { IFM_AUTO | IFM_FLOW, "auto-flow" }, \ + \ { 0, NULL }, \ } From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 17:31:10 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 233C41065675; Mon, 25 Jul 2011 17:31:10 +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 12B278FC12; Mon, 25 Jul 2011 17:31: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 p6PHV9md067644; Mon, 25 Jul 2011 17:31:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHV9tc067641; Mon, 25 Jul 2011 17:31:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251731.p6PHV9tc067641@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224347 - stable/7/sys/dev/mk48txx X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:31:10 -0000 Author: marius Date: Mon Jul 25 17:31:09 2011 New Revision: 224347 URL: http://svn.freebsd.org/changeset/base/224347 Log: MFC: r221957 Add support for MK48T37. Modified: stable/7/sys/dev/mk48txx/mk48txx.c stable/7/sys/dev/mk48txx/mk48txxreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mk48txx/mk48txx.c ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txx.c Mon Jul 25 17:31:09 2011 (r224346) +++ stable/7/sys/dev/mk48txx/mk48txx.c Mon Jul 25 17:31:09 2011 (r224347) @@ -33,7 +33,8 @@ __FBSDID("$FreeBSD$"); /* - * Mostek MK48T02, MK48T08, MK48T18, MK48T59 time-of-day chip subroutines + * Mostek MK48T02, MK48T08, MK48T18, MK48T37 and MK48T59 time-of-day chip + * subroutines */ #include @@ -67,6 +68,7 @@ static const struct { { "mk48t02", MK48T02_CLKSZ, MK48T02_CLKOFF, 0 }, { "mk48t08", MK48T08_CLKSZ, MK48T08_CLKOFF, 0 }, { "mk48t18", MK48T18_CLKSZ, MK48T18_CLKOFF, 0 }, + { "mk48t37", MK48T37_CLKSZ, MK48T37_CLKOFF, MK48TXX_EXT_REGISTERS }, { "mk48t59", MK48T59_CLKSZ, MK48T59_CLKOFF, MK48TXX_EXT_REGISTERS }, }; Modified: stable/7/sys/dev/mk48txx/mk48txxreg.h ============================================================================== --- stable/7/sys/dev/mk48txx/mk48txxreg.h Mon Jul 25 17:31:09 2011 (r224346) +++ stable/7/sys/dev/mk48txx/mk48txxreg.h Mon Jul 25 17:31:09 2011 (r224347) @@ -152,5 +152,8 @@ #define MK48T18_CLKSZ 8192 #define MK48T18_CLKOFF 0x1ff0 +#define MK48T37_CLKSZ 32768 +#define MK48T37_CLKOFF 0x1ff0 + #define MK48T59_CLKSZ 8192 #define MK48T59_CLKOFF 0x1ff0 From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 17:32:22 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D19A81065670; Mon, 25 Jul 2011 17:32:22 +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 C10278FC1A; Mon, 25 Jul 2011 17:32:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PHWMjK067777; Mon, 25 Jul 2011 17:32:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHWMi6067775; Mon, 25 Jul 2011 17:32:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251732.p6PHWMi6067775@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224349 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:32:22 -0000 Author: marius Date: Mon Jul 25 17:32:22 2011 New Revision: 224349 URL: http://svn.freebsd.org/changeset/base/224349 Log: MFC: r221958 Recognize the eeprom device found in Fujitsu PRIMEPOWER650 and 900. Modified: stable/7/sys/sparc64/sparc64/eeprom.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/eeprom.c ============================================================================== --- stable/7/sys/sparc64/sparc64/eeprom.c Mon Jul 25 17:32:22 2011 (r224348) +++ stable/7/sys/sparc64/sparc64/eeprom.c Mon Jul 25 17:32:22 2011 (r224349) @@ -107,8 +107,11 @@ DRIVER_MODULE(eeprom, sbus, eeprom_drive static int eeprom_probe(device_t dev) { + const char *name; - if (strcmp("eeprom", ofw_bus_get_name(dev)) == 0) { + name = ofw_bus_get_name(dev); + if (strcmp(name, "eeprom") == 0 || + strcmp(name, "FJSV,eeprom") == 0) { device_set_desc(dev, "EEPROM/clock"); return (0); } From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 17:37:54 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0EFE1065672; Mon, 25 Jul 2011 17:37:54 +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 C076C8FC1D; Mon, 25 Jul 2011 17:37: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 p6PHbsaY068088; Mon, 25 Jul 2011 17:37:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHbs3I068085; Mon, 25 Jul 2011 17:37:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251737.p6PHbs3I068085@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:37:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224351 - in stable/7/sys/dev: scc uart X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:37:54 -0000 Author: marius Date: Mon Jul 25 17:37:54 2011 New Revision: 224351 URL: http://svn.freebsd.org/changeset/base/224351 Log: MFC: r221960 Recognize the SAB 82532 found in Fujitsu PRIMEPOWER650 and 900. Modified: stable/7/sys/dev/scc/scc_bfe_ebus.c stable/7/sys/dev/uart/uart_cpu_sparc64.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/scc/scc_bfe_ebus.c ============================================================================== --- stable/7/sys/dev/scc/scc_bfe_ebus.c Mon Jul 25 17:37:53 2011 (r224350) +++ stable/7/sys/dev/scc/scc_bfe_ebus.c Mon Jul 25 17:37:54 2011 (r224351) @@ -56,7 +56,8 @@ scc_ebus_probe(device_t dev) cmpt = ofw_bus_get_compat(dev); if (cmpt == NULL) cmpt = ""; - if (!strcmp(nm, "se") || !strcmp(cmpt, "sab82532")) { + if (!strcmp(nm, "se") || !strcmp(nm, "FJSV,se") || + !strcmp(cmpt, "sab82532")) { device_set_desc(dev, "Siemens SAB 82532 dual channel SCC"); sc->sc_class = &scc_sab82532_class; return (scc_bfe_probe(dev, EBUS_REGSHFT, EBUS_RCLK, 0)); Modified: stable/7/sys/dev/uart/uart_cpu_sparc64.c ============================================================================== --- stable/7/sys/dev/uart/uart_cpu_sparc64.c Mon Jul 25 17:37:53 2011 (r224350) +++ stable/7/sys/dev/uart/uart_cpu_sparc64.c Mon Jul 25 17:37:54 2011 (r224351) @@ -230,7 +230,8 @@ uart_cpu_getdev(int devtype, struct uart di->bas.regshft = 0; di->bas.rclk = 0; class = NULL; - if (!strcmp(buf, "se") || !strcmp(compat, "sab82532")) { + if (!strcmp(buf, "se") || !strcmp(buf, "FJSV,se") || + !strcmp(compat, "sab82532")) { class = &uart_sab82532_class; /* SAB82532 are only known to be used for TTYs. */ if ((di->bas.chan = uart_cpu_channel(dev)) == 0) From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 17:54:06 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F1631065672; Mon, 25 Jul 2011 17:54:06 +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 04E378FC13; Mon, 25 Jul 2011 17:54: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 p6PHs5H6068670; Mon, 25 Jul 2011 17:54:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHs5Hw068666; Mon, 25 Jul 2011 17:54:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251754.p6PHs5Hw068666@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224353 - in stable/7/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:54:06 -0000 Author: marius Date: Mon Jul 25 17:54:05 2011 New Revision: 224353 URL: http://svn.freebsd.org/changeset/base/224353 Log: MFC: r222828 (partial) - Test KTR_CPUMASK against pc_cpuid rather than pc_mid to match what the C version does. - Initialize global registers early in the MP startup code so PCPU can be used. Modified: stable/7/sys/sparc64/include/ktr.h stable/7/sys/sparc64/sparc64/mp_locore.S stable/7/sys/sparc64/sparc64/mp_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/ktr.h ============================================================================== --- stable/7/sys/sparc64/include/ktr.h Mon Jul 25 17:54:04 2011 (r224352) +++ stable/7/sys/sparc64/include/ktr.h Mon Jul 25 17:54:05 2011 (r224353) @@ -82,7 +82,7 @@ l2: add r2, 1, r3 ; \ #define CATR(mask, desc, r1, r2, r3, l1, l2, l3) \ set mask, r1 ; \ TEST(ktr_mask, r1, r2, r2, l3) ; \ - lduw [PCPU(MID)], r1 ; \ + lduw [PCPU(CPUID)], r1 ; \ mov 1, r2 ; \ sllx r2, r1, r1 ; \ TEST(ktr_cpumask, r1, r2, r3, l3) ; \ Modified: stable/7/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_locore.S Mon Jul 25 17:54:04 2011 (r224352) +++ stable/7/sys/sparc64/sparc64/mp_locore.S Mon Jul 25 17:54:05 2011 (r224353) @@ -269,13 +269,17 @@ ENTRY(mp_startup) add %l1, %l2, %l1 sub %l1, SPOFF + CCFSZ, %sp + /* Initialize global registers. */ + call cpu_setregs + mov %l1, %o0 + #if KTR_COMPILE & KTR_SMP CATR(KTR_SMP, "mp_startup: bootstrap cpuid=%d mid=%d pcpu=%#lx data=%#lx sp=%#lx" , %g1, %g2, %g3, 7, 8, 9) - lduw [%l1 + PC_CPUID], %g2 + lduw [PCPU(CPUID)], %g2 stx %g2, [%g1 + KTR_PARM1] - lduw [%l1 + PC_MID], %g2 + lduw [PCPU(MID)], %g2 stx %g2, [%g1 + KTR_PARM2] stx %l1, [%g1 + KTR_PARM3] stx %sp, [%g1 + KTR_PARM5] Modified: stable/7/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 17:54:04 2011 (r224352) +++ stable/7/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 17:54:05 2011 (r224353) @@ -438,9 +438,6 @@ cpu_mp_bootstrap(struct pcpu *pc) */ tlb_flush_nonlocked(); - /* Initialize global registers. */ - cpu_setregs(pc); - /* * Enable interrupts. * Note that the PIL we be lowered indirectly via sched_throw(NULL) From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 17:56:07 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F99D1065675; Mon, 25 Jul 2011 17:56:07 +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 4EF678FC08; Mon, 25 Jul 2011 17:56: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 p6PHu7ql068841; Mon, 25 Jul 2011 17:56:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PHu7aJ068839; Mon, 25 Jul 2011 17:56:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251756.p6PHu7aJ068839@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 17:56:07 +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: r224355 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 17:56:07 -0000 Author: marius Date: Mon Jul 25 17:56:06 2011 New Revision: 224355 URL: http://svn.freebsd.org/changeset/base/224355 Log: MFC: r222840 - For the case when tl1_align(_trap) is used to call rsf_fatal via RSF_FATAL we need to switch to alternate globals for KSTACK_CHECK just like tl1_data_excptn(_trap) does. This is more or less cosmetic because in case RSF_FATAL is called we're already heading south. - Correct an END(). - Read the window state from the correct register for a CATR(). Modified: stable/7/sys/sparc64/sparc64/exception.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 17:56:06 2011 (r224354) +++ stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 17:56:06 2011 (r224355) @@ -1276,6 +1276,7 @@ ENTRY(tl1_data_excptn_trap) END(tl1_data_excptn_trap) .macro tl1_align + wrpr %g0, PSTATE_ALT, %pstate ba,a %xcc, tl1_align_trap nop .align 32 @@ -1285,7 +1286,7 @@ ENTRY(tl1_align_trap) RESUME_SPILLFILL_ALIGN ba %xcc, tl1_sfsr_trap mov T_MEM_ADDRESS_NOT_ALIGNED | T_KERNEL, %g2 -END(tl1_data_excptn_trap) +END(tl1_align_trap) ENTRY(tl1_sfsr_trap) wr %g0, ASI_DMMU, %asi @@ -2616,7 +2617,7 @@ tl0_ret_fill_end: , %l0, %l1, %l2, 7, 8, 9) rdpr %pstate, %l1 stx %l1, [%l0 + KTR_PARM1] - stx %l5, [%l0 + KTR_PARM2] + stx %l6, [%l0 + KTR_PARM2] stx %sp, [%l0 + KTR_PARM3] 9: #endif From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 18:17:13 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B9CE106564A; Mon, 25 Jul 2011 18:17:13 +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 114518FC08; Mon, 25 Jul 2011 18:17: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 p6PIHCxO069509; Mon, 25 Jul 2011 18:17:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIHCug069507; Mon, 25 Jul 2011 18:17:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251817.p6PIHCug069507@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:17:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224357 - stable/7/sys/sparc64/include X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:17:13 -0000 Author: marius Date: Mon Jul 25 18:17:12 2011 New Revision: 224357 URL: http://svn.freebsd.org/changeset/base/224357 Log: MFC: r223126 (partial) Don't include curcpu in the mask which is used as the IPI cookie as we have to ignore it when sending the IPI anyway. Actually I can't think of a good reason why this ever was done that way in the first place as it's not even usefull for debugging. Modified: stable/7/sys/sparc64/include/smp.h Modified: stable/7/sys/sparc64/include/smp.h ============================================================================== --- stable/7/sys/sparc64/include/smp.h Mon Jul 25 18:17:11 2011 (r224356) +++ stable/7/sys/sparc64/include/smp.h Mon Jul 25 18:17:12 2011 (r224357) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2001 Jake Burkholder. + * Copyright (c) 2007 - 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -156,9 +157,9 @@ ipi_dcache_page_inval(void *func, vm_pad sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); - ica->ica_mask = all_cpus; + ica->ica_mask = PCPU_GET(other_cpus); ica->ica_pa = pa; - cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)func, (u_long)ica); + cpu_ipi_selected(ica->ica_mask, 0, (u_long)func, (u_long)ica); return (&ica->ica_mask); } @@ -172,9 +173,9 @@ ipi_icache_page_inval(void *func, vm_pad sched_pin(); ica = &ipi_cache_args; mtx_lock_spin(&ipi_mtx); - ica->ica_mask = all_cpus; + ica->ica_mask = PCPU_GET(other_cpus); ica->ica_pa = pa; - cpu_ipi_selected(PCPU_GET(other_cpus), 0, (u_long)func, (u_long)ica); + cpu_ipi_selected(ica->ica_mask, 0, (u_long)func, (u_long)ica); return (&ica->ica_mask); } @@ -188,7 +189,7 @@ ipi_rd(u_int cpu, void *func, u_long *va sched_pin(); ira = &ipi_rd_args; mtx_lock_spin(&ipi_mtx); - ira->ira_mask = 1 << cpu | PCPU_GET(cpumask); + ira->ira_mask = 1 << cpu; ira->ira_val = val; cpu_ipi_single(cpu, 0, (u_long)func, (u_long)ira); return (&ira->ira_mask); @@ -209,7 +210,7 @@ ipi_tlb_context_demap(struct pmap *pm) } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); - ita->ita_mask = cpus | PCPU_GET(cpumask); + ita->ita_mask = cpus; ita->ita_pmap = pm; cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_context_demap, (u_long)ita); @@ -231,7 +232,7 @@ ipi_tlb_page_demap(struct pmap *pm, vm_o } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); - ita->ita_mask = cpus | PCPU_GET(cpumask); + ita->ita_mask = cpus; ita->ita_pmap = pm; ita->ita_va = va; cpu_ipi_selected(cpus, 0, (u_long)tl_ipi_tlb_page_demap, (u_long)ita); @@ -253,7 +254,7 @@ ipi_tlb_range_demap(struct pmap *pm, vm_ } ita = &ipi_tlb_args; mtx_lock_spin(&ipi_mtx); - ita->ita_mask = cpus | PCPU_GET(cpumask); + ita->ita_mask = cpus; ita->ita_pmap = pm; ita->ita_start = start; ita->ita_end = end; @@ -268,7 +269,6 @@ ipi_wait(void *cookie) volatile u_int *mask; if ((mask = cookie) != NULL) { - atomic_clear_int(mask, PCPU_GET(cpumask)); while (*mask != 0) ; mtx_unlock_spin(&ipi_mtx); From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 18:24:18 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F346E106566C; Mon, 25 Jul 2011 18:24:17 +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 C91E38FC0A; Mon, 25 Jul 2011 18:24: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 p6PIOHQT069858; Mon, 25 Jul 2011 18:24:17 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIOHxP069856; Mon, 25 Jul 2011 18:24:17 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251824.p6PIOHxP069856@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224359 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:24:18 -0000 Author: marius Date: Mon Jul 25 18:24:17 2011 New Revision: 224359 URL: http://svn.freebsd.org/changeset/base/224359 Log: MFC: r223235 - As with stray vector interrupts limit the reporting of stray level interrupts. Bringup on additional machine models repeatedly reveals firmware that enables interrupts behind our back, causing the console to be flooded otherwise. - As with the regular interrupt counters using uint16_t instead of u_long for counting the stray vector interrupts should be more than sufficient. - Cache the interrupt vector in intr_stray_vector(). Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/intr_machdep.c Mon Jul 25 18:23:24 2011 (r224358) +++ stable/7/sys/sparc64/sparc64/intr_machdep.c Mon Jul 25 18:24:17 2011 (r224359) @@ -84,10 +84,11 @@ CTASSERT((1 << IV_SHIFT) == sizeof(struc ih_func_t *intr_handlers[PIL_MAX]; uint16_t pil_countp[PIL_MAX]; +static uint16_t pil_stray_count[PIL_MAX]; struct intr_vector intr_vectors[IV_MAX]; uint16_t intr_countp[IV_MAX]; -static u_long intr_stray_count[IV_MAX]; +static uint16_t intr_stray_count[IV_MAX]; static const char *const pil_names[] = { "stray", @@ -199,22 +200,32 @@ intr_setup(int pri, ih_func_t *ihf, int static void intr_stray_level(struct trapframe *tf) { + uint64_t level; - printf("stray level interrupt %ld\n", tf->tf_level); + level = tf->tf_level; + if (pil_stray_count[level] < MAX_STRAY_LOG) { + printf("stray level interrupt %ld\n", level); + pil_stray_count[level]++; + if (pil_stray_count[level] >= MAX_STRAY_LOG) + printf("got %d stray level interrupt %ld's: not " + "logging anymore\n", MAX_STRAY_LOG, level); + } } static void intr_stray_vector(void *cookie) { struct intr_vector *iv; + u_int vec; iv = cookie; - if (intr_stray_count[iv->iv_vec] < MAX_STRAY_LOG) { - printf("stray vector interrupt %d\n", iv->iv_vec); - intr_stray_count[iv->iv_vec]++; - if (intr_stray_count[iv->iv_vec] >= MAX_STRAY_LOG) - printf("got %d stray interrupt %d's: not logging " - "anymore\n", MAX_STRAY_LOG, iv->iv_vec); + vec = iv->iv_vec; + if (intr_stray_count[vec] < MAX_STRAY_LOG) { + printf("stray vector interrupt %d\n", vec); + intr_stray_count[vec]++; + if (intr_stray_count[vec] >= MAX_STRAY_LOG) + printf("got %d stray vector interrupt %d's: not " + "logging anymore\n", MAX_STRAY_LOG, vec); } } From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 18:25:30 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB856106566C; Mon, 25 Jul 2011 18:25: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 BACC48FC08; Mon, 25 Jul 2011 18:25: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 p6PIPU7X069988; Mon, 25 Jul 2011 18:25:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIPUGT069986; Mon, 25 Jul 2011 18:25:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251825.p6PIPUGT069986@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:25:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224360 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:25:30 -0000 Author: marius Date: Mon Jul 25 18:25:30 2011 New Revision: 224360 URL: http://svn.freebsd.org/changeset/base/224360 Log: MFC: r223347 As astopgap minimize the sched_lock coverage in pmap_activate() in order to reduce lock contention. Modified: stable/7/sys/sparc64/sparc64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:24:17 2011 (r224359) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:25:30 2011 (r224360) @@ -1988,11 +1988,10 @@ pmap_activate(struct thread *td) struct pmap *pm; int context; + critical_enter(); vm = td->td_proc->p_vmspace; pm = vmspace_pmap(vm); - mtx_lock_spin(&sched_lock); - context = PCPU_GET(tlb_ctx); if (context == PCPU_GET(tlb_ctx_max)) { tlb_flush_user(); @@ -2000,17 +1999,18 @@ pmap_activate(struct thread *td) } PCPU_SET(tlb_ctx, context + 1); + mtx_lock_spin(&sched_lock); pm->pm_context[curcpu] = context; pm->pm_active |= PCPU_GET(cpumask); PCPU_SET(pmap, pm); + mtx_unlock_spin(&sched_lock); stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb); stxa(AA_IMMU_TSB, ASI_IMMU, pm->pm_tsb); stxa(AA_DMMU_PCXR, ASI_DMMU, (ldxa(AA_DMMU_PCXR, ASI_DMMU) & TLB_CXR_PGSZ_MASK) | context); flush(KERNBASE); - - mtx_unlock_spin(&sched_lock); + critical_exit(); } vm_offset_t From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 18:29:35 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9C7E1065677; Mon, 25 Jul 2011 18:29: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 B91368FC0A; Mon, 25 Jul 2011 18:29: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 p6PITZeU070292; Mon, 25 Jul 2011 18:29:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PITZmP070290; Mon, 25 Jul 2011 18:29:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251829.p6PITZmP070290@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224364 - stable/7/sys/sparc64/include X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:29:35 -0000 Author: marius Date: Mon Jul 25 18:29:35 2011 New Revision: 224364 URL: http://svn.freebsd.org/changeset/base/224364 Log: MFC: r223379 Fix whitespace Modified: stable/7/sys/sparc64/include/vmparam.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/vmparam.h ============================================================================== --- stable/7/sys/sparc64/include/vmparam.h Mon Jul 25 18:28:12 2011 (r224363) +++ stable/7/sys/sparc64/include/vmparam.h Mon Jul 25 18:29:35 2011 (r224364) @@ -85,7 +85,7 @@ * The number of PHYSSEG entries must be one greater than the number * of phys_avail entries because the phys_avail entry that spans the * largest physical address that is accessible by ISA DMA is split - * into two PHYSSEG entries. + * into two PHYSSEG entries. */ #define VM_PHYSSEG_MAX 64 @@ -144,13 +144,13 @@ * 43 bits of user address space is considered to be "enough", so we ignore it. * * Upper region: 0xffffffffffffffff - * 0xfffff80000000000 - * + * 0xfffff80000000000 + * * Hole: 0xfffff7ffffffffff - * 0x0000080000000000 + * 0x0000080000000000 * * Lower region: 0x000007ffffffffff - * 0x0000000000000000 + * 0x0000000000000000 * * In general we ignore the upper region, and use the lower region as mappable * space. From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 18:32:55 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BA34106566B; Mon, 25 Jul 2011 18:32: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 29D498FC0A; Mon, 25 Jul 2011 18:32: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 p6PIWt0n070498; Mon, 25 Jul 2011 18:32:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIWtLD070495; Mon, 25 Jul 2011 18:32:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251832.p6PIWtLD070495@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:32:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224366 - stable/7/sys/dev/gem X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:32:55 -0000 Author: marius Date: Mon Jul 25 18:32:54 2011 New Revision: 224366 URL: http://svn.freebsd.org/changeset/base/224366 Log: MFC: r223648, r223949 - In gem_reset_rx() also reset the RX MAC which is necessary in order to get it out of a stuck condition that can be caused by GEM_MAC_RX_OVERFLOW. - In gem_reset_rxdma() call gem_setladrf() in order to reprogram the RX filter and restore the previous content of GEM_MAC_RX_CONFIG. While at it consistently use the newly introduced sc_mac_rxcfg throughout the driver instead of reading the its old content. - Increment if_iqdrops instead of if_ierrors in case of RX buffer allocation failure. - According to the GEM datasheet the RX MAC should also be disabled in gem_setladrf() before changing its configuration. - Add error messages to gem_disable_{r,t}x() and take advantage of these throughout the driver instead of duplicating their functionality all over the place. In joint forces with: yongari Modified: stable/7/sys/dev/gem/if_gem.c stable/7/sys/dev/gem/if_gemvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/gem/if_gem.c ============================================================================== --- stable/7/sys/dev/gem/if_gem.c Mon Jul 25 18:29:35 2011 (r224365) +++ stable/7/sys/dev/gem/if_gem.c Mon Jul 25 18:32:54 2011 (r224366) @@ -705,7 +705,7 @@ gem_reset_rx(struct gem_softc *sc) * Resetting while DMA is in progress can cause a bus hang, so we * disable DMA first. */ - gem_disable_rx(sc); + (void)gem_disable_rx(sc); GEM_BANK1_WRITE_4(sc, GEM_RX_CONFIG, 0); GEM_BANK1_BARRIER(sc, GEM_RX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); @@ -715,7 +715,7 @@ gem_reset_rx(struct gem_softc *sc) /* Wait 5ms extra. */ DELAY(5000); - /* Finally, reset the ERX. */ + /* Reset the ERX. */ GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); @@ -724,6 +724,16 @@ gem_reset_rx(struct gem_softc *sc) device_printf(sc->sc_dev, "cannot reset receiver\n"); return (1); } + + /* Finally, reset RX MAC. */ + GEM_BANK1_WRITE_4(sc, GEM_MAC_RXRESET, 1); + GEM_BANK1_BARRIER(sc, GEM_MAC_RXRESET, 4, + BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); + if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RXRESET, 1, 0)) { + device_printf(sc->sc_dev, "cannot reset RX MAC\n"); + return (1); + } + return (0); } @@ -759,7 +769,7 @@ gem_reset_rxdma(struct gem_softc *sc) GEM_RX_CONFIG_CXM_START_SHFT) | (GEM_THRSH_1024 << GEM_RX_CONFIG_FIFO_THRS_SHIFT) | (ETHER_ALIGN << GEM_RX_CONFIG_FBOFF_SHFT)); - /* Adjust for the SBus clock probably isn't worth the fuzz. */ + /* Adjusting for the SBus clock probably isn't worth the fuzz. */ GEM_BANK1_WRITE_4(sc, GEM_RX_BLANKING, ((6 * (sc->sc_flags & GEM_PCI66) != 0 ? 2 : 1) << GEM_RX_BLANKING_TIME_SHIFT) | 6); @@ -770,8 +780,11 @@ gem_reset_rxdma(struct gem_softc *sc) GEM_BANK1_READ_4(sc, GEM_RX_CONFIG) | GEM_RX_CONFIG_RXDMA_EN); GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_MASK, GEM_MAC_RX_DONE | GEM_MAC_RX_FRAME_CNT); - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, - GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG) | GEM_MAC_RX_ENABLE); + /* + * Clear the RX filter and reprogram it. This will also set the + * current RX MAC configuration and enable it. + */ + gem_setladrf(sc); } static int @@ -782,7 +795,7 @@ gem_reset_tx(struct gem_softc *sc) * Resetting while DMA is in progress can cause a bus hang, so we * disable DMA first. */ - gem_disable_tx(sc); + (void)gem_disable_tx(sc); GEM_BANK1_WRITE_4(sc, GEM_TX_CONFIG, 0); GEM_BANK1_BARRIER(sc, GEM_TX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); @@ -812,8 +825,10 @@ gem_disable_rx(struct gem_softc *sc) GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG) & ~GEM_MAC_RX_ENABLE); GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - return (GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, - 0)); + if (GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0)) + return (1); + device_printf(sc->sc_dev, "cannot disable RX MAC\n"); + return (0); } static int @@ -824,8 +839,10 @@ gem_disable_tx(struct gem_softc *sc) GEM_BANK1_READ_4(sc, GEM_MAC_TX_CONFIG) & ~GEM_MAC_TX_ENABLE); GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - return (GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, - 0)); + if (GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0)) + return (1); + device_printf(sc->sc_dev, "cannot disable TX MAC\n"); + return (0); } static int @@ -960,7 +977,6 @@ gem_init_locked(struct gem_softc *sc) gem_init_regs(sc); /* step 5. RX MAC registers & counters */ - gem_setladrf(sc); /* step 6 & 7. Program Descriptor Ring Base Addresses. */ /* NOTE: we use only 32-bit DMA addresses here. */ @@ -1032,7 +1048,7 @@ gem_init_locked(struct gem_softc *sc) (ETHER_ALIGN << GEM_RX_CONFIG_FBOFF_SHFT) | GEM_RX_CONFIG_RXDMA_EN); - /* Adjust for the SBus clock probably isn't worth the fuzz. */ + /* Adjusting for the SBus clock probably isn't worth the fuzz. */ GEM_BANK1_WRITE_4(sc, GEM_RX_BLANKING, ((6 * (sc->sc_flags & GEM_PCI66) != 0 ? 2 : 1) << GEM_RX_BLANKING_TIME_SHIFT) | 6); @@ -1049,22 +1065,19 @@ gem_init_locked(struct gem_softc *sc) /* step 12. RX_MAC Configuration Register */ v = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG); - v |= GEM_MAC_RX_ENABLE | GEM_MAC_RX_STRIP_CRC; - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot configure RX MAC\n"); - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v); + v &= ~GEM_MAC_RX_ENABLE; + v |= GEM_MAC_RX_STRIP_CRC; + sc->sc_mac_rxcfg = v; + /* + * Clear the RX filter and reprogram it. This will also set the + * current RX MAC configuration and enable it. + */ + gem_setladrf(sc); /* step 13. TX_MAC Configuration Register */ v = GEM_BANK1_READ_4(sc, GEM_MAC_TX_CONFIG); v |= GEM_MAC_TX_ENABLE; - GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot configure TX MAC\n"); + (void)gem_disable_tx(sc); GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, v); /* step 14. Issue Transmit Pending command. */ @@ -1588,7 +1601,7 @@ gem_rint(struct gem_softc *sc) * the buffer that's already attached to this descriptor. */ if (gem_add_rxbuf(sc, sc->sc_rxptr) != 0) { - ifp->if_ierrors++; + ifp->if_iqdrops++; GEM_INIT_RXDESC(sc, sc->sc_rxptr); m = NULL; } @@ -2028,8 +2041,8 @@ gem_mii_statchg(device_t dev) * the GEM Gigabit Ethernet ASIC Specification. */ - rxcfg = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG); - rxcfg &= ~(GEM_MAC_RX_CARR_EXTEND | GEM_MAC_RX_ENABLE); + rxcfg = sc->sc_mac_rxcfg; + rxcfg &= ~GEM_MAC_RX_CARR_EXTEND; txcfg = GEM_MAC_TX_ENA_IPG0 | GEM_MAC_TX_NGU | GEM_MAC_TX_NGU_LIMIT; if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) & IFM_FDX) != 0) txcfg |= GEM_MAC_TX_IGN_CARRIER | GEM_MAC_TX_IGN_COLLIS; @@ -2037,17 +2050,9 @@ gem_mii_statchg(device_t dev) rxcfg |= GEM_MAC_RX_CARR_EXTEND; txcfg |= GEM_MAC_TX_CARR_EXTEND; } - GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_TX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_TX_CONFIG, GEM_MAC_TX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot disable TX MAC\n"); + (void)gem_disable_tx(sc); GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, txcfg); - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, 0); - GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, - BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_ENABLE, 0)) - device_printf(sc->sc_dev, "cannot disable RX MAC\n"); + (void)gem_disable_rx(sc); GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, rxcfg); v = GEM_BANK1_READ_4(sc, GEM_MAC_CONTROL_CONFIG) & @@ -2092,6 +2097,7 @@ gem_mii_statchg(device_t dev) v |= GEM_MAC_XIF_FDPLX_LED; GEM_BANK1_WRITE_4(sc, GEM_MAC_XIF_CONFIG, v); + sc->sc_mac_rxcfg = rxcfg; if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && (sc->sc_flags & GEM_LINK) != 0) { GEM_BANK1_WRITE_4(sc, GEM_MAC_TX_CONFIG, @@ -2164,7 +2170,8 @@ gem_ioctl(struct ifnet *ifp, u_long cmd, case SIOCADDMULTI: case SIOCDELMULTI: GEM_LOCK(sc); - gem_setladrf(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + gem_setladrf(sc); GEM_UNLOCK(sc); break; case SIOCGIFMEDIA: @@ -2199,24 +2206,20 @@ gem_setladrf(struct gem_softc *sc) GEM_LOCK_ASSERT(sc, MA_OWNED); - /* Get the current RX configuration. */ - v = GEM_BANK1_READ_4(sc, GEM_MAC_RX_CONFIG); - /* - * Turn off promiscuous mode, promiscuous group mode (all multicast), - * and hash filter. Depending on the case, the right bit will be - * enabled. + * Turn off the RX MAC and the hash filter as required by the Sun GEM + * programming restrictions. */ - v &= ~(GEM_MAC_RX_PROMISCUOUS | GEM_MAC_RX_HASH_FILTER | - GEM_MAC_RX_PROMISC_GRP); - + v = sc->sc_mac_rxcfg & GEM_MAC_RX_HASH_FILTER; GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v); GEM_BANK1_BARRIER(sc, GEM_MAC_RX_CONFIG, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_HASH_FILTER, - 0)) - device_printf(sc->sc_dev, "cannot disable RX hash filter\n"); + if (!GEM_BANK1_BITWAIT(sc, GEM_MAC_RX_CONFIG, GEM_MAC_RX_HASH_FILTER | + GEM_MAC_RX_ENABLE, 0)) + device_printf(sc->sc_dev, + "cannot disable RX MAC or hash filter\n"); + v &= ~(GEM_MAC_RX_PROMISCUOUS | GEM_MAC_RX_PROMISC_GRP); if ((ifp->if_flags & IFF_PROMISC) != 0) { v |= GEM_MAC_RX_PROMISCUOUS; goto chipit; @@ -2262,5 +2265,6 @@ gem_setladrf(struct gem_softc *sc) hash[i]); chipit: - GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v); + sc->sc_mac_rxcfg = v; + GEM_BANK1_WRITE_4(sc, GEM_MAC_RX_CONFIG, v | GEM_MAC_RX_ENABLE); } Modified: stable/7/sys/dev/gem/if_gemvar.h ============================================================================== --- stable/7/sys/dev/gem/if_gemvar.h Mon Jul 25 18:29:35 2011 (r224365) +++ stable/7/sys/dev/gem/if_gemvar.h Mon Jul 25 18:32:54 2011 (r224366) @@ -173,6 +173,8 @@ struct gem_softc { u_int sc_rxptr; /* next ready RX descriptor/state */ u_int sc_rxfifosize; /* RX FIFO size (bytes) */ + uint32_t sc_mac_rxcfg; /* RX MAC conf. % GEM_MAC_RX_ENABLE */ + int sc_ifflags; u_long sc_csum_features; }; From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 18:34:42 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 675B01065673; Mon, 25 Jul 2011 18:34:42 +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 56F7B8FC13; Mon, 25 Jul 2011 18:34: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 p6PIYgmc070687; Mon, 25 Jul 2011 18:34:42 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIYgWk070685; Mon, 25 Jul 2011 18:34:42 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251834.p6PIYgWk070685@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:34:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224368 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:34:42 -0000 Author: marius Date: Mon Jul 25 18:34:42 2011 New Revision: 224368 URL: http://svn.freebsd.org/changeset/base/224368 Log: MFC: r223718 Using .comm to declare intrnames and eintrnames causes binutils 2.17.50 to merge the two. Modified: stable/7/sys/sparc64/sparc64/exception.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 18:32:56 2011 (r224367) +++ stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 18:34:42 2011 (r224368) @@ -365,11 +365,18 @@ ENTRY(rsf_fatal) sir END(rsf_fatal) - .comm intrnames, IV_MAX * (MAXCOMLEN + 1) - .comm eintrnames, 0 + .data + _ALIGN_DATA + .globl intrnames, eintrnames +intrnames: + .space IV_MAX * (MAXCOMLEN + 1) +eintrnames: + .globl intrcnt, eintrcnt +intrcnt: + .space IV_MAX * 8 +eintrcnt: - .comm intrcnt, IV_MAX * 8 - .comm eintrcnt, 0 + .text /* * Trap table and associated macros From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 18:42:45 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E20D61065670; Mon, 25 Jul 2011 18:42:45 +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 CF91A8FC08; Mon, 25 Jul 2011 18:42:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIgjrg071043; Mon, 25 Jul 2011 18:42:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIgjC1071031; Mon, 25 Jul 2011 18:42:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251842.p6PIgjC1071031@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:42:45 +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: r224371 - in stable/7/sys: boot/sparc64/loader sparc64/include sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:42:46 -0000 Author: marius Date: Mon Jul 25 18:42:45 2011 New Revision: 224371 URL: http://svn.freebsd.org/changeset/base/224371 Log: MFC: r223719 - For Cheetah- and Zeus-class CPUs don't flush all unlocked entries from the TLBs in order to get rid of the user mappings but instead traverse them an flush only the latter like we also do for the Spitfire-class. Also flushing the unlocked kernel entries can cause instant faults which when called from within cpu_switch() are handled with the scheduler lock held which in turn can cause timeouts on the acquisition of the lock by other CPUs. This was easily seen with a 16-core V890 but occasionally also happened with 2-way machines. While at it, move the SPARC64-V support code entirely to zeus.c. This causes a little bit of duplication but is less confusing than partially using Cheetah-class bits for these. - For SPARC64-V ensure that 4-Mbyte page entries are stored in the 1024- entry, 2-way set associative TLB. - In {d,i}tlb_get_data_sun4u() turn off the interrupts in order to ensure that ASI_{D,I}TLB_DATA_ACCESS_REG actually are read twice back-to-back. Tested by: Peter Jeremy (16-core US-IV), Michael Moll (2-way SPARC64-V) Modified: stable/7/sys/boot/sparc64/loader/main.c stable/7/sys/sparc64/include/cache.h stable/7/sys/sparc64/include/cpu.h stable/7/sys/sparc64/include/tlb.h stable/7/sys/sparc64/sparc64/cache.c stable/7/sys/sparc64/sparc64/cheetah.c stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sparc64/sparc64/mp_machdep.c stable/7/sys/sparc64/sparc64/pmap.c stable/7/sys/sparc64/sparc64/spitfire.c stable/7/sys/sparc64/sparc64/zeus.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/sparc64/loader/main.c ============================================================================== --- stable/7/sys/boot/sparc64/loader/main.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/boot/sparc64/loader/main.c Mon Jul 25 18:42:45 2011 (r224371) @@ -96,10 +96,10 @@ static struct mmu_ops { typedef void kernel_entry_t(vm_offset_t mdp, u_long o1, u_long o2, u_long o3, void *openfirmware); -static inline u_long dtlb_get_data_sun4u(u_int); +static inline u_long dtlb_get_data_sun4u(u_int, u_int); static int dtlb_enter_sun4u(u_int, u_long data, vm_offset_t); static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t); -static inline u_long itlb_get_data_sun4u(u_int); +static inline u_long itlb_get_data_sun4u(u_int, u_int); static int itlb_enter_sun4u(u_int, u_long data, vm_offset_t); static vm_offset_t itlb_va_to_pa_sun4u(vm_offset_t); static void itlb_relocate_locked0_sun4u(void); @@ -140,6 +140,7 @@ u_int itlb_slot; static int cpu_impl; static u_int dtlb_slot_max; static u_int itlb_slot_max; +static u_int tlb_locked; /* sun4v */ static struct tlb_entry *tlb_store; @@ -414,42 +415,55 @@ __elfN(exec)(struct preloaded_file *fp) } static inline u_long -dtlb_get_data_sun4u(u_int slot) +dtlb_get_data_sun4u(u_int tlb, u_int slot) { + u_long data, pstate; + slot = TLB_DAR_SLOT(tlb, slot); /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work - * around errata of USIII and beyond. + * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to + * work around errata of USIII and beyond. */ - (void)ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG); - return (ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG)); + pstate = rdpr(pstate); + wrpr(pstate, pstate & ~PSTATE_IE, 0); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + wrpr(pstate, pstate, 0); + return (data); } static inline u_long -itlb_get_data_sun4u(u_int slot) +itlb_get_data_sun4u(u_int tlb, u_int slot) { + u_long data, pstate; + slot = TLB_DAR_SLOT(tlb, slot); /* - * We read ASI_ITLB_DATA_ACCESS_REG twice in order to work - * around errata of USIII and beyond. + * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to + * work around errata of USIII and beyond. */ - (void)ldxa(TLB_DAR_SLOT(slot), ASI_ITLB_DATA_ACCESS_REG); - return (ldxa(TLB_DAR_SLOT(slot), ASI_ITLB_DATA_ACCESS_REG)); + pstate = rdpr(pstate); + wrpr(pstate, pstate & ~PSTATE_IE, 0); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + wrpr(pstate, pstate, 0); + return (data); } static vm_offset_t dtlb_va_to_pa_sun4u(vm_offset_t va) { u_long pstate, reg; - int i; + u_int i, tlb; pstate = rdpr(pstate); wrpr(pstate, pstate & ~PSTATE_IE, 0); for (i = 0; i < dtlb_slot_max; i++) { - reg = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); + reg = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_DTLB_TAG_READ_REG); if (TLB_TAR_VA(reg) != va) continue; - reg = dtlb_get_data_sun4u(i); + reg = dtlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); reg >>= TD_PA_SHIFT; if (cpu_impl == CPU_IMPL_SPARC64V || @@ -470,10 +484,11 @@ itlb_va_to_pa_sun4u(vm_offset_t va) pstate = rdpr(pstate); wrpr(pstate, pstate & ~PSTATE_IE, 0); for (i = 0; i < itlb_slot_max; i++) { - reg = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); + reg = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_ITLB_TAG_READ_REG); if (TLB_TAR_VA(reg) != va) continue; - reg = itlb_get_data_sun4u(i); + reg = itlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); reg >>= TD_PA_SHIFT; if (cpu_impl == CPU_IMPL_SPARC64V || @@ -517,14 +532,14 @@ itlb_relocate_locked0_sun4u(void) pstate = rdpr(pstate); wrpr(pstate, pstate & ~PSTATE_IE, 0); - data = itlb_get_data_sun4u(0); + data = itlb_get_data_sun4u(tlb_locked, 0); if ((data & (TD_V | TD_L)) != (TD_V | TD_L)) { wrpr(pstate, pstate, 0); return; } /* Flush the mapping of slot 0. */ - tag = ldxa(TLB_DAR_SLOT(0), ASI_ITLB_TAG_READ_REG); + tag = ldxa(TLB_DAR_SLOT(tlb_locked, 0), ASI_ITLB_TAG_READ_REG); stxa(TLB_DEMAP_VA(TLB_TAR_VA(tag)) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, ASI_IMMU_DEMAP, 0); flush(0); /* The USIII-family ignores the address. */ @@ -534,11 +549,12 @@ itlb_relocate_locked0_sun4u(void) * that formerly were in slot 0. */ for (i = 1; i < itlb_slot_max; i++) { - if ((itlb_get_data_sun4u(i) & TD_V) != 0) + if ((itlb_get_data_sun4u(tlb_locked, i) & TD_V) != 0) continue; stxa(AA_IMMU_TAR, ASI_IMMU, tag); - stxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG, data); + stxa(TLB_DAR_SLOT(tlb_locked, i), ASI_ITLB_DATA_ACCESS_REG, + data); flush(0); /* The USIII-family ignores the address. */ break; } @@ -751,6 +767,26 @@ tlb_init_sun4u(void) phandle_t bsp; cpu_impl = VER_IMPL(rdpr(ver)); + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + tlb_locked = TLB_DAR_T32; + break; + case CPU_IMPL_ULTRASPARCIII: + case CPU_IMPL_ULTRASPARCIIIp: + case CPU_IMPL_ULTRASPARCIIIi: + case CPU_IMPL_ULTRASPARCIIIip: + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + tlb_locked = TLB_DAR_T16; + break; + case CPU_IMPL_SPARC64V: + tlb_locked = TLB_DAR_FTLB; + break; + } bsp = find_bsp_sun4u(OF_child(root), cpu_get_mid_sun4u()); if (bsp == 0) panic("%s: no node for bootcpu?!?!", __func__); @@ -937,21 +973,23 @@ pmap_print_tlb_sun4u(void) pstate = rdpr(pstate); for (i = 0; i < itlb_slot_max; i++) { wrpr(pstate, pstate & ~PSTATE_IE, 0); - tte = itlb_get_data_sun4u(i); + tte = itlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); if (!(tte & TD_V)) continue; - tag = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); + tag = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_ITLB_TAG_READ_REG); printf("iTLB-%2u: ", i); pmap_print_tte_sun4u(tag, tte); } for (i = 0; i < dtlb_slot_max; i++) { wrpr(pstate, pstate & ~PSTATE_IE, 0); - tte = dtlb_get_data_sun4u(i); + tte = dtlb_get_data_sun4u(tlb_locked, i); wrpr(pstate, pstate, 0); if (!(tte & TD_V)) continue; - tag = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); + tag = ldxa(TLB_DAR_SLOT(tlb_locked, i), + ASI_DTLB_TAG_READ_REG); printf("dTLB-%2u: ", i); pmap_print_tte_sun4u(tag, tte); } Modified: stable/7/sys/sparc64/include/cache.h ============================================================================== --- stable/7/sys/sparc64/include/cache.h Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/include/cache.h Mon Jul 25 18:42:45 2011 (r224371) @@ -110,15 +110,16 @@ cache_flush_t spitfire_cache_flush; dcache_page_inval_t spitfire_dcache_page_inval; icache_page_inval_t spitfire_icache_page_inval; +cache_enable_t zeus_cache_enable; +cache_flush_t zeus_cache_flush; +dcache_page_inval_t zeus_dcache_page_inval; +icache_page_inval_t zeus_icache_page_inval; + extern cache_enable_t *cache_enable; extern cache_flush_t *cache_flush; extern dcache_page_inval_t *dcache_page_inval; extern icache_page_inval_t *icache_page_inval; -cache_flush_t zeus_cache_flush; -dcache_page_inval_t zeus_dcache_page_inval; -icache_page_inval_t zeus_icache_page_inval; - #endif /* KERNEL */ #endif /* !LOCORE */ Modified: stable/7/sys/sparc64/include/cpu.h ============================================================================== --- stable/7/sys/sparc64/include/cpu.h Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/include/cpu.h Mon Jul 25 18:42:45 2011 (r224371) @@ -57,6 +57,7 @@ void cpu_halt(void); void cpu_reset(void); void fork_trampoline(void); void swi_vm(void *v); +void zeus_init(u_int cpu_impl); static __inline u_int64_t get_cyclecount(void) Modified: stable/7/sys/sparc64/include/tlb.h ============================================================================== --- stable/7/sys/sparc64/include/tlb.h Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/include/tlb.h Mon Jul 25 18:42:45 2011 (r224371) @@ -44,7 +44,17 @@ (TD_V | TD_4M | (TLB_DIRECT_ADDRESS_MASK - TLB_DIRECT_PAGE_MASK)) #define TLB_DAR_SLOT_SHIFT (3) -#define TLB_DAR_SLOT(slot) ((slot) << TLB_DAR_SLOT_SHIFT) +#define TLB_DAR_TLB_SHIFT (16) +#define TLB_DAR_SLOT(tlb, slot) \ + ((tlb) << TLB_DAR_TLB_SHIFT | (slot) << TLB_DAR_SLOT_SHIFT) +#define TLB_DAR_T16 (0) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_T32 (0) /* US-I, II{,e,i} */ +#define TLB_DAR_DT512_0 (2) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_DT512_1 (3) /* US-III{,i,+}, IV{,+} */ +#define TLB_DAR_IT128 (2) /* US-III{,i,+}, IV */ +#define TLB_DAR_IT512 (2) /* US-IV+ */ +#define TLB_DAR_FTLB (0) /* SPARC64 V, VI, VII, VIIIfx */ +#define TLB_DAR_STLB (2) /* SPARC64 V, VI, VII, VIIIfx */ #define TAR_VPN_SHIFT (13) #define TAR_CTX_MASK ((1 << TAR_VPN_SHIFT) - 1) @@ -156,6 +166,9 @@ tlb_flush_user_t cheetah_tlb_flush_user; tlb_flush_nonlocked_t spitfire_tlb_flush_nonlocked; tlb_flush_user_t spitfire_tlb_flush_user; +tlb_flush_nonlocked_t zeus_tlb_flush_nonlocked; +tlb_flush_user_t zeus_tlb_flush_user; + extern tlb_flush_nonlocked_t *tlb_flush_nonlocked; extern tlb_flush_user_t *tlb_flush_user; Modified: stable/7/sys/sparc64/sparc64/cache.c ============================================================================== --- stable/7/sys/sparc64/sparc64/cache.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/cache.c Mon Jul 25 18:42:45 2011 (r224371) @@ -169,12 +169,12 @@ cache_init(struct pcpu *pcpu) tlb_flush_nonlocked = cheetah_tlb_flush_nonlocked; tlb_flush_user = cheetah_tlb_flush_user; } else if (pcpu->pc_impl == CPU_IMPL_SPARC64V) { - cache_enable = cheetah_cache_enable; + cache_enable = zeus_cache_enable; cache_flush = zeus_cache_flush; dcache_page_inval = zeus_dcache_page_inval; icache_page_inval = zeus_icache_page_inval; - tlb_flush_nonlocked = cheetah_tlb_flush_nonlocked; - tlb_flush_user = cheetah_tlb_flush_user; + tlb_flush_nonlocked = zeus_tlb_flush_nonlocked; + tlb_flush_user = zeus_tlb_flush_user; } else if (pcpu->pc_impl >= CPU_IMPL_ULTRASPARCI && pcpu->pc_impl < CPU_IMPL_ULTRASPARCIII) { cache_enable = spitfire_cache_enable; Modified: stable/7/sys/sparc64/sparc64/cheetah.c ============================================================================== --- stable/7/sys/sparc64/sparc64/cheetah.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/cheetah.c Mon Jul 25 18:42:45 2011 (r224371) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2003 Jake Burkholder. - * Copyright (c) 2005, 2008, 2010 Marius Strobl + * Copyright (c) 2005 - 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -28,8 +28,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_pmap.h" - #include #include #include @@ -45,17 +43,19 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #define CHEETAH_ICACHE_TAG_LOWER 0x30 +#define CHEETAH_T16_ENTRIES 16 +#define CHEETAH_DT512_ENTRIES 512 +#define CHEETAH_IT128_ENTRIES 128 +#define CHEETAH_IT512_ENTRIES 512 /* - * CPU-specific initialization - this is used for both the Sun Cheetah and - * later as well as the Fujitsu Zeus and later CPUs. + * CPU-specific initialization for Sun Cheetah and later CPUs */ void cheetah_init(u_int cpu_impl) @@ -78,14 +78,6 @@ cheetah_init(u_int cpu_impl) stxa(AA_IMMU_TSB_NEXT_REG, ASI_IMMU, 0); membar(Sync); - if (cpu_impl == CPU_IMPL_SPARC64V) { - /* Ensure MCNTL_JPS1_TSBP is 0. */ - val = ldxa(AA_MCNTL, ASI_MCNTL); - val &= ~MCNTL_JPS1_TSBP; - stxa(AA_MCNTL, ASI_MCNTL, val); - return; - } - /* * Configure the first large dTLB to hold 4MB pages (e.g. for direct * mappings) for all three contexts and ensure the second one is set @@ -223,33 +215,92 @@ cheetah_icache_page_inval(vm_paddr_t pa } -#define cheetah_dmap_all() do { \ - stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); \ - stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0); \ - flush(KERNBASE); \ -} while (0) - /* - * Flush all non-locked mappings from the TLB. + * Flush all non-locked mappings from the TLBs. */ void cheetah_tlb_flush_nonlocked(void) { - cheetah_dmap_all(); + stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); + stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0); + flush(KERNBASE); } /* - * Flush all user mappings from the TLB. + * Flush all user mappings from the TLBs. */ void -cheetah_tlb_flush_user() +cheetah_tlb_flush_user(void) { + u_long data, tag; + register_t s; + u_int i, slot; /* - * Just use cheetah_dmap_all() and accept somes TLB misses - * rather than searching all 1040 D-TLB and 144 I-TLB slots - * for non-kernel mappings. + * We read ASI_{D,I}TLB_DATA_ACCESS_REG twice back-to-back in order + * to work around errata of USIII and beyond. */ - cheetah_dmap_all(); + for (i = 0; i < CHEETAH_T16_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_T16, i); + s = intr_disable(); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + for (i = 0; i < CHEETAH_DT512_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_DT512_0, i); + s = intr_disable(); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + slot = TLB_DAR_SLOT(TLB_DAR_DT512_1, i); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + } + if (PCPU_GET(impl) == CPU_IMPL_ULTRASPARCIVp) { + for (i = 0; i < CHEETAH_IT512_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_IT512, i); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + intr_restore(s); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + } else { + for (i = 0; i < CHEETAH_IT128_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_IT128, i); + s = intr_disable(); + (void)ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + intr_restore(s); + if ((data & TD_V) != 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + } } Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/machdep.c Mon Jul 25 18:42:45 2011 (r224371) @@ -347,9 +347,10 @@ sparc64_init(caddr_t mdp, u_long o1, u_l /* * Do CPU-specific initialization. */ - if (cpu_impl == CPU_IMPL_SPARC64V || - cpu_impl >= CPU_IMPL_ULTRASPARCIII) + if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(cpu_impl); + else if (cpu_impl == CPU_IMPL_SPARC64V) + zeus_init(cpu_impl); /* * Clear (S)TICK timer (including NPT). Modified: stable/7/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/mp_machdep.c Mon Jul 25 18:42:45 2011 (r224371) @@ -415,9 +415,11 @@ cpu_mp_bootstrap(struct pcpu *pc) csa = &cpu_start_args; /* Do CPU-specific initialization. */ - if (pc->pc_impl == CPU_IMPL_SPARC64V || - pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) + if (pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) cheetah_init(pc->pc_impl); + else if (pc->pc_impl == CPU_IMPL_SPARC64V) + zeus_init(pc->pc_impl); + /* * Enable the caches. Note that his may include applying workarounds. */ Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:42:45 2011 (r224371) @@ -236,7 +236,7 @@ PMAP_STATS_VAR(pmap_ncopy_page_soc); PMAP_STATS_VAR(pmap_nnew_thread); PMAP_STATS_VAR(pmap_nnew_thread_oc); -static inline u_long dtlb_get_data(u_int slot); +static inline u_long dtlb_get_data(u_int tlb, u_int slot); /* * Quick sort callout for comparing memory regions @@ -277,15 +277,21 @@ om_cmp(const void *a, const void *b) } static inline u_long -dtlb_get_data(u_int slot) +dtlb_get_data(u_int tlb, u_int slot) { + u_long data; + register_t s; + slot = TLB_DAR_SLOT(tlb, slot); /* - * We read ASI_DTLB_DATA_ACCESS_REG twice in order to work - * around errata of USIII and beyond. + * We read ASI_DTLB_DATA_ACCESS_REG twice back-to-back in order to + * work around errata of USIII and beyond. */ - (void)ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG); - return (ldxa(TLB_DAR_SLOT(slot), ASI_DTLB_DATA_ACCESS_REG)); + s = intr_disable(); + (void)ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + intr_restore(s); + return (data); } /* @@ -362,7 +368,8 @@ pmap_bootstrap(u_int cpu_impl) */ dtlb_slots_avail = 0; for (i = 0; i < dtlb_slots; i++) { - data = dtlb_get_data(i); + data = dtlb_get_data(cpu_impl == CPU_IMPL_ULTRASPARCIII ? + TLB_DAR_T16 : TLB_DAR_T32, i); if ((data & (TD_V | TD_L)) != (TD_V | TD_L)) dtlb_slots_avail++; } Modified: stable/7/sys/sparc64/sparc64/spitfire.c ============================================================================== --- stable/7/sys/sparc64/sparc64/spitfire.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/spitfire.c Mon Jul 25 18:42:45 2011 (r224371) @@ -140,47 +140,45 @@ spitfire_icache_page_inval(vm_paddr_t pa } /* - * Flush all non-locked mappings from the TLB. + * Flush all non-locked mappings from the TLBs. */ void spitfire_tlb_flush_nonlocked(void) { - int i; + u_int i; + u_int slot; for (i = 0; i < SPITFIRE_TLB_ENTRIES; i++) { - if ((ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG) & - TD_L) == 0) - stxa_sync(TLB_DAR_SLOT(i), - ASI_DTLB_DATA_ACCESS_REG, 0); - if ((ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG) & - TD_L) == 0) - stxa_sync(TLB_DAR_SLOT(i), - ASI_ITLB_DATA_ACCESS_REG, 0); + slot = TLB_DAR_SLOT(TLB_DAR_T32, i); + if ((ldxa(slot, ASI_DTLB_DATA_ACCESS_REG) & TD_L) == 0) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + if ((ldxa(slot, ASI_ITLB_DATA_ACCESS_REG) & TD_L) == 0) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); } } /* - * Flush all user mappings from the TLB. + * Flush all user mappings from the TLBs. */ void spitfire_tlb_flush_user(void) { u_long data; u_long tag; - int i; + u_int i; + u_int slot; for (i = 0; i < SPITFIRE_TLB_ENTRIES; i++) { - data = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_DATA_ACCESS_REG); - tag = ldxa(TLB_DAR_SLOT(i), ASI_DTLB_TAG_READ_REG); + slot = TLB_DAR_SLOT(TLB_DAR_T32, i); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); if ((data & TD_V) != 0 && (data & TD_L) == 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) - stxa_sync(TLB_DAR_SLOT(i), - ASI_DTLB_DATA_ACCESS_REG, 0); - data = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_DATA_ACCESS_REG); - tag = ldxa(TLB_DAR_SLOT(i), ASI_ITLB_TAG_READ_REG); + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); if ((data & TD_V) != 0 && (data & TD_L) == 0 && TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) - stxa_sync(TLB_DAR_SLOT(i), - ASI_ITLB_DATA_ACCESS_REG, 0); + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); } } Modified: stable/7/sys/sparc64/sparc64/zeus.c ============================================================================== --- stable/7/sys/sparc64/sparc64/zeus.c Mon Jul 25 18:41:52 2011 (r224370) +++ stable/7/sys/sparc64/sparc64/zeus.c Mon Jul 25 18:42:45 2011 (r224371) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Marius Strobl + * Copyright (c) 2010 - 2011 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,7 +32,64 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include +#include +#include +#include +#include + +#define ZEUS_FTLB_ENTRIES 32 +#define ZEUS_STLB_ENTRIES 2048 + +/* + * CPU-specific initialization for Fujitsu Zeus CPUs + */ +void +zeus_init(u_int cpu_impl) +{ + u_long val; + + /* Ensure the TSB Extension Registers hold 0 as TSB_Base. */ + + stxa(AA_DMMU_TSB_PEXT_REG, ASI_DMMU, 0); + stxa(AA_IMMU_TSB_PEXT_REG, ASI_IMMU, 0); + membar(Sync); + + stxa(AA_DMMU_TSB_SEXT_REG, ASI_DMMU, 0); + /* + * NB: the secondary context was removed from the iMMU. + */ + membar(Sync); + + stxa(AA_DMMU_TSB_NEXT_REG, ASI_DMMU, 0); + stxa(AA_IMMU_TSB_NEXT_REG, ASI_IMMU, 0); + membar(Sync); + + val = ldxa(AA_MCNTL, ASI_MCNTL); + /* Ensure MCNTL_JPS1_TSBP is 0. */ + val &= ~MCNTL_JPS1_TSBP; + /* + * Ensure 4-Mbyte page entries are stored in the 1024-entry, 2-way set + * associative TLB. + */ + val = (val & ~MCNTL_RMD_MASK) | MCNTL_RMD_1024; + stxa(AA_MCNTL, ASI_MCNTL, val); +} + +/* + * Enable level 1 caches. + */ +void +zeus_cache_enable(u_int cpu_impl) +{ + u_long lsu; + + lsu = ldxa(0, ASI_LSU_CTL_REG); + stxa(0, ASI_LSU_CTL_REG, lsu | LSU_IC | LSU_DC); + flush(KERNBASE); +} /* * Flush all lines from the level 1 caches. @@ -63,3 +120,52 @@ zeus_icache_page_inval(vm_paddr_t pa __u { } + +/* + * Flush all non-locked mappings from the TLBs. + */ +void +zeus_tlb_flush_nonlocked(void) +{ + + stxa(TLB_DEMAP_ALL, ASI_DMMU_DEMAP, 0); + stxa(TLB_DEMAP_ALL, ASI_IMMU_DEMAP, 0); + flush(KERNBASE); +} + +/* + * Flush all user mappings from the TLBs. + */ +void +zeus_tlb_flush_user(void) +{ + u_long data, tag; + u_int i, slot; + + for (i = 0; i < ZEUS_FTLB_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_FTLB, i); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } + for (i = 0; i < ZEUS_STLB_ENTRIES; i++) { + slot = TLB_DAR_SLOT(TLB_DAR_STLB, i); + data = ldxa(slot, ASI_DTLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_DTLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_DTLB_DATA_ACCESS_REG, 0); + data = ldxa(slot, ASI_ITLB_DATA_ACCESS_REG); + tag = ldxa(slot, ASI_ITLB_TAG_READ_REG); + if ((data & TD_V) != 0 && (data & TD_L) == 0 && + TLB_TAR_CTX(tag) != TLB_CTX_KERNEL) + stxa_sync(slot, ASI_ITLB_DATA_ACCESS_REG, 0); + } +} From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 18:43:24 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E68D110656D5; Mon, 25 Jul 2011 18:43:24 +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 D60E38FC20; Mon, 25 Jul 2011 18:43: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 p6PIhOxH071119; Mon, 25 Jul 2011 18:43:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIhO5V071117; Mon, 25 Jul 2011 18:43:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251843.p6PIhO5V071117@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224372 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:43:25 -0000 Author: marius Date: Mon Jul 25 18:43:24 2011 New Revision: 224372 URL: http://svn.freebsd.org/changeset/base/224372 Log: MFC: r223720 Don't waste a delay slot. Modified: stable/7/sys/sparc64/sparc64/mp_exception.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/mp_exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/mp_exception.S Mon Jul 25 18:42:45 2011 (r224371) +++ stable/7/sys/sparc64/sparc64/mp_exception.S Mon Jul 25 18:43:24 2011 (r224372) @@ -235,8 +235,8 @@ ENTRY(tl_ipi_tlb_range_demap) ldx [%g5 + ITA_START], %g1 ldx [%g5 + ITA_END], %g2 -1: or %g1, %g3, %g4 sethi %hi(KERNBASE), %g6 +1: or %g1, %g3, %g4 stxa %g0, [%g4] ASI_DMMU_DEMAP stxa %g0, [%g4] ASI_IMMU_DEMAP flush %g6 @@ -245,7 +245,7 @@ ENTRY(tl_ipi_tlb_range_demap) add %g1, %g6, %g1 cmp %g1, %g2 blt,a,pt %xcc, 1b - nop + sethi %hi(KERNBASE), %g6 IPI_DONE(%g5, %g1, %g2, %g3) retry From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 18:44:47 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 387ED106564A; Mon, 25 Jul 2011 18:44:47 +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 0E8278FC1A; Mon, 25 Jul 2011 18:44:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIikqG071289; Mon, 25 Jul 2011 18:44:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIik2H071286; Mon, 25 Jul 2011 18:44:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251844.p6PIik2H071286@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:44:46 +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: r224374 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:44:47 -0000 Author: marius Date: Mon Jul 25 18:44:46 2011 New Revision: 224374 URL: http://svn.freebsd.org/changeset/base/224374 Log: MFC: r223721 UltraSPARC-IV CPUs seem to be affected by a not publicly documented erratum causing them to trigger stray vector interrupts accompanied by a state in which they even fault on locked TLB entries. Just retrying the instruction in that case gets the CPU back on track though. OpenSolaris also just ignores a certain number of stray vector interrupts. While at it, implement the stray vector interrupt handling for SPARC64-VI which use these for indicating uncorrectable errors in interrupt packets. Modified: stable/7/sys/sparc64/sparc64/exception.S stable/7/sys/sparc64/sparc64/interrupt.S Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 18:43:25 2011 (r224373) +++ stable/7/sys/sparc64/sparc64/exception.S Mon Jul 25 18:44:46 2011 (r224374) @@ -581,7 +581,8 @@ END(tl0_sfsr_trap) andcc %g1, IRSR_BUSY, %g0 bnz,a,pt %xcc, intr_vector nop - sir + ba,a,pt %xcc, intr_vector_stray + nop .align 32 .endm Modified: stable/7/sys/sparc64/sparc64/interrupt.S ============================================================================== --- stable/7/sys/sparc64/sparc64/interrupt.S Mon Jul 25 18:43:25 2011 (r224373) +++ stable/7/sys/sparc64/sparc64/interrupt.S Mon Jul 25 18:44:46 2011 (r224374) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "assym.s" @@ -153,6 +154,29 @@ ENTRY(intr_vector) retry END(intr_vector) +ENTRY(intr_vector_stray) + /* + * SPARC64-VI trigger stray vector interrupts in order to indicate + * uncorrectable errors in interrupt packets, which still need to be + * acknowledged though. + * US-IV occasionally trigger stray vector interrupts for reasons + * unknown accompanied by a state in which they even fault on locked + * TLB entries so we can't even log these here. Just retrying the + * instruction in that case gets the CPU back on track. + */ + rdpr %ver, %g1 + srlx %g1, VER_IMPL_SHIFT, %g1 + sll %g1, VER_IMPL_SIZE, %g1 + srl %g1, VER_IMPL_SIZE, %g1 + cmp %g1, CPU_IMPL_SPARC64VI + bne,a,pn %icc, 1f + nop + stxa %g0, [%g0] ASI_INTR_RECEIVE + membar #Sync + +1: retry +END(intr_vector_stray) + ENTRY(intr_fast) save %sp, -CCFSZ, %sp From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 18:46:56 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C0D7106566C; Mon, 25 Jul 2011 18:46: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 71BEF8FC16; Mon, 25 Jul 2011 18:46: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 p6PIkuV8071527; Mon, 25 Jul 2011 18:46:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIkuM0071524; Mon, 25 Jul 2011 18:46:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251846.p6PIkuM0071524@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:46: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: r224377 - in stable/7/sys: kern sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:46:56 -0000 Author: marius Date: Mon Jul 25 18:46:56 2011 New Revision: 224377 URL: http://svn.freebsd.org/changeset/base/224377 Log: MFC: r223795 Call pmap_qremove() before freeing or unwiring the pages, otherwise there's a window during which a page can be re-used before its previous mapping is removed. Reviewed by: alc Modified: stable/7/sys/kern/vfs_bio.c stable/7/sys/sparc64/sparc64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/vfs_bio.c ============================================================================== --- stable/7/sys/kern/vfs_bio.c Mon Jul 25 18:46:54 2011 (r224376) +++ stable/7/sys/kern/vfs_bio.c Mon Jul 25 18:46:56 2011 (r224377) @@ -1574,6 +1574,7 @@ vfs_vmio_release(struct buf *bp) int i; vm_page_t m; + pmap_qremove(trunc_page((vm_offset_t)bp->b_data), bp->b_npages); VM_OBJECT_LOCK(bp->b_bufobj->bo_object); vm_page_lock_queues(); for (i = 0; i < bp->b_npages; i++) { @@ -1610,7 +1611,6 @@ vfs_vmio_release(struct buf *bp) } vm_page_unlock_queues(); VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); - pmap_qremove(trunc_page((vm_offset_t) bp->b_data), bp->b_npages); if (bp->b_bufsize) { bufspacewakeup(); @@ -2950,6 +2950,10 @@ allocbuf(struct buf *bp, int size) if (desiredpages < bp->b_npages) { vm_page_t m; + pmap_qremove((vm_offset_t)trunc_page( + (vm_offset_t)bp->b_data) + + (desiredpages << PAGE_SHIFT), + (bp->b_npages - desiredpages)); VM_OBJECT_LOCK(bp->b_bufobj->bo_object); vm_page_lock_queues(); for (i = desiredpages; i < bp->b_npages; i++) { @@ -2969,8 +2973,6 @@ allocbuf(struct buf *bp, int size) } vm_page_unlock_queues(); VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); - pmap_qremove((vm_offset_t) trunc_page((vm_offset_t)bp->b_data) + - (desiredpages << PAGE_SHIFT), (bp->b_npages - desiredpages)); bp->b_npages = desiredpages; } } else if (size > bp->b_bcount) { Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:46:54 2011 (r224376) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:46:56 2011 (r224377) @@ -1158,6 +1158,7 @@ pmap_release(pmap_t pm) pc->pc_pmap = NULL; mtx_unlock_spin(&sched_lock); + pmap_qremove((vm_offset_t)pm->pm_tsb, TSB_PAGES); obj = pm->pm_tsb_obj; VM_OBJECT_LOCK(obj); KASSERT(obj->ref_count == 1, ("pmap_release: tsbobj ref count != 1")); @@ -1175,7 +1176,6 @@ pmap_release(pmap_t pm) vm_page_unlock_queues(); } VM_OBJECT_UNLOCK(obj); - pmap_qremove((vm_offset_t)pm->pm_tsb, TSB_PAGES); PMAP_LOCK_DESTROY(pm); } From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 18:53:24 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E0D21065678; Mon, 25 Jul 2011 18:53:24 +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 D7FFA8FC20; Mon, 25 Jul 2011 18:53:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PIrN0T071822; Mon, 25 Jul 2011 18:53:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIrNck071819; Mon, 25 Jul 2011 18:53:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251853.p6PIrNck071819@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:53:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224379 - in stable/7/sys/sparc64: include sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:53:24 -0000 Author: marius Date: Mon Jul 25 18:53:23 2011 New Revision: 224379 URL: http://svn.freebsd.org/changeset/base/224379 Log: MFC: r223800 - pmap_cache_remove() and pmap_protect_tte() are only used within pmap.c so static'ize them. - Correct a typo. Modified: stable/7/sys/sparc64/include/pmap.h stable/7/sys/sparc64/sparc64/pmap.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/include/pmap.h ============================================================================== --- stable/7/sys/sparc64/include/pmap.h Mon Jul 25 18:52:49 2011 (r224378) +++ stable/7/sys/sparc64/include/pmap.h Mon Jul 25 18:53:23 2011 (r224379) @@ -89,12 +89,9 @@ void pmap_kremove_flags(vm_offset_t va); boolean_t pmap_page_is_mapped(vm_page_t m); int pmap_cache_enter(vm_page_t m, vm_offset_t va); -void pmap_cache_remove(vm_page_t m, vm_offset_t va); int pmap_remove_tte(struct pmap *pm1, struct pmap *pm2, struct tte *tp, vm_offset_t va); -int pmap_protect_tte(struct pmap *pm1, struct pmap *pm2, struct tte *tp, - vm_offset_t va); void pmap_map_tsb(void); Modified: stable/7/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:52:49 2011 (r224378) +++ stable/7/sys/sparc64/sparc64/pmap.c Mon Jul 25 18:53:23 2011 (r224379) @@ -156,6 +156,10 @@ struct pmap kernel_pmap_store; */ static vm_paddr_t pmap_bootstrap_alloc(vm_size_t size, uint32_t colors); +static void pmap_cache_remove(vm_page_t m, vm_offset_t va); +static int pmap_protect_tte(struct pmap *pm1, struct pmap *pm2, + struct tte *tp, vm_offset_t va); + /* * Map the given physical page at the specified virtual address in the * target pmap with the protection requested. If specified the page @@ -819,7 +823,7 @@ pmap_cache_enter(vm_page_t m, vm_offset_ return (0); } -void +static void pmap_cache_remove(vm_page_t m, vm_offset_t va) { struct tte *tp; @@ -1282,7 +1286,7 @@ pmap_remove_all(vm_page_t m) vm_page_flag_clear(m, PG_WRITEABLE); } -int +static int pmap_protect_tte(struct pmap *pm, struct pmap *pm2, struct tte *tp, vm_offset_t va) { @@ -1819,7 +1823,7 @@ pmap_page_exists_quick(pmap_t pm, vm_pag /* * Remove all pages from specified address space, this aids process exit - * speeds. This is much faster than pmap_remove n the case of running down + * speeds. This is much faster than pmap_remove in the case of running down * an entire address space. Only works for the current pmap. */ void From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 18:54:30 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18DA71065777; Mon, 25 Jul 2011 18:54: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 085818FC1D; Mon, 25 Jul 2011 18:54: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 p6PIsTWU071951; Mon, 25 Jul 2011 18:54:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIsTJB071949; Mon, 25 Jul 2011 18:54:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251854.p6PIsTJB071949@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:54:29 +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: r224381 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:54:30 -0000 Author: marius Date: Mon Jul 25 18:54:29 2011 New Revision: 224381 URL: http://svn.freebsd.org/changeset/base/224381 Log: MFC: r223801 It can be useful to know which page still has mappings. Modified: stable/7/sys/sparc64/sparc64/vm_machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/vm_machdep.c Mon Jul 25 18:54:28 2011 (r224380) +++ stable/7/sys/sparc64/sparc64/vm_machdep.c Mon Jul 25 18:54:29 2011 (r224381) @@ -494,7 +494,7 @@ uma_small_alloc(uma_zone_t zone, int byt pa = VM_PAGE_TO_PHYS(m); if (dcache_color_ignore == 0 && m->md.color != DCACHE_COLOR(pa)) { KASSERT(m->md.colors[0] == 0 && m->md.colors[1] == 0, - ("uma_small_alloc: free page still has mappings!")); + ("uma_small_alloc: free page %p still has mappings!", m)); PMAP_STATS_INC(uma_nsmall_alloc_oc); m->md.color = DCACHE_COLOR(pa); dcache_page_inval(pa); From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 18:57:51 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AF0F106566B; Mon, 25 Jul 2011 18:57: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 19C9A8FC12; Mon, 25 Jul 2011 18:57: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 p6PIvokM072154; Mon, 25 Jul 2011 18:57:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIvoKM072150; Mon, 25 Jul 2011 18:57:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251857.p6PIvoKM072150@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:57: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: r224383 - stable/7/sys/dev/gem X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:57:51 -0000 Author: marius Date: Mon Jul 25 18:57:50 2011 New Revision: 224383 URL: http://svn.freebsd.org/changeset/base/224383 Log: MFC: r223944 According to the OpenSolaris source the PCI latency and the cache line size should be set for Sun ERI. Tested by: yongari Modified: stable/7/sys/dev/gem/if_gem.c stable/7/sys/dev/gem/if_gem_pci.c stable/7/sys/dev/gem/if_gemreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/gem/if_gem.c ============================================================================== --- stable/7/sys/dev/gem/if_gem.c Mon Jul 25 18:57:49 2011 (r224382) +++ stable/7/sys/dev/gem/if_gem.c Mon Jul 25 18:57:50 2011 (r224383) @@ -626,7 +626,9 @@ gem_reset(struct gem_softc *sc) gem_reset_tx(sc); /* Do a full reset. */ - GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX); + GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX | + (sc->sc_variant == GEM_SUN_ERI ? GEM_ERI_CACHE_LINE_SIZE << + GEM_RESET_CLSZ_SHFT : 0)); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, 0)) @@ -716,11 +718,12 @@ gem_reset_rx(struct gem_softc *sc) DELAY(5000); /* Reset the ERX. */ - GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX); + GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX | + (sc->sc_variant == GEM_SUN_ERI ? GEM_ERI_CACHE_LINE_SIZE << + GEM_RESET_CLSZ_SHFT : 0)); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, - 0)) { + if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX, 0)) { device_printf(sc->sc_dev, "cannot reset receiver\n"); return (1); } @@ -806,11 +809,12 @@ gem_reset_tx(struct gem_softc *sc) DELAY(5000); /* Finally, reset the ETX. */ - GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_TX); + GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_TX | + (sc->sc_variant == GEM_SUN_ERI ? GEM_ERI_CACHE_LINE_SIZE << + GEM_RESET_CLSZ_SHFT : 0)); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_RX | GEM_RESET_TX, - 0)) { + if (!GEM_BANK2_BITWAIT(sc, GEM_RESET, GEM_RESET_TX, 0)) { device_printf(sc->sc_dev, "cannot reset transmitter\n"); return (1); } Modified: stable/7/sys/dev/gem/if_gem_pci.c ============================================================================== --- stable/7/sys/dev/gem/if_gem_pci.c Mon Jul 25 18:57:49 2011 (r224382) +++ stable/7/sys/dev/gem/if_gem_pci.c Mon Jul 25 18:57:50 2011 (r224383) @@ -177,6 +177,10 @@ gem_pci_attach(device_t dev) if (pci_get_intpin(dev) == 0) pci_set_intpin(dev, 1); + /* Set the PCI latency timer for Sun ERIs. */ + if (sc->sc_variant == GEM_SUN_ERI) + pci_write_config(dev, PCIR_LATTIMER, GEM_ERI_LATENCY_TIMER, 1); + sc->sc_dev = dev; sc->sc_flags |= GEM_PCI; Modified: stable/7/sys/dev/gem/if_gemreg.h ============================================================================== --- stable/7/sys/dev/gem/if_gemreg.h Mon Jul 25 18:57:49 2011 (r224382) +++ stable/7/sys/dev/gem/if_gemreg.h Mon Jul 25 18:57:50 2011 (r224383) @@ -35,7 +35,7 @@ /* register definitions for Apple GMAC, Sun ERI and Sun GEM */ /* - * First bank: this registers live at the start of the PCI + * First bank: these registers live at the start of the PCI * mapping, and at the start of the second bank of the SBus * version. */ @@ -93,7 +93,7 @@ "b\x10MAC_CONTROL\0b\x11MIF\0b\x12IBERR\0\0" /* - * Second bank: this registers live at offset 0x1000 of the PCI + * Second bank: these registers live at offset 0x1000 of the PCI * mapping, and at the start of the first bank of the SBus * version. */ @@ -128,7 +128,7 @@ /* GEM_PCI_BIF_DIAG register bits */ #define GEN_PCI_BIF_DIAG_BC_SM 0x007f0000 /* burst ctrl. state machine */ -#define GEN_PCI_BIF_DIAG_SM 0xff000000 /* BIF state machine */ +#define GEN_PCI_BIF_DIAG_SM 0xff000000 /* BIF state machine */ /* Bits in GEM_SBUS_CONFIG register */ #define GEM_SBUS_CFG_BURST_32 0x00000001 /* 32 byte bursts */ @@ -147,6 +147,8 @@ #define GEM_RESET_TX 0x00000001 /* Reset TX half. */ #define GEM_RESET_RX 0x00000002 /* Reset RX half. */ #define GEM_RESET_PCI_RSTOUT 0x00000004 /* Force PCI RSTOUT#. */ +#define GEM_RESET_CLSZ_MASK 0x00ff0000 /* ERI cache line size */ +#define GEM_RESET_CLSZ_SHFT 16 /* The rest of the registers live in the first bank again. */ @@ -586,6 +588,10 @@ #define GEM_PHYAD_INTERNAL 1 #define GEM_PHYAD_EXTERNAL 0 +/* Miscellaneous */ +#define GEM_ERI_CACHE_LINE_SIZE 16 +#define GEM_ERI_LATENCY_TIMER 64 + /* * descriptor table structures */ @@ -594,7 +600,11 @@ struct gem_desc { uint64_t gd_addr; }; -/* Transmit flags */ +/* + * Transmit flags + * GEM_TD_CXSUM_ENABLE, GEM_TD_CXSUM_START, GEM_TD_CXSUM_STUFF and + * GEM_TD_INTERRUPT_ME only need to be set in the first descriptor of a group. + */ #define GEM_TD_BUFSIZE 0x0000000000007fffULL #define GEM_TD_CXSUM_START 0x00000000001f8000ULL /* Cxsum start offset */ #define GEM_TD_CXSUM_STARTSHFT 15 @@ -605,10 +615,6 @@ struct gem_desc { #define GEM_TD_START_OF_PACKET 0x0000000080000000ULL #define GEM_TD_INTERRUPT_ME 0x0000000100000000ULL /* Interrupt me now */ #define GEM_TD_NO_CRC 0x0000000200000000ULL /* do not insert crc */ -/* - * Only need to set GEM_TD_CXSUM_ENABLE, GEM_TD_CXSUM_STUFF, - * GEM_TD_CXSUM_START, and GEM_TD_INTERRUPT_ME in 1st descriptor of a group. - */ /* Receive flags */ #define GEM_RD_CHECKSUM 0x000000000000ffffULL /* is the complement */ @@ -618,7 +624,6 @@ struct gem_desc { #define GEM_RD_HASH_PASS 0x1000000000000000ULL /* passed hash filter */ #define GEM_RD_ALTERNATE_MAC 0x2000000000000000ULL /* Alternate MAC adrs */ #define GEM_RD_BAD_CRC 0x4000000000000000ULL - #define GEM_RD_BUFSHIFT 16 #define GEM_RD_BUFLEN(x) (((x) & GEM_RD_BUFSIZE) >> GEM_RD_BUFSHIFT) From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 18:59:44 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A657106566B; Mon, 25 Jul 2011 18:59:44 +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 29EA58FC16; Mon, 25 Jul 2011 18:59: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 p6PIxina072274; Mon, 25 Jul 2011 18:59:44 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PIxiN6072272; Mon, 25 Jul 2011 18:59:44 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251859.p6PIxiN6072272@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 18:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224384 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 18:59:44 -0000 Author: marius Date: Mon Jul 25 18:59:43 2011 New Revision: 224384 URL: http://svn.freebsd.org/changeset/base/224384 Log: MFC: r223959 - Add a missing shift in schizo_get_timecount(). This happened to be non-fatal as STX_CTRL_PERF_CNT_CNT0_SHIFT actually is zero, if we were using the second counter in the upper 32 bits this would be required though as the MI timecounter code doesn't support 64-bit counters/counter registers. - Remove a redundant NULL assignment from the timecounter initialization. Modified: stable/7/sys/sparc64/pci/schizo.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/schizo.c ============================================================================== --- stable/7/sys/sparc64/pci/schizo.c Mon Jul 25 18:57:50 2011 (r224383) +++ stable/7/sys/sparc64/pci/schizo.c Mon Jul 25 18:59:43 2011 (r224384) @@ -482,7 +482,6 @@ schizo_attach(device_t dev) if (tc == NULL) panic("%s: could not malloc timecounter", __func__); tc->tc_get_timecount = schizo_get_timecount; - tc->tc_poll_pps = NULL; tc->tc_counter_mask = STX_CTRL_PERF_CNT_MASK; if (OF_getprop(OF_peer(0), "clock-frequency", &prop, sizeof(prop)) == -1) @@ -1521,6 +1520,7 @@ schizo_get_timecount(struct timecounter struct schizo_softc *sc; sc = tc->tc_priv; - return (SCHIZO_CTRL_READ_8(sc, STX_CTRL_PERF_CNT) & - (STX_CTRL_PERF_CNT_MASK << STX_CTRL_PERF_CNT_CNT0_SHIFT)); + return ((SCHIZO_CTRL_READ_8(sc, STX_CTRL_PERF_CNT) & + (STX_CTRL_PERF_CNT_MASK << STX_CTRL_PERF_CNT_CNT0_SHIFT)) >> + STX_CTRL_PERF_CNT_CNT0_SHIFT); } From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 19:01:36 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7683D106566C; Mon, 25 Jul 2011 19:01:36 +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 428738FC0A; Mon, 25 Jul 2011 19:01: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 p6PJ1adA072464; Mon, 25 Jul 2011 19:01:36 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ1aW8072462; Mon, 25 Jul 2011 19:01:36 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251901.p6PJ1aW8072462@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:01:36 +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: r224386 - stable/7/sys/sparc64/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:01:36 -0000 Author: marius Date: Mon Jul 25 19:01:35 2011 New Revision: 224386 URL: http://svn.freebsd.org/changeset/base/224386 Log: MFC: r223960 - Current testing shows that (ab)using the JBC performance counter in bus cycle mode as timecounter just works fine. My best guess is that a firmware update has fixed this, so check at run-time whether it advances and use a positive quality if it does. The latter will cause this timecounter to be used instead of the tick counter based one, which just sucks for SMP. - Remove a redundant NULL assignment from the timecounter initialization. Modified: stable/7/sys/sparc64/pci/fire.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/pci/fire.c ============================================================================== --- stable/7/sys/sparc64/pci/fire.c Mon Jul 25 18:59:45 2011 (r224385) +++ stable/7/sys/sparc64/pci/fire.c Mon Jul 25 19:01:35 2011 (r224386) @@ -663,9 +663,7 @@ fire_attach(device_t dev) /* * Setup JBC/UBC performance counter 0 in bus cycle counting - * mode as timecounter. Unfortunately, at least with Fire all - * JBus-driven performance counters just don't advance in bus - * cycle counting mode. + * mode as timecounter. */ if (device_get_unit(dev) == 0) { FIRE_CTRL_SET(sc, FO_XBC_PRF_CNT0, 0); @@ -673,19 +671,10 @@ fire_attach(device_t dev) FIRE_CTRL_SET(sc, FO_XBC_PRF_CNT_SEL, (FO_XBC_PRF_CNT_NONE << FO_XBC_PRF_CNT_CNT1_SHFT) | (FO_XBC_PRF_CNT_XB_CLK << FO_XBC_PRF_CNT_CNT0_SHFT)); -#ifdef FIRE_DEBUG - device_printf(dev, "FO_XBC_PRF_CNT0 0x%016llx\n", - (long long unsigned)FIRE_CTRL_READ_8(sc, - FO_XBC_PRF_CNT0)); - device_printf(dev, "FO_XBC_PRF_CNT0 0x%016llx\n", - (long long unsigned)FIRE_CTRL_READ_8(sc, - FO_XBC_PRF_CNT0)); -#endif tc = malloc(sizeof(*tc), M_DEVBUF, M_NOWAIT | M_ZERO); if (tc == NULL) panic("%s: could not malloc timecounter", __func__); tc->tc_get_timecount = fire_get_timecount; - tc->tc_poll_pps = NULL; tc->tc_counter_mask = TC_COUNTER_MAX_MASK; if (OF_getprop(OF_peer(0), "clock-frequency", &prop, sizeof(prop)) == -1) @@ -693,8 +682,16 @@ fire_attach(device_t dev) __func__); tc->tc_frequency = prop; tc->tc_name = strdup(device_get_nameunit(dev), M_DEVBUF); - tc->tc_quality = -FIRE_PERF_CNT_QLTY; tc->tc_priv = sc; + /* + * Due to initial problems with the JBus-driven performance + * counters not advancing which might be firmware dependent + * ensure that it actually works. + */ + if (fire_get_timecount(tc) - fire_get_timecount(tc) != 0) + tc->tc_quality = FIRE_PERF_CNT_QLTY; + else + tc->tc_quality = -FIRE_PERF_CNT_QLTY; tc_init(tc); } From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 19:03:50 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EBF4106566B; Mon, 25 Jul 2011 19:03: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 7E0B18FC0C; Mon, 25 Jul 2011 19:03: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 p6PJ3o4Q072639; Mon, 25 Jul 2011 19:03:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ3oNg072637; Mon, 25 Jul 2011 19:03:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251903.p6PJ3oNg072637@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224389 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:03:50 -0000 Author: marius Date: Mon Jul 25 19:03:50 2011 New Revision: 224389 URL: http://svn.freebsd.org/changeset/base/224389 Log: MFC: r223961 - Remove redundant timecounter masking from counter_get_timecount(). - Zero the timecounter when allocation so we don't need to initialize unused members and remove a now redundant NULL assignment. Submitted by: jkim Modified: stable/7/sys/sparc64/sparc64/counter.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/counter.c ============================================================================== --- stable/7/sys/sparc64/sparc64/counter.c Mon Jul 25 19:03:45 2011 (r224388) +++ stable/7/sys/sparc64/sparc64/counter.c Mon Jul 25 19:03:50 2011 (r224389) @@ -86,13 +86,12 @@ sparc64_counter_init(const char *name, b bus_space_write_8(tag, handle, offset + CTR_CT1 + CTR_LIMIT, COUNTER_MASK); /* Register as a time counter. */ - tc = malloc(sizeof(*tc), M_DEVBUF, M_WAITOK); + tc = malloc(sizeof(*tc), M_DEVBUF, M_WAITOK | M_ZERO); sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK); sc->sc_tag = tag; sc->sc_handle = handle; sc->sc_offset = offset + CTR_CT0; tc->tc_get_timecount = counter_get_timecount; - tc->tc_poll_pps = NULL; tc->tc_counter_mask = COUNTER_MASK; tc->tc_frequency = COUNTER_FREQ; tc->tc_name = strdup(name, M_DEVBUF); @@ -107,6 +106,5 @@ counter_get_timecount(struct timecounter struct ct_softc *sc; sc = tc->tc_priv; - return (bus_space_read_8(sc->sc_tag, sc->sc_handle, sc->sc_offset) & - COUNTER_MASK); + return (bus_space_read_8(sc->sc_tag, sc->sc_handle, sc->sc_offset)); } From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 19:04:57 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71D01106566C; Mon, 25 Jul 2011 19:04: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 611F18FC0C; Mon, 25 Jul 2011 19:04: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 p6PJ4vFg072769; Mon, 25 Jul 2011 19:04:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ4vCj072767; Mon, 25 Jul 2011 19:04:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251904.p6PJ4vCj072767@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224391 - stable/7/sys/sparc64/sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:04:57 -0000 Author: marius Date: Mon Jul 25 19:04:57 2011 New Revision: 224391 URL: http://svn.freebsd.org/changeset/base/224391 Log: MFC: r223962 Remove NULL assignments which are redundant for static timecounters. Submitted by: jkim Modified: stable/7/sys/sparc64/sparc64/tick.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sparc64/sparc64/tick.c ============================================================================== --- stable/7/sys/sparc64/sparc64/tick.c Mon Jul 25 19:04:57 2011 (r224390) +++ stable/7/sys/sparc64/sparc64/tick.c Mon Jul 25 19:04:57 2011 (r224391) @@ -161,12 +161,10 @@ cpu_initclocks(void) * quality (S)TICK timers in the MP case. */ tick_tc.tc_get_timecount = tick_get_timecount_up; - tick_tc.tc_poll_pps = NULL; tick_tc.tc_counter_mask = ~0u; tick_tc.tc_frequency = clock; tick_tc.tc_name = "tick"; tick_tc.tc_quality = TICK_QUALITY_UP; - tick_tc.tc_priv = NULL; #ifdef SMP if (cpu_mp_probe()) { tick_tc.tc_get_timecount = tick_get_timecount_mp; @@ -176,12 +174,10 @@ cpu_initclocks(void) tc_init(&tick_tc); if (sclock != 0) { stick_tc.tc_get_timecount = stick_get_timecount_up; - stick_tc.tc_poll_pps = NULL; stick_tc.tc_counter_mask = ~0u; stick_tc.tc_frequency = sclock; stick_tc.tc_name = "stick"; stick_tc.tc_quality = TICK_QUALITY_UP; - stick_tc.tc_priv = NULL; #ifdef SMP if (cpu_mp_probe()) { stick_tc.tc_get_timecount = stick_get_timecount_mp; From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 19:06:30 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D0E61065672; Mon, 25 Jul 2011 19: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 635958FC0C; Mon, 25 Jul 2011 19: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 p6PJ6U8M072924; Mon, 25 Jul 2011 19:06:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJ6U8f072919; Mon, 25 Jul 2011 19:06:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251906.p6PJ6U8f072919@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224392 - stable/7/sys/dev/mpt X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:06:30 -0000 Author: marius Date: Mon Jul 25 19:06:30 2011 New Revision: 224392 URL: http://svn.freebsd.org/changeset/base/224392 Log: MFC: r223981 Remove extra empty lines. Modified: stable/7/sys/dev/mpt/mpt_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 19:04:57 2011 (r224391) +++ stable/7/sys/dev/mpt/mpt_pci.c Mon Jul 25 19:06:30 2011 (r224392) @@ -193,8 +193,6 @@ __FBSDID("$FreeBSD$"); #define PCIM_CMD_SERRESPEN 0x0100 #endif - - static int mpt_pci_probe(device_t); static int mpt_pci_attach(device_t); static void mpt_free_bus_resources(struct mpt_softc *mpt); @@ -362,7 +360,6 @@ mpt_set_options(struct mpt_softc *mpt) mpt->cfg_role = tval; mpt->do_cfg_role = 1; } - tval = 0; mpt->msi_enable = 0; if (resource_int_value(device_get_name(mpt->dev), @@ -372,7 +369,6 @@ mpt_set_options(struct mpt_softc *mpt) } #endif - static void mpt_link_peer(struct mpt_softc *mpt) { @@ -411,7 +407,6 @@ mpt_unlink_peer(struct mpt_softc *mpt) } } - static int mpt_pci_attach(device_t dev) { @@ -687,7 +682,6 @@ mpt_free_bus_resources(struct mpt_softc MPT_LOCK_DESTROY(mpt); } - /* * Disconnect ourselves from the system. */ @@ -712,7 +706,6 @@ mpt_pci_detach(device_t dev) return(0); } - /* * Disable the hardware */ @@ -808,8 +801,6 @@ mpt_dma_mem_alloc(struct mpt_softc *mpt) return (0); } - - /* Deallocate memory that was allocated by mpt_dma_mem_alloc */ static void @@ -832,8 +823,6 @@ mpt_dma_mem_free(struct mpt_softc *mpt) } - - /* Reads modifiable (via PCI transactions) config registers */ static void mpt_read_config_regs(struct mpt_softc *mpt) From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 19:11:30 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A89E1065672; Mon, 25 Jul 2011 19:11: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 49F5C8FC13; Mon, 25 Jul 2011 19:11: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 p6PJBUmq073187; Mon, 25 Jul 2011 19:11:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJBUW0073185; Mon, 25 Jul 2011 19:11:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251911.p6PJBUW0073185@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224395 - stable/7/sys/dev/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:11:30 -0000 Author: marius Date: Mon Jul 25 19:11:29 2011 New Revision: 224395 URL: http://svn.freebsd.org/changeset/base/224395 Log: MFC: r223984 PCIB_ALLOC_MSIX() may already fail on the first pass, f.e. when the PCI-PCI bridge is blacklisted. In that case just return from pci_alloc_msix_method(), otherwise we continue without a single MSI-X resource, causing subsequent attempts to use the seemingly available resource to fail or when booting verbose to NULL-dereference rle->start when trying to print the IRQ in pci_alloc_msix_method(). Reviewed by: jhb Modified: stable/7/sys/dev/pci/pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/pci/pci.c ============================================================================== --- stable/7/sys/dev/pci/pci.c Mon Jul 25 19:11:29 2011 (r224394) +++ stable/7/sys/dev/pci/pci.c Mon Jul 25 19:11:29 2011 (r224395) @@ -1243,8 +1243,11 @@ pci_alloc_msix_method(device_t dev, devi for (i = 0; i < max; i++) { /* Allocate a message. */ error = PCIB_ALLOC_MSIX(device_get_parent(dev), child, &irq); - if (error) + if (error) { + if (i == 0) + return (error); break; + } resource_list_add(&dinfo->resources, SYS_RES_IRQ, i + 1, irq, irq, 1); } From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 19:13:51 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0076106566C; Mon, 25 Jul 2011 19:13: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 8EF728FC12; Mon, 25 Jul 2011 19:13: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 p6PJDpdj073348; Mon, 25 Jul 2011 19:13:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PJDpkT073345; Mon, 25 Jul 2011 19:13:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107251913.p6PJDpkT073345@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 19:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224397 - stable/7/sys/dev/cas X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 19:13:51 -0000 Author: marius Date: Mon Jul 25 19:13:51 2011 New Revision: 224397 URL: http://svn.freebsd.org/changeset/base/224397 Log: MFC: r223986 - Expand the scope of the lock in the interrupt routine to close races with checking IFF_DRV_RUNNING and simplify the code. This also involves holding the driver lock in the rx_ch callout. - Just use ifp instead of sc->sc_ifp. Submitted by: jhb (mostly) Modified: stable/7/sys/dev/cas/if_cas.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/cas/if_cas.c ============================================================================== --- stable/7/sys/dev/cas/if_cas.c Mon Jul 25 19:13:51 2011 (r224396) +++ stable/7/sys/dev/cas/if_cas.c Mon Jul 25 19:13:51 2011 (r224397) @@ -203,7 +203,7 @@ cas_attach(struct cas_softc *sc) IFQ_SET_READY(&ifp->if_snd); callout_init_mtx(&sc->sc_tick_ch, &sc->sc_mtx, 0); - callout_init(&sc->sc_rx_ch, 1); + callout_init_mtx(&sc->sc_rx_ch, &sc->sc_mtx, 0); /* Create local taskq. */ TASK_INIT(&sc->sc_intr_task, 0, cas_intr_task, sc); TASK_INIT(&sc->sc_tx_task, 1, cas_tx_task, ifp); @@ -1597,7 +1597,7 @@ cas_rint_timeout(void *arg) { struct cas_softc *sc = arg; - CAS_LOCK_ASSERT(sc, MA_NOTOWNED); + CAS_LOCK_ASSERT(sc, MA_OWNED); cas_rint(sc); } @@ -1612,7 +1612,7 @@ cas_rint(struct cas_softc *sc) uint32_t rxhead; u_int idx, idx2, len, off, skip; - CAS_LOCK_ASSERT(sc, MA_NOTOWNED); + CAS_LOCK_ASSERT(sc, MA_OWNED); callout_stop(&sc->sc_rx_ch); @@ -1740,7 +1740,9 @@ cas_rint(struct cas_softc *sc) cas_rxcksum(m, CAS_GET(word4, CAS_RC4_TCP_CSUM)); /* Pass it on. */ + CAS_UNLOCK(sc); (*ifp->if_input)(ifp, m); + CAS_LOCK(sc); } else ifp->if_ierrors++; @@ -1836,7 +1838,9 @@ cas_rint(struct cas_softc *sc) cas_rxcksum(m, CAS_GET(word4, CAS_RC4_TCP_CSUM)); /* Pass it on. */ + CAS_UNLOCK(sc); (*ifp->if_input)(ifp, m); + CAS_LOCK(sc); } else ifp->if_ierrors++; @@ -1874,7 +1878,7 @@ cas_free(void *arg1, void *arg2) { struct cas_rxdsoft *rxds; struct cas_softc *sc; - u_int idx; + u_int idx, locked; #if __FreeBSD_version < 800016 rxds = arg2; @@ -1892,17 +1896,18 @@ cas_free(void *arg1, void *arg2) * NB: this function can be called via m_freem(9) within * this driver! */ - + if ((locked = CAS_LOCK_OWNED(sc)) == 0) + CAS_LOCK(sc); cas_add_rxdesc(sc, idx); + if (locked == 0) + CAS_UNLOCK(sc); } static inline void cas_add_rxdesc(struct cas_softc *sc, u_int idx) { - u_int locked; - if ((locked = CAS_LOCK_OWNED(sc)) == 0) - CAS_LOCK(sc); + CAS_LOCK_ASSERT(sc, MA_OWNED); bus_dmamap_sync(sc->sc_rdmatag, sc->sc_rxdsoft[idx].rxds_dmamap, BUS_DMASYNC_PREREAD); @@ -1920,9 +1925,6 @@ cas_add_rxdesc(struct cas_softc *sc, u_i CAS_WRITE_4(sc, CAS_RX_KICK, (sc->sc_rxdptr + CAS_NRXDESC - 4) & CAS_NRXDESC_MASK); } - - if (locked == 0) - CAS_UNLOCK(sc); } static void @@ -1930,7 +1932,7 @@ cas_eint(struct cas_softc *sc, u_int sta { struct ifnet *ifp = sc->sc_ifp; - CAS_LOCK_ASSERT(sc, MA_NOTOWNED); + CAS_LOCK_ASSERT(sc, MA_OWNED); ifp->if_ierrors++; @@ -1947,7 +1949,7 @@ cas_eint(struct cas_softc *sc, u_int sta printf("\n"); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - cas_init(sc); + cas_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(sc->sc_tq, &sc->sc_tx_task); } @@ -1984,6 +1986,7 @@ cas_intr_task(void *arg, int pending __u if (__predict_false((status & CAS_INTR_SUMMARY) == 0)) goto done; + CAS_LOCK(sc); #ifdef CAS_DEBUG CTR4(KTR_CAS, "%s: %s: cplt %x, status %x", device_get_name(sc->sc_dev), __func__, @@ -2023,6 +2026,7 @@ cas_intr_task(void *arg, int pending __u (CAS_INTR_TX_TAG_ERR | CAS_INTR_RX_TAG_ERR | CAS_INTR_RX_LEN_MMATCH | CAS_INTR_PCI_ERROR_INT)) != 0)) { cas_eint(sc, status); + CAS_UNLOCK(sc); return; } @@ -2030,7 +2034,7 @@ cas_intr_task(void *arg, int pending __u status2 = CAS_READ_4(sc, CAS_MAC_TX_STATUS); if ((status2 & (CAS_MAC_TX_UNDERRUN | CAS_MAC_TX_MAX_PKT_ERR)) != 0) - sc->sc_ifp->if_oerrors++; + ifp->if_oerrors++; else if ((status2 & ~CAS_MAC_TX_FRAME_XMTD) != 0) device_printf(sc->sc_dev, "MAC TX fault, status %x\n", status2); @@ -2039,7 +2043,7 @@ cas_intr_task(void *arg, int pending __u if (__predict_false(status & CAS_INTR_RX_MAC_INT)) { status2 = CAS_READ_4(sc, CAS_MAC_RX_STATUS); if ((status2 & CAS_MAC_RX_OVERFLOW) != 0) - sc->sc_ifp->if_ierrors++; + ifp->if_ierrors++; else if ((status2 & ~CAS_MAC_RX_FRAME_RCVD) != 0) device_printf(sc->sc_dev, "MAC RX fault, status %x\n", status2); @@ -2059,16 +2063,15 @@ cas_intr_task(void *arg, int pending __u } if ((status & - (CAS_INTR_TX_INT_ME | CAS_INTR_TX_ALL | CAS_INTR_TX_DONE)) != 0) { - CAS_LOCK(sc); + (CAS_INTR_TX_INT_ME | CAS_INTR_TX_ALL | CAS_INTR_TX_DONE)) != 0) cas_tint(sc); - CAS_UNLOCK(sc); - } - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + CAS_UNLOCK(sc); return; - else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + } else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) taskqueue_enqueue(sc->sc_tq, &sc->sc_tx_task); + CAS_UNLOCK(sc); status = CAS_READ_4(sc, CAS_STATUS_ALIAS); if (__predict_false((status & CAS_INTR_SUMMARY) != 0)) { @@ -2408,7 +2411,7 @@ cas_mii_statchg(device_t dev) v |= CAS_MAC_XIF_CONF_FDXLED; CAS_WRITE_4(sc, CAS_MAC_XIF_CONF, v); - if ((sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && (sc->sc_flags & CAS_LINK) != 0) { CAS_WRITE_4(sc, CAS_MAC_TX_CONF, txcfg | CAS_MAC_TX_CONF_EN); From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 20:13:35 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1471106566B; Mon, 25 Jul 2011 20:13:35 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C07BF8FC12; Mon, 25 Jul 2011 20:13: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 p6PKDZgf075400; Mon, 25 Jul 2011 20:13:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PKDZ48075398; Mon, 25 Jul 2011 20:13:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201107252013.p6PKDZ48075398@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 25 Jul 2011 20:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224402 - stable/7/sys/dev/gem X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 20:13:35 -0000 Author: yongari Date: Mon Jul 25 20:13:35 2011 New Revision: 224402 URL: http://svn.freebsd.org/changeset/base/224402 Log: MFC r224157: Revert r222135 by allowing controller reinitialization. Due to unknown reason Apple UniNorth2 gem(4) device required manual interface down/up operation after r222135. Even though this is not correct thing and I don't like to revert it but it would be better than breaking gem(4) on PPC. This should be revisited. PR: kern/157405 Modified: stable/7/sys/dev/gem/if_gem.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/gem/if_gem.c ============================================================================== --- stable/7/sys/dev/gem/if_gem.c Mon Jul 25 20:12:31 2011 (r224401) +++ stable/7/sys/dev/gem/if_gem.c Mon Jul 25 20:13:35 2011 (r224402) @@ -947,8 +947,10 @@ gem_init_locked(struct gem_softc *sc) GEM_LOCK_ASSERT(sc, MA_OWNED); +#ifdef notyet if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) return; +#endif #ifdef GEM_DEBUG CTR2(KTR_GEM, "%s: %s: calling stop", device_get_name(sc->sc_dev), From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 21:37:53 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06576106564A; Mon, 25 Jul 2011 21:37:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E96718FC0C; Mon, 25 Jul 2011 21:37:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PLbqQL077909; Mon, 25 Jul 2011 21:37:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PLbqd3077907; Mon, 25 Jul 2011 21:37:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107252137.p6PLbqd3077907@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 21:37:52 +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: r224403 - stable/7/sys/boot/common X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 21:37:53 -0000 Author: marius Date: Mon Jul 25 21:37:52 2011 New Revision: 224403 URL: http://svn.freebsd.org/changeset/base/224403 Log: MFC: r192972 (partial) Some of the boot loader code only works on a ufs file system, but it uses the generic struct dirent, which happens to look identical to UFS's struct direct. If BSD ever changes dirent then this will be a problem. Submitted by: matthew dot fleming at isilon dot com Modified: stable/7/sys/boot/common/ufsread.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/ufsread.c ============================================================================== --- stable/7/sys/boot/common/ufsread.c Mon Jul 25 20:13:35 2011 (r224402) +++ stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:37:52 2011 (r224403) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #ifdef UFS_SMALL_CGBASE /* XXX: Revert to old (broken for over 1.5Tb filesystems) version of cgbase @@ -93,7 +94,7 @@ static __inline int fsfind(const char *name, ino_t * ino) { char buf[DEV_BSIZE]; - struct dirent *d; + struct direct *d; char *s; ssize_t n; @@ -104,7 +105,7 @@ fsfind(const char *name, ino_t * ino) if (ls) printf("%s ", d->d_name); else if (!strcmp(name, d->d_name)) { - *ino = d->d_fileno; + *ino = d->d_ino; return d->d_type; } s += d->d_reclen; From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 21:39:09 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76CA51065670; Mon, 25 Jul 2011 21:39: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 661FA8FC17; Mon, 25 Jul 2011 21:39: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 p6PLd9DS078002; Mon, 25 Jul 2011 21:39:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PLd9jq078000; Mon, 25 Jul 2011 21:39:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107252139.p6PLd9jq078000@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 21:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224404 - stable/7/sys/boot/common X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 21:39:09 -0000 Author: marius Date: Mon Jul 25 21:39:09 2011 New Revision: 224404 URL: http://svn.freebsd.org/changeset/base/224404 Log: MFC: r211747 Replace structure assignments with explicity memcpy calls. This allows Clang to compile this file: it was using the builtin memcpy and we want to use the memcpy defined in gptboot.c. (Clang can't compile boot2 yet). Submitted by: Dimitry Andric Reviewed by: jhb Modified: stable/7/sys/boot/common/ufsread.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/ufsread.c ============================================================================== --- stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:37:52 2011 (r224403) +++ stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:39:09 2011 (r224404) @@ -223,14 +223,19 @@ fsread(ino_t inode, void *buf, size_t nb return -1; n = INO_TO_VBO(n, inode); #if defined(UFS1_ONLY) - dp1 = ((struct ufs1_dinode *)blkbuf)[n]; + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); #elif defined(UFS2_ONLY) - dp2 = ((struct ufs2_dinode *)blkbuf)[n]; + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); #else if (fs->fs_magic == FS_UFS1_MAGIC) - dp1 = ((struct ufs1_dinode *)blkbuf)[n]; + memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, + sizeof(struct ufs1_dinode)); else - dp2 = ((struct ufs2_dinode *)blkbuf)[n]; + memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, + sizeof(struct ufs2_dinode)); + #endif inomap = inode; fs_off = 0; From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 21:41:46 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 905011065670; Mon, 25 Jul 2011 21:41:46 +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 662CF8FC18; Mon, 25 Jul 2011 21:41:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PLfkKn078187; Mon, 25 Jul 2011 21:41:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PLfkqt078184; Mon, 25 Jul 2011 21:41:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107252141.p6PLfkqt078184@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 21:41:46 +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: r224405 - in stable/7/sys/boot: common i386/boot2 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 21:41:46 -0000 Author: marius Date: Mon Jul 25 21:41:46 2011 New Revision: 224405 URL: http://svn.freebsd.org/changeset/base/224405 Log: MFC: r218713, r218716 Apply a few small optimizations to boot2's code, to make it shrink a little further. This gets us further on the way to be able to build it successfully with clang. Using in-tree gcc, this shrinks boot2.bin with 60 bytes, the in-tree clang shaves off 72 bytes, and ToT clang 84 bytes. Submitted by: rdivacky Reviewed by: imp Modified: stable/7/sys/boot/common/ufsread.c stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/ufsread.c ============================================================================== --- stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:39:09 2011 (r224404) +++ stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:41:46 2011 (r224405) @@ -122,7 +122,7 @@ lookup(const char *path) const char *s; ino_t ino; ssize_t n; - int dt; + uint8_t dt; ino = ROOTINO; dt = DT_DIR; Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Mon Jul 25 21:39:09 2011 (r224404) +++ stable/7/sys/boot/i386/boot2/boot2.c Mon Jul 25 21:41:46 2011 (r224405) @@ -132,7 +132,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512]; static char kname[1024]; -static uint32_t opts; +static uint16_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -233,7 +233,7 @@ putc(int c) int main(void) { - int autoboot; + uint8_t autoboot; ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -320,7 +320,8 @@ load(void) caddr_t p; ino_t ino; uint32_t addr, x; - int fmt, i, j; + int i, j; + uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) From owner-svn-src-stable-7@FreeBSD.ORG Mon Jul 25 23:01:08 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88CE1106564A; Mon, 25 Jul 2011 23:01:08 +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 76B858FC0A; Mon, 25 Jul 2011 23:01:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PN18tM080863; Mon, 25 Jul 2011 23:01:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PN18tF080861; Mon, 25 Jul 2011 23:01:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107252301.p6PN18tF080861@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 23:01:08 +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: r224410 - stable/7/sys/boot/common X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 23:01:08 -0000 Author: marius Date: Mon Jul 25 23:01:08 2011 New Revision: 224410 URL: http://svn.freebsd.org/changeset/base/224410 Log: MFC: r223938 Since r219452 the alignment of __dmadat has changed, revealing that fsread() bogusly casts its contents around causing alignment faults on sparc64 and most likely also on at least powerpc. Fix this by copying the contents bytewise instead as partly already done here. Solving this the right way costs some space, i.e. 148 bytes with GCC and 16 bytes with clang on x86 there are still some bytes left there though, and an acceptable hack which tricks the compiler into only using a 2-byte alignment instead of the native one when accessing the contents turned out to even take up more space that. Modified: stable/7/sys/boot/common/ufsread.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/ufsread.c ============================================================================== --- stable/7/sys/boot/common/ufsread.c Mon Jul 25 21:58:39 2011 (r224409) +++ stable/7/sys/boot/common/ufsread.c Mon Jul 25 23:01:08 2011 (r224410) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include + #ifdef UFS_SMALL_CGBASE /* XXX: Revert to old (broken for over 1.5Tb filesystems) version of cgbase (see sys/ufs/ffs/fs.h rev 1.39) so that small boot loaders (e.g. boot2) can @@ -90,7 +91,7 @@ static ssize_t fsread(ino_t, void *, siz static int ls, dsk_meta; static uint32_t fs_off; -static __inline int +static __inline uint8_t fsfind(const char *name, ino_t * ino) { char buf[DEV_BSIZE]; @@ -160,7 +161,7 @@ static int sblock_try[] = SBLOCKSEARCH; #elif defined(UFS1_ONLY) #define DIP(field) dp1.field #else -#define DIP(field) fs->fs_magic == FS_UFS1_MAGIC ? dp1.field : dp2.field +#define DIP(field) fs.fs_magic == FS_UFS1_MAGIC ? dp1.field : dp2.field #endif static ssize_t @@ -175,7 +176,7 @@ fsread(ino_t inode, void *buf, size_t nb static ino_t inomap; char *blkbuf; void *indbuf; - struct fs *fs; + struct fs fs; char *s; size_t n, nb, size, off, vboff; ufs_lbn_t lbn; @@ -183,30 +184,29 @@ fsread(ino_t inode, void *buf, size_t nb static ufs2_daddr_t blkmap, indmap; u_int u; - blkbuf = dmadat->blkbuf; indbuf = dmadat->indbuf; - fs = (struct fs *)dmadat->sbbuf; if (!dsk_meta) { inomap = 0; for (n = 0; sblock_try[n] != -1; n++) { - if (dskread(fs, sblock_try[n] / DEV_BSIZE, + if (dskread(dmadat->sbbuf, sblock_try[n] / DEV_BSIZE, SBLOCKSIZE / DEV_BSIZE)) return -1; + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); if (( #if defined(UFS1_ONLY) - fs->fs_magic == FS_UFS1_MAGIC + fs.fs_magic == FS_UFS1_MAGIC #elif defined(UFS2_ONLY) - (fs->fs_magic == FS_UFS2_MAGIC && - fs->fs_sblockloc == sblock_try[n]) + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) #else - fs->fs_magic == FS_UFS1_MAGIC || - (fs->fs_magic == FS_UFS2_MAGIC && - fs->fs_sblockloc == sblock_try[n]) + fs.fs_magic == FS_UFS1_MAGIC || + (fs.fs_magic == FS_UFS2_MAGIC && + fs.fs_sblockloc == sblock_try[n]) #endif ) && - fs->fs_bsize <= MAXBSIZE && - fs->fs_bsize >= sizeof(struct fs)) + fs.fs_bsize <= MAXBSIZE && + fs.fs_bsize >= sizeof(struct fs)) break; } if (sblock_try[n] == -1) { @@ -214,12 +214,13 @@ fsread(ino_t inode, void *buf, size_t nb return -1; } dsk_meta++; - } + } else + memcpy(&fs, dmadat->sbbuf, sizeof(struct fs)); if (!inode) return 0; if (inomap != inode) { - n = IPERVBLK(fs); - if (dskread(blkbuf, INO_TO_VBA(fs, n, inode), DBPERVBLK)) + n = IPERVBLK(&fs); + if (dskread(blkbuf, INO_TO_VBA(&fs, n, inode), DBPERVBLK)) return -1; n = INO_TO_VBO(n, inode); #if defined(UFS1_ONLY) @@ -229,13 +230,12 @@ fsread(ino_t inode, void *buf, size_t nb memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, sizeof(struct ufs2_dinode)); #else - if (fs->fs_magic == FS_UFS1_MAGIC) + if (fs.fs_magic == FS_UFS1_MAGIC) memcpy(&dp1, (struct ufs1_dinode *)blkbuf + n, sizeof(struct ufs1_dinode)); else memcpy(&dp2, (struct ufs2_dinode *)blkbuf + n, sizeof(struct ufs2_dinode)); - #endif inomap = inode; fs_off = 0; @@ -248,15 +248,15 @@ fsread(ino_t inode, void *buf, size_t nb nbyte = n; nb = nbyte; while (nb) { - lbn = lblkno(fs, fs_off); - off = blkoff(fs, fs_off); + lbn = lblkno(&fs, fs_off); + off = blkoff(&fs, fs_off); if (lbn < NDADDR) { addr = DIP(di_db[lbn]); - } else if (lbn < NDADDR + NINDIR(fs)) { - n = INDIRPERVBLK(fs); + } else if (lbn < NDADDR + NINDIR(&fs)) { + n = INDIRPERVBLK(&fs); addr = DIP(di_ib[0]); u = (u_int)(lbn - NDADDR) / n * DBPERVBLK; - vbaddr = fsbtodb(fs, addr) + u; + vbaddr = fsbtodb(&fs, addr) + u; if (indmap != vbaddr) { if (dskread(indbuf, vbaddr, DBPERVBLK)) return -1; @@ -264,21 +264,25 @@ fsread(ino_t inode, void *buf, size_t nb } n = (lbn - NDADDR) & (n - 1); #if defined(UFS1_ONLY) - addr = ((ufs1_daddr_t *)indbuf)[n]; + memcpy(&addr, (ufs1_daddr_t *)indbuf + n, + sizeof(ufs1_daddr_t)); #elif defined(UFS2_ONLY) - addr = ((ufs2_daddr_t *)indbuf)[n]; + memcpy(&addr, (ufs2_daddr_t *)indbuf + n, + sizeof(ufs2_daddr_t)); #else - if (fs->fs_magic == FS_UFS1_MAGIC) - addr = ((ufs1_daddr_t *)indbuf)[n]; + if (fs.fs_magic == FS_UFS1_MAGIC) + memcpy(&addr, (ufs1_daddr_t *)indbuf + n, + sizeof(ufs1_daddr_t)); else - addr = ((ufs2_daddr_t *)indbuf)[n]; + memcpy(&addr, (ufs2_daddr_t *)indbuf + n, + sizeof(ufs2_daddr_t)); #endif } else { return -1; } - vbaddr = fsbtodb(fs, addr) + (off >> VBLKSHIFT) * DBPERVBLK; + vbaddr = fsbtodb(&fs, addr) + (off >> VBLKSHIFT) * DBPERVBLK; vboff = off & VBLKMASK; - n = sblksize(fs, size, lbn) - (off & ~VBLKMASK); + n = sblksize(&fs, size, lbn) - (off & ~VBLKMASK); if (n > VBLKSIZE) n = VBLKSIZE; if (blkmap != vbaddr) { From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 12:57:22 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA3361065676; Tue, 26 Jul 2011 12:57:22 +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 887B48FC18; Tue, 26 Jul 2011 12:57:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QCvMZC008477; Tue, 26 Jul 2011 12:57:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QCvMhI008475; Tue, 26 Jul 2011 12:57:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261257.p6QCvMhI008475@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 12:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224416 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 12:57:23 -0000 Author: marius Date: Tue Jul 26 12:57:22 2011 New Revision: 224416 URL: http://svn.freebsd.org/changeset/base/224416 Log: MFC: r212064, r212098 Use a cleaner expression to retrieve the memory size in pc98's boot2.c, which also avoids NULL pointer arithmetic, as suggested by jhb. The available space goes from 11 bytes to 7. Reviewed by: nyan Approved by: rpaulo (mentor) Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 10:50:33 2011 (r224415) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:57:22 2011 (r224416) @@ -187,9 +187,8 @@ xfsread(ino_t inode, void *buf, size_t n static inline uint32_t memsize(void) { - u_char *p = (u_char *)PTOV(0); - - return *(p + 0x401) * 128 * 1024 + *(u_int16_t *)(p + 0x594) * 1024 * 1024; + return (*(u_char *)PTOV(0x401) * 128 * 1024 + + *(uint16_t *)PTOV(0x594) * 1024 * 1024); } static inline void From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 12:58:30 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B50E106567D; Tue, 26 Jul 2011 12:58: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 428A98FC21; Tue, 26 Jul 2011 12:58: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 p6QCwUos008635; Tue, 26 Jul 2011 12:58:30 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QCwUJk008633; Tue, 26 Jul 2011 12:58:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261258.p6QCwUJk008633@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 12:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224419 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 12:58:30 -0000 Author: marius Date: Tue Jul 26 12:58:29 2011 New Revision: 224419 URL: http://svn.freebsd.org/changeset/base/224419 Log: MFC: r214257 MFi386: revision 214210 Avoid using memcpy() for copying 32bit chunks. This shrinks the resulting code a little. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:58:29 2011 (r224418) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:58:29 2011 (r224419) @@ -485,7 +485,7 @@ load(void) return; p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); bootinfo.bi_symtab = VTOP(p); - memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms)); + *(uint32_t*)p = hdr.ex.a_syms; p += sizeof(hdr.ex.a_syms); if (hdr.ex.a_syms) { if (xfsread(ino, p, hdr.ex.a_syms)) @@ -522,7 +522,7 @@ load(void) if (xfsread(ino, &es, sizeof(es))) return; for (i = 0; i < 2; i++) { - memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size)); + *(Elf32_Word *)p = es[i].sh_size; p += sizeof(es[i].sh_size); fs_off = es[i].sh_offset; if (xfsread(ino, p, es[i].sh_size)) From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 13:01:14 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B9DB1065673; Tue, 26 Jul 2011 13:01: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 5AC778FC12; Tue, 26 Jul 2011 13:01: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 p6QD1E4M008853; Tue, 26 Jul 2011 13:01:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QD1EVl008850; Tue, 26 Jul 2011 13:01:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261301.p6QD1EVl008850@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:01:14 +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: r224420 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:01:14 -0000 Author: marius Date: Tue Jul 26 13:01:14 2011 New Revision: 224420 URL: http://svn.freebsd.org/changeset/base/224420 Log: MFC: r218737, r218946 MFi386: revision 218713 Apply a few small optimizations to boot2's code, to make it shrink a little further. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 12:58:29 2011 (r224419) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:01:14 2011 (r224420) @@ -360,7 +360,7 @@ main(void) #ifdef GET_BIOSGEOM int i; #endif - int autoboot; + uint8_t autoboot; ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -457,7 +457,8 @@ load(void) caddr_t p; ino_t ino; uint32_t addr, x; - int fmt, i, j; + int i, j; + uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 13:04:48 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E3B5106566C; Tue, 26 Jul 2011 13:04:48 +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 4D2FE8FC0A; Tue, 26 Jul 2011 13:04: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 p6QD4mrE009063; Tue, 26 Jul 2011 13:04:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QD4mB6009061; Tue, 26 Jul 2011 13:04:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261304.p6QD4mB6009061@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:04:48 +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: r224423 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:04:48 -0000 Author: marius Date: Tue Jul 26 13:04:48 2011 New Revision: 224423 URL: http://svn.freebsd.org/changeset/base/224423 Log: MFC: r218842 MFi386: revision 218745 Remove reading of symbols from a.out loaded files. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:04:43 2011 (r224422) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:04:48 2011 (r224423) @@ -484,23 +484,6 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - *(uint32_t*)p = hdr.ex.a_syms; - p += sizeof(hdr.ex.a_syms); - if (hdr.ex.a_syms) { - if (xfsread(ino, p, hdr.ex.a_syms)) - return; - p += hdr.ex.a_syms; - if (xfsread(ino, p, sizeof(int))) - return; - x = *(uint32_t *)p; - p += sizeof(int); - x -= sizeof(int); - if (xfsread(ino, p, x)) - return; - p += x; - } } else { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { @@ -532,8 +515,8 @@ load(void) } } addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); } - bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.daua; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 13:06:20 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAA42106564A; Tue, 26 Jul 2011 13:06:20 +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 9FF5D8FC1B; Tue, 26 Jul 2011 13:06:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QD6KYm009180; Tue, 26 Jul 2011 13:06:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QD6KNC009178; Tue, 26 Jul 2011 13:06:20 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261306.p6QD6KNC009178@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:06:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224424 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:06:20 -0000 Author: marius Date: Tue Jul 26 13:06:20 2011 New Revision: 224424 URL: http://svn.freebsd.org/changeset/base/224424 Log: MFC: r219225 MFi386: revision 219186 This patch shrinks boot2 a little. o It switches kname to be just a pointer instead of an array. o It changes ioctl to unsigned from uint8_t. o It changes the second keyhit limit to 3 seconds from 5. o It removes bi_basemem/bi_extmem/bi_memsizes_valid setting. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:04:48 2011 (r224423) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:06:20 2011 (r224424) @@ -133,11 +133,11 @@ static struct dsk { unsigned start; } dsk; static char cmd[512], cmddup[512]; -static char kname[1024]; +static const char *kname = NULL; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static uint8_t ioctrl = IO_KEYBOARD; +static unsigned ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -146,7 +146,6 @@ static int xfsread(ino_t, void *, size_t static int dskread(void *, unsigned, unsigned); static void printf(const char *,...); static void putchar(int); -static uint32_t memsize(void); static int drvread(void *, unsigned); static int keyhit(unsigned); static int xputc(int); @@ -184,13 +183,6 @@ xfsread(ino_t inode, void *buf, size_t n return 0; } -static inline uint32_t -memsize(void) -{ - return (*(u_char *)PTOV(0x401) * 128 * 1024 + - *(uint16_t *)PTOV(0x594) * 1024 * 1024); -} - static inline void getstr(void) { @@ -382,9 +374,6 @@ main(void) #endif bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ - bootinfo.bi_extmem = memsize(); - bootinfo.bi_memsizes_valid++; /* Process configuration file */ @@ -408,11 +397,11 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ - if (autoboot && !*kname) { - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + if (autoboot && !kname) { + kname = PATH_BOOT3; if (!keyhit(3*SECOND)) { load(); - memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); + kname = PATH_KERNEL; } } @@ -427,7 +416,7 @@ main(void) 'a' + dsk.part, kname); if (ioctrl & IO_SERIAL) sio_flush(); - if (!autoboot || keyhit(5*SECOND)) + if (!autoboot || keyhit(3*SECOND)) getstr(); else if (!autoboot || !OPT_CHECK(RBX_QUIET)) putchar('\n'); @@ -611,11 +600,7 @@ parse() dsk.daua = dsk.disk | dsk.unit; dsk_meta = 0; } - if ((i = ep - arg)) { - if ((size_t)i >= sizeof(kname)) - return -1; - memcpy(kname, arg, i + 1); - } + kname = arg; } arg = p; } From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 13:12:08 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4854106566B; Tue, 26 Jul 2011 13:12:08 +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 7A11F8FC16; Tue, 26 Jul 2011 13:12: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 p6QDC8Z3009486; Tue, 26 Jul 2011 13:12:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDC8AO009484; Tue, 26 Jul 2011 13:12:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261312.p6QDC8AO009484@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:12:08 +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: r224426 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:12:08 -0000 Author: marius Date: Tue Jul 26 13:12:08 2011 New Revision: 224426 URL: http://svn.freebsd.org/changeset/base/224426 Log: MFC: r219960 MFi386: the part of 219452 - bunch of variables are turned into uint8_t. - the setting and reading of "fmt" in load() is removed. - buf in printf() is made static to save space. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:06:21 2011 (r224425) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:12:08 2011 (r224426) @@ -137,7 +137,7 @@ static const char *kname = NULL; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static unsigned ioctrl = IO_KEYBOARD; +static uint8_t ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -445,9 +445,8 @@ load(void) static Elf32_Shdr es[2]; caddr_t p; ino_t ino; - uint32_t addr, x; + uint32_t addr; int i, j; - uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) @@ -456,15 +455,8 @@ load(void) } if (xfsread(ino, &hdr, sizeof(hdr))) return; - if (N_GETMAGIC(hdr.ex) == ZMAGIC) - fmt = 0; - else if (IS_ELF(hdr.eh)) - fmt = 1; - else { - printf("Invalid %s\n", "format"); - return; - } - if (fmt == 0) { + + if (N_GETMAGIC(hdr.ex) == ZMAGIC) { addr = hdr.ex.a_entry & 0xffffff; p = PTOV(addr); fs_off = PAGE_SIZE; @@ -473,7 +465,7 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - } else { + } else if (IS_ELF(hdr.eh)) { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { if (xfsread(ino, ep + j, sizeof(ep[0]))) @@ -505,7 +497,11 @@ load(void) } addr = hdr.eh.e_entry & 0xffffff; bootinfo.bi_esymtab = VTOP(p); + } else { + printf("Invalid %s\n", "format"); + return; } + bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.daua; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), @@ -672,7 +668,7 @@ static void printf(const char *fmt,...) { va_list ap; - char buf[10]; + static char buf[10]; char *s; unsigned u; int c; From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 13:13:32 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45A971065678; Tue, 26 Jul 2011 13:13:32 +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 34CC18FC13; Tue, 26 Jul 2011 13:13:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDDW4J009658; Tue, 26 Jul 2011 13:13:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDDWJ8009656; Tue, 26 Jul 2011 13:13:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261313.p6QDDWJ8009656@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224429 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:13:32 -0000 Author: marius Date: Tue Jul 26 13:13:31 2011 New Revision: 224429 URL: http://svn.freebsd.org/changeset/base/224429 Log: MFC: r220685 MFi386: revisions 220389 and 220392 - Mark getc() as inline, this has no effect on gcc but helps clang. - Move getc() body before xgetc() so gcc does not emit a warning about function having no body. Modified: stable/7/sys/boot/pc98/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:13:31 2011 (r224428) +++ stable/7/sys/boot/pc98/boot2/boot2.c Tue Jul 26 13:13:31 2011 (r224429) @@ -150,7 +150,7 @@ static int drvread(void *, unsigned); static int keyhit(unsigned); static int xputc(int); static int xgetc(int); -static int getc(int); +static inline int getc(int); static void memcpy(void *, const void *, int); static void @@ -779,6 +779,18 @@ xputc(int c) } static int +getc(int fn) +{ + v86.addr = 0x18; + v86.eax = fn << 8; + v86int(); + if (fn) + return (v86.ebx >> 8) & 0x01; + else + return v86.eax & 0xff; +} + +static int xgetc(int fn) { if (OPT_CHECK(RBX_NOINTR)) @@ -792,15 +804,3 @@ xgetc(int fn) return 0; } } - -static int -getc(int fn) -{ - v86.addr = 0x18; - v86.eax = fn << 8; - v86int(); - if (fn) - return (v86.ebx >> 8) & 0x01; - else - return v86.eax & 0xff; -} From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 13:19:58 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD87A1065677; Tue, 26 Jul 2011 13:19:58 +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 845EC8FC1B; Tue, 26 Jul 2011 13:19: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 p6QDJvqK009950; Tue, 26 Jul 2011 13:19:57 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDJvPR009948; Tue, 26 Jul 2011 13:19:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261319.p6QDJvPR009948@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:19:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224430 - stable/7/sys/boot/i386/boot2 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:20:02 -0000 Author: marius Date: Tue Jul 26 13:19:57 2011 New Revision: 224430 URL: http://svn.freebsd.org/changeset/base/224430 Log: MFC: r214210 Avoid using memcpy() for copying 32bit chunks. This shrinks the resulting code a little. Approved by: rpaulo (mentor) Reviewed by: jhb Modified: stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:13:31 2011 (r224429) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:19:57 2011 (r224430) @@ -349,7 +349,7 @@ load(void) return; p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); bootinfo.bi_symtab = VTOP(p); - memcpy(p, &hdr.ex.a_syms, sizeof(hdr.ex.a_syms)); + *(uint32_t*)p = hdr.ex.a_syms; p += sizeof(hdr.ex.a_syms); if (hdr.ex.a_syms) { if (xfsread(ino, p, hdr.ex.a_syms)) @@ -386,7 +386,7 @@ load(void) if (xfsread(ino, &es, sizeof(es))) return; for (i = 0; i < 2; i++) { - memcpy(p, &es[i].sh_size, sizeof(es[i].sh_size)); + *(Elf32_Word *)p = es[i].sh_size; p += sizeof(es[i].sh_size); fs_off = es[i].sh_offset; if (xfsread(ino, p, es[i].sh_size)) From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 13:22:13 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A97CC1065670; Tue, 26 Jul 2011 13:22:13 +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 7F3438FC14; Tue, 26 Jul 2011 13:22: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 p6QDMDDA010139; Tue, 26 Jul 2011 13:22:13 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDMD3O010137; Tue, 26 Jul 2011 13:22:13 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261322.p6QDMD3O010137@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224433 - stable/7/sys/boot/i386/boot2 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:22:13 -0000 Author: marius Date: Tue Jul 26 13:22:13 2011 New Revision: 224433 URL: http://svn.freebsd.org/changeset/base/224433 Log: MFC: r218745 Remove reading of symbols from a.out loaded files. Since we are tight on space for clang and a.out support is only needed for /boot/loader, they are excess bytes that serve no useful purpose other than to support really old kernels (FreeBSD < 3.2 or so). Prefer clang support over support for these old kernels and remove this code. We gain about 100 bytes of space this way. Reviewed by: rdivacky@ Modified: stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:22:12 2011 (r224432) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:22:13 2011 (r224433) @@ -347,23 +347,6 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - p += hdr.ex.a_data + roundup2(hdr.ex.a_bss, PAGE_SIZE); - bootinfo.bi_symtab = VTOP(p); - *(uint32_t*)p = hdr.ex.a_syms; - p += sizeof(hdr.ex.a_syms); - if (hdr.ex.a_syms) { - if (xfsread(ino, p, hdr.ex.a_syms)) - return; - p += hdr.ex.a_syms; - if (xfsread(ino, p, sizeof(int))) - return; - x = *(uint32_t *)p; - p += sizeof(int); - x -= sizeof(int); - if (xfsread(ino, p, x)) - return; - p += x; - } } else { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { @@ -395,8 +378,8 @@ load(void) } } addr = hdr.eh.e_entry & 0xffffff; + bootinfo.bi_esymtab = VTOP(p); } - bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.drive; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 13:23:26 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FDBA1065673; Tue, 26 Jul 2011 13:23:26 +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 5F1FE8FC27; Tue, 26 Jul 2011 13:23:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDNQCf010282; Tue, 26 Jul 2011 13:23:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDNQQr010280; Tue, 26 Jul 2011 13:23:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261323.p6QDNQQr010280@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224435 - stable/7/sys/boot/i386/boot2 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:23:26 -0000 Author: marius Date: Tue Jul 26 13:23:26 2011 New Revision: 224435 URL: http://svn.freebsd.org/changeset/base/224435 Log: MFC: r218926 In sys/boot/i386/boot2/boot2.c, change the type of the 'opts' variable from uint16_t back to uint32_t. The actual option bitmasks (RB_* and RBX_*) assume at least a 32 bit variable. Submitted by: rdivacky Modified: stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:23:25 2011 (r224434) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:23:26 2011 (r224435) @@ -132,7 +132,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512]; static char kname[1024]; -static uint16_t opts; +static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 13:24:52 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84B76106566C; Tue, 26 Jul 2011 13:24:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 73B468FC13; Tue, 26 Jul 2011 13:24:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QDOqox010414; Tue, 26 Jul 2011 13:24:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDOqKC010412; Tue, 26 Jul 2011 13:24:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261324.p6QDOqKC010412@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:24:52 +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: r224436 - stable/7/sys/boot/i386/boot2 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:24:52 -0000 Author: marius Date: Tue Jul 26 13:24:52 2011 New Revision: 224436 URL: http://svn.freebsd.org/changeset/base/224436 Log: MFC: r219186 This patch shrinks boot2 a little. o It switches kname to be just a pointer instead of an array thus avoiding a couple of memcpy()s. o It changes ioctl to unsigned from uint8_t. o It changes the second keyhit limit to 3 seconds from 5 so that constant propagation can take place. o It changes the ticks overflow computation as suggested by bde@. o It removes bi_basemem/bi_extmem/bi_memsizes_valid setting from bootinfo as it is unused. Reviewed by: jhb Modified: stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:23:26 2011 (r224435) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:24:52 2011 (r224436) @@ -131,11 +131,11 @@ static struct dsk { int init; } dsk; static char cmd[512], cmddup[512]; -static char kname[1024]; +static const char *kname = NULL; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static uint8_t ioctrl = IO_KEYBOARD; +static unsigned ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -144,7 +144,6 @@ static int xfsread(ino_t, void *, size_t static int dskread(void *, unsigned, unsigned); static void printf(const char *,...); static void putchar(int); -static uint32_t memsize(void); static int drvread(void *, unsigned, unsigned); static int keyhit(unsigned); static int xputc(int); @@ -182,15 +181,6 @@ xfsread(ino_t inode, void *buf, size_t n return 0; } -static inline uint32_t -memsize(void) -{ - v86.addr = MEM_EXT; - v86.eax = 0x8800; - v86int(); - return v86.eax; -} - static inline void getstr(void) { @@ -245,9 +235,6 @@ main(void) dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ - bootinfo.bi_extmem = memsize(); - bootinfo.bi_memsizes_valid++; /* Process configuration file */ @@ -271,11 +258,11 @@ main(void) * or in case of failure, try to load a kernel directly instead. */ - if (autoboot && !*kname) { - memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3)); + if (autoboot && !kname) { + kname = PATH_BOOT3; if (!keyhit(3*SECOND)) { load(); - memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL)); + kname = PATH_KERNEL; } } @@ -290,7 +277,7 @@ main(void) 'a' + dsk.part, kname); if (ioctrl & IO_SERIAL) sio_flush(); - if (!autoboot || keyhit(5*SECOND)) + if (!autoboot || keyhit(3*SECOND)) getstr(); else if (!autoboot || !OPT_CHECK(RBX_QUIET)) putchar('\n'); @@ -474,11 +461,7 @@ parse() ? DRV_HARD : 0) + drv; dsk_meta = 0; } - if ((i = ep - arg)) { - if ((size_t)i >= sizeof(kname)) - return -1; - memcpy(kname, arg, i + 1); - } + kname = arg; } arg = p; } @@ -630,7 +613,7 @@ keyhit(unsigned ticks) t1 = *(uint32_t *)PTOV(0x46c); if (!t0) t0 = t1; - if (t1 < t0 || t1 >= t0 + ticks) + if ((uint32_t)(t1 - t0) >= ticks) return 0; } } From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 13:26:51 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C96F51065670; Tue, 26 Jul 2011 13:26: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 AED5A8FC16; Tue, 26 Jul 2011 13:26: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 p6QDQpV9010584; Tue, 26 Jul 2011 13:26:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDQp5K010581; Tue, 26 Jul 2011 13:26:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261326.p6QDQp5K010581@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224439 - in stable/7/sys/boot: common i386/boot2 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:26:52 -0000 Author: marius Date: Tue Jul 26 13:26:51 2011 New Revision: 224439 URL: http://svn.freebsd.org/changeset/base/224439 Log: MFC: r219452 Some more shrinking. o bunch of variables are turned into uint8_t o initial setting of namep[] in lookup() is removed as it's only overwritten a few lines down o kname is explicitly initialized in main() as BSS in boot2 is not zeroed o the setting and reading of "fmt" in load() is removed o buf in printf() is made static to save space Reviewed by: jhb Tested by: me and Fabian Keil Modified: stable/7/sys/boot/common/ufsread.c stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/common/ufsread.c ============================================================================== --- stable/7/sys/boot/common/ufsread.c Tue Jul 26 13:26:46 2011 (r224438) +++ stable/7/sys/boot/common/ufsread.c Tue Jul 26 13:26:51 2011 (r224439) @@ -88,7 +88,7 @@ static struct dmadat *dmadat; static ino_t lookup(const char *); static ssize_t fsread(ino_t, void *, size_t); -static int ls, dsk_meta; +static uint8_t ls, dsk_meta; static uint32_t fs_off; static __inline uint8_t @@ -127,8 +127,6 @@ lookup(const char *path) ino = ROOTINO; dt = DT_DIR; - name[0] = '/'; - name[1] = '\0'; for (;;) { if (*path == '/') path++; Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:26:46 2011 (r224438) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:26:51 2011 (r224439) @@ -125,17 +125,17 @@ static struct dsk { unsigned drive; unsigned type; unsigned unit; - unsigned slice; - unsigned part; + uint8_t slice; + uint8_t part; unsigned start; int init; } dsk; static char cmd[512], cmddup[512]; -static const char *kname = NULL; +static const char *kname; static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; -static unsigned ioctrl = IO_KEYBOARD; +static uint8_t ioctrl = IO_KEYBOARD; void exit(int); static void load(void); @@ -226,6 +226,7 @@ main(void) uint8_t autoboot; ino_t ino; + kname = NULL; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; v86.efl = PSL_RESERVED_DEFAULT | PSL_I; @@ -306,9 +307,8 @@ load(void) static Elf32_Shdr es[2]; caddr_t p; ino_t ino; - uint32_t addr, x; + uint32_t addr; int i, j; - uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) @@ -317,15 +317,8 @@ load(void) } if (xfsread(ino, &hdr, sizeof(hdr))) return; - if (N_GETMAGIC(hdr.ex) == ZMAGIC) - fmt = 0; - else if (IS_ELF(hdr.eh)) - fmt = 1; - else { - printf("Invalid %s\n", "format"); - return; - } - if (fmt == 0) { + + if (N_GETMAGIC(hdr.ex) == ZMAGIC) { addr = hdr.ex.a_entry & 0xffffff; p = PTOV(addr); fs_off = PAGE_SIZE; @@ -334,7 +327,7 @@ load(void) p += roundup2(hdr.ex.a_text, PAGE_SIZE); if (xfsread(ino, p, hdr.ex.a_data)) return; - } else { + } else if (IS_ELF(hdr.eh)) { fs_off = hdr.eh.e_phoff; for (j = i = 0; i < hdr.eh.e_phnum && j < 2; i++) { if (xfsread(ino, ep + j, sizeof(ep[0]))) @@ -366,7 +359,11 @@ load(void) } addr = hdr.eh.e_entry & 0xffffff; bootinfo.bi_esymtab = VTOP(p); + } else { + printf("Invalid %s\n", "format"); + return; } + bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.drive; __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), @@ -474,7 +471,8 @@ dskread(void *buf, unsigned lba, unsigne struct dos_partition *dp; struct disklabel *d; char *sec; - unsigned sl, i; + unsigned i; + uint8_t sl; if (!dsk_meta) { sec = dmadat->secbuf; @@ -534,7 +532,7 @@ static void printf(const char *fmt,...) { va_list ap; - char buf[10]; + static char buf[10]; char *s; unsigned u; int c; From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 13:29:11 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0FC51065674; Tue, 26 Jul 2011 13:29:11 +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 C04AB8FC19; Tue, 26 Jul 2011 13:29: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 p6QDTBw5010774; Tue, 26 Jul 2011 13:29:11 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDTBAi010772; Tue, 26 Jul 2011 13:29:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261329.p6QDTBAi010772@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224441 - stable/7/sys/boot/i386/boot2 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:29:11 -0000 Author: marius Date: Tue Jul 26 13:29:11 2011 New Revision: 224441 URL: http://svn.freebsd.org/changeset/base/224441 Log: MFC: r220389, r220392 - Mark getc() as inline, this has no effect on gcc but helps clang. - Move getc() body before xgetc() so gcc does not emit a warning about function having no body. Approved by: jhb Modified: stable/7/sys/boot/i386/boot2/boot2.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:29:11 2011 (r224440) +++ stable/7/sys/boot/i386/boot2/boot2.c Tue Jul 26 13:29:11 2011 (r224441) @@ -148,7 +148,7 @@ static int drvread(void *, unsigned, uns static int keyhit(unsigned); static int xputc(int); static int xgetc(int); -static int getc(int); +static inline int getc(int); static void memcpy(void *, const void *, int); static void @@ -627,6 +627,15 @@ xputc(int c) } static int +getc(int fn) +{ + v86.addr = 0x16; + v86.eax = fn << 8; + v86int(); + return fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl); +} + +static int xgetc(int fn) { if (OPT_CHECK(RBX_NOINTR)) @@ -640,12 +649,3 @@ xgetc(int fn) return 0; } } - -static int -getc(int fn) -{ - v86.addr = 0x16; - v86.eax = fn << 8; - v86int(); - return fn == 0 ? v86.eax & 0xff : !V86_ZR(v86.efl); -} From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 13:58:10 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 153E8106566B; Tue, 26 Jul 2011 13:58:10 +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 045458FC13; Tue, 26 Jul 2011 13:58: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 p6QDw9t9011768; Tue, 26 Jul 2011 13:58:09 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QDw9Gi011766; Tue, 26 Jul 2011 13:58:09 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261358.p6QDw9Gi011766@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 13:58:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224443 - in stable/7/usr.sbin/makefs: . ffs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 13:58:10 -0000 Author: marius Date: Tue Jul 26 13:58:09 2011 New Revision: 224443 URL: http://svn.freebsd.org/changeset/base/224443 Log: MFC: r203059 Correct copy-paste typo from previous option description. Modified: stable/7/usr.sbin/makefs/makefs.8 Directory Properties: stable/7/usr.sbin/makefs/ (props changed) stable/7/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/7/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/7/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/7/usr.sbin/makefs/getid.c (props changed) Modified: stable/7/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/7/usr.sbin/makefs/makefs.8 Tue Jul 26 13:58:08 2011 (r224442) +++ stable/7/usr.sbin/makefs/makefs.8 Tue Jul 26 13:58:09 2011 (r224443) @@ -159,7 +159,7 @@ free files (inodes) exist in the image. An optional .Ql % suffix may be provided to indicate that -.Ar free-blocks +.Ar free-files indicates a percentage of the calculated image size .It Fl F Ar specfile Use From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 14:03:53 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BFF9106564A; Tue, 26 Jul 2011 14:03:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B1178FC08; Tue, 26 Jul 2011 14:03: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 p6QE3rnG012133; Tue, 26 Jul 2011 14:03:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QE3rID012131; Tue, 26 Jul 2011 14:03:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261403.p6QE3rID012131@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 14:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224445 - in stable/7/usr.sbin/makefs: . ffs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 14:03:53 -0000 Author: marius Date: Tue Jul 26 14:03:52 2011 New Revision: 224445 URL: http://svn.freebsd.org/changeset/base/224445 Log: MFC: r210933 (partial) Fix typos and spelling mistakes. Modified: stable/7/usr.sbin/makefs/makefs.8 Directory Properties: stable/7/usr.sbin/makefs/ (props changed) stable/7/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/7/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/7/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/7/usr.sbin/makefs/getid.c (props changed) Modified: stable/7/usr.sbin/makefs/makefs.8 ============================================================================== --- stable/7/usr.sbin/makefs/makefs.8 Tue Jul 26 14:03:50 2011 (r224444) +++ stable/7/usr.sbin/makefs/makefs.8 Tue Jul 26 14:03:52 2011 (r224445) @@ -204,7 +204,7 @@ If isn't provided, the current file flags will be used. Missing regular file entries will be created as zero-length files. .It Fl x -Exclude file system nodes not explcitly listed in the specfile. +Exclude file system nodes not explicitly listed in the specfile. .It Fl N Ar dbdir Use the user database text file .Pa master.passwd From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 14:41:55 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17C00106566B; Tue, 26 Jul 2011 14:41: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 04C1E8FC1C; Tue, 26 Jul 2011 14:41: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 p6QEftV9013593; Tue, 26 Jul 2011 14:41:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QEfsuF013575; Tue, 26 Jul 2011 14:41:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107261441.p6QEfsuF013575@svn.freebsd.org> From: Marius Strobl Date: Tue, 26 Jul 2011 14:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224448 - in stable/7/usr.sbin/makefs: . cd9660 compat ffs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 14:41:55 -0000 Author: marius Date: Tue Jul 26 14:41:54 2011 New Revision: 224448 URL: http://svn.freebsd.org/changeset/base/224448 Log: MFC: r214921, r219954, r219956, r221387, r221470, r221536, r222191 - Sync with the latest version from NetBSD. It notably addds ISO9660 support. - Add support for synthesizing an APM partition map to map Mac PowerPC bootstrap partitions from the ISO9660 boot catalog. This preserves OS X's ability to mount the CD, while allowing us a way to provide HFS-ified bootstrap code for Open Firmware. - Add analogs to the -chrp-boot and -prep-boot options to mkisofs. Added: stable/7/usr.sbin/makefs/cd9660/ - copied from r214921, head/usr.sbin/makefs/cd9660/ stable/7/usr.sbin/makefs/cd9660.c - copied, changed from r214921, head/usr.sbin/makefs/cd9660.c stable/7/usr.sbin/makefs/cd9660.h - copied, changed from r214921, head/usr.sbin/makefs/cd9660.h stable/7/usr.sbin/makefs/compat/Makefile.inc - copied unchanged from r214921, head/usr.sbin/makefs/compat/Makefile.inc stable/7/usr.sbin/makefs/ffs.h - copied unchanged from r214921, head/usr.sbin/makefs/ffs.h stable/7/usr.sbin/makefs/ffs/Makefile.inc - copied unchanged from r214921, head/usr.sbin/makefs/ffs/Makefile.inc Modified: stable/7/usr.sbin/makefs/Makefile stable/7/usr.sbin/makefs/cd9660/cd9660_eltorito.c stable/7/usr.sbin/makefs/cd9660/cd9660_strings.c stable/7/usr.sbin/makefs/ffs.c stable/7/usr.sbin/makefs/ffs/buf.c stable/7/usr.sbin/makefs/ffs/ffs_alloc.c stable/7/usr.sbin/makefs/ffs/mkfs.c stable/7/usr.sbin/makefs/makefs.8 stable/7/usr.sbin/makefs/makefs.c stable/7/usr.sbin/makefs/makefs.h stable/7/usr.sbin/makefs/walk.c Directory Properties: stable/7/usr.sbin/makefs/ (props changed) stable/7/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/7/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/7/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/7/usr.sbin/makefs/getid.c (props changed) Modified: stable/7/usr.sbin/makefs/Makefile ============================================================================== --- stable/7/usr.sbin/makefs/Makefile Tue Jul 26 14:41:54 2011 (r224447) +++ stable/7/usr.sbin/makefs/Makefile Tue Jul 26 14:41:54 2011 (r224448) @@ -1,22 +1,23 @@ # $FreeBSD$ PROG= makefs + +CFLAGS+=-I${.CURDIR} + +SRCS= cd9660.c ffs.c \ + getid.c \ + makefs.c \ + walk.c MAN= makefs.8 WARNS?= 2 -CFLAGS+=-I${.CURDIR} -SRCS= ffs.c getid.c makefs.c walk.c +.include "${.CURDIR}/cd9660/Makefile.inc" +.include "${.CURDIR}/ffs/Makefile.inc" +.include "${.CURDIR}/compat/Makefile.inc" -.PATH: ${.CURDIR}/ffs -CFLAGS+=-I${.CURDIR}/ffs CFLAGS+=-DHAVE_STRUCT_STAT_ST_FLAGS=1 CFLAGS+=-DHAVE_STRUCT_STAT_ST_GEN=1 -SRCS+= buf.c ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_subr.c mkfs.c ufs_bmap.c - -.PATH: ${.CURDIR}/compat -CFLAGS+=-I${.CURDIR}/compat -SRCS+= pwcache.c strsuftoll.c .PATH: ${.CURDIR}/../mtree CFLAGS+=-I${.CURDIR}/../mtree Copied and modified: stable/7/usr.sbin/makefs/cd9660.c (from r214921, head/usr.sbin/makefs/cd9660.c) ============================================================================== --- head/usr.sbin/makefs/cd9660.c Sun Nov 7 16:05:04 2010 (r214921, copy source) +++ stable/7/usr.sbin/makefs/cd9660.c Tue Jul 26 14:41:54 2011 (r224448) @@ -207,6 +207,7 @@ cd9660_set_defaults(void) diskStructure.rr_moved_dir = 0; diskStructure.archimedes_enabled = 0; + diskStructure.chrp_boot = 0; diskStructure.include_padding_areas = 1; @@ -391,6 +392,8 @@ cd9660_parse_opts(const char *option, fs diskStructure.rock_ridge_enabled = 1; else if (CD9660_IS_COMMAND_ARG_DUAL(var, "A", "archimedes")) diskStructure.archimedes_enabled = 1; + else if (CD9660_IS_COMMAND_ARG(var, "chrp-boot")) + diskStructure.chrp_boot = 1; else if (CD9660_IS_COMMAND_ARG_DUAL(var, "K", "keep-bad-images")) diskStructure.keep_bad_images = 1; else if (CD9660_IS_COMMAND_ARG(var, "allow-deep-trees")) Copied and modified: stable/7/usr.sbin/makefs/cd9660.h (from r214921, head/usr.sbin/makefs/cd9660.h) ============================================================================== --- head/usr.sbin/makefs/cd9660.h Sun Nov 7 16:05:04 2010 (r214921, copy source) +++ stable/7/usr.sbin/makefs/cd9660.h Tue Jul 26 14:41:54 2011 (r224448) @@ -285,6 +285,7 @@ typedef struct _iso9660_disk { cd9660node *rr_moved_dir; int archimedes_enabled; + int chrp_boot; /* Spec breaking options */ u_char allow_deep_trees; Modified: stable/7/usr.sbin/makefs/cd9660/cd9660_eltorito.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_eltorito.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/7/usr.sbin/makefs/cd9660/cd9660_eltorito.c Tue Jul 26 14:41:54 2011 (r224448) @@ -31,6 +31,9 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. */ + +#include + #include "cd9660.h" #include "cd9660_eltorito.h" @@ -497,11 +500,79 @@ cd9660_setup_boot_volume_descriptor(volu return 1; } +static int +cd9660_write_mbr_partition_entry(FILE *fd, int index, off_t sector_start, + off_t nsectors, int type) +{ + uint8_t val; + uint32_t lba; + + fseeko(fd, (off_t)(index) * 16 + 0x1be, SEEK_SET); + + val = 0x80; /* Bootable */ + fwrite(&val, sizeof(val), 1, fd); + + val = 0xff; /* CHS begin */ + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + + val = type; /* Part type */ + fwrite(&val, sizeof(val), 1, fd); + + val = 0xff; /* CHS end */ + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + fwrite(&val, sizeof(val), 1, fd); + + /* LBA extent */ + lba = htole32(sector_start); + fwrite(&lba, sizeof(lba), 1, fd); + lba = htole32(nsectors); + fwrite(&lba, sizeof(lba), 1, fd); + + return (0); +} + +static int +cd9660_write_apm_partition_entry(FILE *fd, int index, int total_partitions, + off_t sector_start, off_t nsectors, off_t sector_size, + const char *part_name, const char *part_type) +{ + uint32_t apm32; + uint16_t apm16; + + fseeko(fd, (off_t)(index + 1) * sector_size, SEEK_SET); + + /* Signature */ + apm16 = htobe16(0x504d); + fwrite(&apm16, sizeof(apm16), 1, fd); + apm16 = 0; + fwrite(&apm16, sizeof(apm16), 1, fd); + + /* Total number of partitions */ + apm32 = htobe32(total_partitions); + fwrite(&apm32, sizeof(apm32), 1, fd); + /* Bounds */ + apm32 = htobe32(sector_start); + fwrite(&apm32, sizeof(apm32), 1, fd); + apm32 = htobe32(nsectors); + fwrite(&apm32, sizeof(apm32), 1, fd); + + fwrite(part_name, strlen(part_name) + 1, 1, fd); + fseek(fd, 32 - strlen(part_name) - 1, SEEK_CUR); + fwrite(part_type, strlen(part_type) + 1, 1, fd); + + return 0; +} + int cd9660_write_boot(FILE *fd) { struct boot_catalog_entry *e; struct cd9660_boot_image *t; + int apm_partitions = 0; + int mbr_partitions = 0; /* write boot catalog */ if (fseeko(fd, (off_t)diskStructure.boot_catalog_sector * @@ -533,7 +604,88 @@ cd9660_write_boot(FILE *fd) t->filename, t->sector); } cd9660_copy_file(fd, t->sector, t->filename); + + if (t->system == ET_SYS_MAC) + apm_partitions++; + if (t->system == ET_SYS_PPC) + mbr_partitions++; + } + + /* some systems need partition tables as well */ + if (mbr_partitions > 0 || diskStructure.chrp_boot) { + uint16_t sig; + + fseek(fd, 0x1fe, SEEK_SET); + sig = htole16(0xaa55); + fwrite(&sig, sizeof(sig), 1, fd); + + mbr_partitions = 0; + + /* Write ISO9660 descriptor, enclosing the whole disk */ + if (diskStructure.chrp_boot) + cd9660_write_mbr_partition_entry(fd, mbr_partitions++, + 0, diskStructure.totalSectors * + (diskStructure.sectorSize / 512), 0x96); + + /* Write all partition entries */ + TAILQ_FOREACH(t, &diskStructure.boot_images, image_list) { + if (t->system != ET_SYS_PPC) + continue; + cd9660_write_mbr_partition_entry(fd, mbr_partitions++, + t->sector * (diskStructure.sectorSize / 512), + t->num_sectors * (diskStructure.sectorSize / 512), + 0x41 /* PReP Boot */); + } + } + + if (apm_partitions > 0) { + /* Write DDR and global APM info */ + uint32_t apm32; + uint16_t apm16; + int total_parts; + + fseek(fd, 0, SEEK_SET); + apm16 = htobe16(0x4552); + fwrite(&apm16, sizeof(apm16), 1, fd); + /* Device block size */ + apm16 = htobe16(512); + fwrite(&apm16, sizeof(apm16), 1, fd); + /* Device block count */ + apm32 = htobe32(diskStructure.totalSectors * + (diskStructure.sectorSize / 512)); + fwrite(&apm32, sizeof(apm32), 1, fd); + /* Device type/id */ + apm16 = htobe16(1); + fwrite(&apm16, sizeof(apm16), 1, fd); + fwrite(&apm16, sizeof(apm16), 1, fd); + + /* Count total needed entries */ + total_parts = 2 + apm_partitions; /* Self + ISO9660 */ + + /* Write self-descriptor */ + cd9660_write_apm_partition_entry(fd, 0, total_parts, 1, + total_parts, 512, "Apple", "Apple_partition_map"); + + /* Write ISO9660 descriptor, enclosing the whole disk */ + cd9660_write_apm_partition_entry(fd, 1, total_parts, 0, + diskStructure.totalSectors * + (diskStructure.sectorSize / 512), 512, "ISO9660", + "CD_ROM_Mode_1"); + + /* Write all partition entries */ + apm_partitions = 0; + TAILQ_FOREACH(t, &diskStructure.boot_images, image_list) { + if (t->system != ET_SYS_MAC) + continue; + + cd9660_write_apm_partition_entry(fd, + 2 + apm_partitions++, total_parts, + t->sector * (diskStructure.sectorSize / 512), + t->num_sectors * (diskStructure.sectorSize / 512), + 512, "CD Boot", "Apple_Bootstrap"); + } } return 0; } + Modified: stable/7/usr.sbin/makefs/cd9660/cd9660_strings.c ============================================================================== --- head/usr.sbin/makefs/cd9660/cd9660_strings.c Sun Nov 7 16:05:04 2010 (r214921) +++ stable/7/usr.sbin/makefs/cd9660/cd9660_strings.c Tue Jul 26 14:41:54 2011 (r224448) @@ -55,19 +55,19 @@ cd9660_uppercase_characters(char *str, i } static inline int -cd9660_is_a_char(char c) +cd9660_is_d_char(char c) { return (isupper((unsigned char)c) || c == '_' - || (c >= '0' && c <= '?')); + || (c >= '0' && c <= '9')); } static inline int -cd9660_is_d_char(char c) +cd9660_is_a_char(char c) { return (isupper((unsigned char)c) || c == '_' - || (c >= '%' && c <= '9') + || (c >= '%' && c <= '?') || (c >= ' ' && c <= '\"')); } Copied: stable/7/usr.sbin/makefs/compat/Makefile.inc (from r214921, head/usr.sbin/makefs/compat/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/usr.sbin/makefs/compat/Makefile.inc Tue Jul 26 14:41:54 2011 (r224448, copy of r214921, head/usr.sbin/makefs/compat/Makefile.inc) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/compat + +CFLAGS+= -I${.CURDIR}/compat + +SRCS+= pwcache.c strsuftoll.c Modified: stable/7/usr.sbin/makefs/ffs.c ============================================================================== --- stable/7/usr.sbin/makefs/ffs.c Tue Jul 26 14:41:54 2011 (r224447) +++ stable/7/usr.sbin/makefs/ffs.c Tue Jul 26 14:41:54 2011 (r224448) @@ -1,4 +1,4 @@ -/* $NetBSD: ffs.c,v 1.30 2004/06/24 22:30:13 lukem Exp $ */ +/* $NetBSD: ffs.c,v 1.44 2009/04/28 22:49:26 joerg Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -76,17 +76,24 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include "makefs.h" +#include "ffs.h" + +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS +#include +#endif #include #include #include + #include "ffs/ufs_bswap.h" #include "ffs/ufs_inode.h" #include "ffs/newfs_extern.h" @@ -94,7 +101,7 @@ __FBSDID("$FreeBSD$"); #undef DIP #define DIP(dp, field) \ - ((fsopts->version == 1) ? \ + ((ffs_opts->version == 1) ? \ (dp)->ffs1_din.di_##field : (dp)->ffs2_din.di_##field) /* @@ -139,39 +146,71 @@ int sectorsize; /* XXX: for buf.c::getb /* publically visible functions */ +void +ffs_prep_opts(fsinfo_t *fsopts) +{ + ffs_opt_t *ffs_opts; + + if ((ffs_opts = calloc(1, sizeof(ffs_opt_t))) == NULL) + err(1, "Allocating memory for ffs_options"); + + fsopts->fs_specific = ffs_opts; + + ffs_opts->bsize= -1; + ffs_opts->fsize= -1; + ffs_opts->cpg= -1; + ffs_opts->density= -1; + ffs_opts->minfree= -1; + ffs_opts->optimization= -1; + ffs_opts->maxcontig= -1; + ffs_opts->maxbpg= -1; + ffs_opts->avgfilesize= -1; + ffs_opts->avgfpdir= -1; + ffs_opts->version = 1; +} + +void +ffs_cleanup_opts(fsinfo_t *fsopts) +{ + if (fsopts->fs_specific) + free(fsopts->fs_specific); +} + int ffs_parse_opts(const char *option, fsinfo_t *fsopts) { + ffs_opt_t *ffs_opts = fsopts->fs_specific; + option_t ffs_options[] = { - { "bsize", &fsopts->bsize, 1, INT_MAX, + { "bsize", &ffs_opts->bsize, 1, INT_MAX, "block size" }, - { "fsize", &fsopts->fsize, 1, INT_MAX, + { "fsize", &ffs_opts->fsize, 1, INT_MAX, "fragment size" }, - { "density", &fsopts->density, 1, INT_MAX, + { "density", &ffs_opts->density, 1, INT_MAX, "bytes per inode" }, - { "minfree", &fsopts->minfree, 0, 99, + { "minfree", &ffs_opts->minfree, 0, 99, "minfree" }, - { "maxbpf", &fsopts->maxbpg, 1, INT_MAX, + { "maxbpf", &ffs_opts->maxbpg, 1, INT_MAX, "max blocks per file in a cg" }, - { "avgfilesize", &fsopts->avgfilesize, 1, INT_MAX, + { "avgfilesize", &ffs_opts->avgfilesize,1, INT_MAX, "expected average file size" }, - { "avgfpdir", &fsopts->avgfpdir, 1, INT_MAX, + { "avgfpdir", &ffs_opts->avgfpdir, 1, INT_MAX, "expected # of files per directory" }, - { "extent", &fsopts->maxbsize, 1, INT_MAX, + { "extent", &ffs_opts->maxbsize, 1, INT_MAX, "maximum # extent size" }, - { "maxbpcg", &fsopts->maxblkspercg, 1, INT_MAX, + { "maxbpcg", &ffs_opts->maxblkspercg,1, INT_MAX, "max # of blocks per group" }, - { "version", &fsopts->version, 1, 2, + { "version", &ffs_opts->version, 1, 2, "UFS version" }, - { NULL } + { .name = NULL } }; char *var, *val; int rv; - (void)&ffs_options; assert(option != NULL); assert(fsopts != NULL); + assert(ffs_opts != NULL); if (debug & DEBUG_FS_PARSE_OPTS) printf("ffs_parse_opts: got `%s'\n", option); @@ -188,9 +227,9 @@ ffs_parse_opts(const char *option, fsinf if (strcmp(var, "optimization") == 0) { if (strcmp(val, "time") == 0) { - fsopts->optimization = FS_OPTTIME; + ffs_opts->optimization = FS_OPTTIME; } else if (strcmp(val, "space") == 0) { - fsopts->optimization = FS_OPTSPACE; + ffs_opts->optimization = FS_OPTSPACE; } else { warnx("Invalid optimization `%s'", val); goto leave_ffs_parse_opts; @@ -277,11 +316,12 @@ ffs_validate(const char *dir, fsnode *ro #if notyet int32_t spc, nspf, ncyl, fssize; #endif - off_t size; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert(dir != NULL); assert(root != NULL); assert(fsopts != NULL); + assert(ffs_opts != NULL); if (debug & DEBUG_FS_VALIDATE) { printf("ffs_validate: before defaults set:\n"); @@ -291,31 +331,31 @@ ffs_validate(const char *dir, fsnode *ro /* set FFS defaults */ if (fsopts->sectorsize == -1) fsopts->sectorsize = DFL_SECSIZE; - if (fsopts->fsize == -1) - fsopts->fsize = MAX(DFL_FRAGSIZE, fsopts->sectorsize); - if (fsopts->bsize == -1) - fsopts->bsize = MIN(DFL_BLKSIZE, 8 * fsopts->fsize); - if (fsopts->cpg == -1) - fsopts->cpg = DFL_CYLSPERGROUP; + if (ffs_opts->fsize == -1) + ffs_opts->fsize = MAX(DFL_FRAGSIZE, fsopts->sectorsize); + if (ffs_opts->bsize == -1) + ffs_opts->bsize = MIN(DFL_BLKSIZE, 8 * ffs_opts->fsize); + if (ffs_opts->cpg == -1) + ffs_opts->cpg = DFL_CYLSPERGROUP; else - fsopts->cpgflg = 1; + ffs_opts->cpgflg = 1; /* fsopts->density is set below */ - if (fsopts->nsectors == -1) - fsopts->nsectors = DFL_NSECTORS; - if (fsopts->minfree == -1) - fsopts->minfree = MINFREE; - if (fsopts->optimization == -1) - fsopts->optimization = DEFAULTOPT; - if (fsopts->maxcontig == -1) - fsopts->maxcontig = - MAX(1, MIN(MAXPHYS, FFS_MAXBSIZE) / fsopts->bsize); + if (ffs_opts->nsectors == -1) + ffs_opts->nsectors = DFL_NSECTORS; + if (ffs_opts->minfree == -1) + ffs_opts->minfree = MINFREE; + if (ffs_opts->optimization == -1) + ffs_opts->optimization = DEFAULTOPT; + if (ffs_opts->maxcontig == -1) + ffs_opts->maxcontig = + MAX(1, MIN(MAXPHYS, FFS_MAXBSIZE) / ffs_opts->bsize); /* XXX ondisk32 */ - if (fsopts->maxbpg == -1) - fsopts->maxbpg = fsopts->bsize / sizeof(int32_t); - if (fsopts->avgfilesize == -1) - fsopts->avgfilesize = AVFILESIZ; - if (fsopts->avgfpdir == -1) - fsopts->avgfpdir = AFPDIR; + if (ffs_opts->maxbpg == -1) + ffs_opts->maxbpg = ffs_opts->bsize / sizeof(int32_t); + if (ffs_opts->avgfilesize == -1) + ffs_opts->avgfilesize = AVFILESIZ; + if (ffs_opts->avgfpdir == -1) + ffs_opts->avgfpdir = AFPDIR; /* calculate size of tree */ ffs_size_dir(root, fsopts); @@ -343,17 +383,19 @@ ffs_validate(const char *dir, fsnode *ro */ fsopts->size += (SBLOCK_UFS1 + SBLOCKSIZE) * ncg; /* add space needed to store inodes, x3 for blockmaps, etc */ - if (fsopts->version == 1) + if (ffs_opts->version == 1) fsopts->size += ncg * DINODE1_SIZE * - roundup(fsopts->inodes / ncg, fsopts->bsize / DINODE1_SIZE); + roundup(fsopts->inodes / ncg, + ffs_opts->bsize / DINODE1_SIZE); else fsopts->size += ncg * DINODE2_SIZE * - roundup(fsopts->inodes / ncg, fsopts->bsize / DINODE2_SIZE); + roundup(fsopts->inodes / ncg, + ffs_opts->bsize / DINODE2_SIZE); /* add minfree */ - if (fsopts->minfree > 0) + if (ffs_opts->minfree > 0) fsopts->size = - fsopts->size * (100 + fsopts->minfree) / 100; + fsopts->size * (100 + ffs_opts->minfree) / 100; /* * XXX any other fs slop to add, such as csum's, bitmaps, etc ?? */ @@ -362,24 +404,11 @@ ffs_validate(const char *dir, fsnode *ro fsopts->size = fsopts->minsize; /* round up to the next block */ - size = roundup(fsopts->size, fsopts->bsize); - - /* now check calculated sizes vs requested sizes */ - if (fsopts->maxsize > 0 && size > fsopts->maxsize) { - if (debug & DEBUG_FS_VALIDATE) { - printf("%s: `%s' size of %lld is larger than the " - "maxsize of %lld; rounding down to %lld.", - __func__, dir, (long long)size, - (long long)fsopts->maxsize, - (long long) rounddown(fsopts->size, fsopts->bsize)); - } - size = rounddown(fsopts->size, fsopts->bsize); - } - fsopts->size = size; + fsopts->size = roundup(fsopts->size, ffs_opts->bsize); /* calculate density if necessary */ - if (fsopts->density == -1) - fsopts->density = fsopts->size / fsopts->inodes + 1; + if (ffs_opts->density == -1) + ffs_opts->density = fsopts->size / fsopts->inodes + 1; if (debug & DEBUG_FS_VALIDATE) { printf("ffs_validate: after defaults set:\n"); @@ -388,6 +417,12 @@ ffs_validate(const char *dir, fsnode *ro dir, (long long)fsopts->size, (long long)fsopts->inodes); } sectorsize = fsopts->sectorsize; /* XXX - see earlier */ + + /* now check calculated sizes vs requested sizes */ + if (fsopts->maxsize > 0 && fsopts->size > fsopts->maxsize) { + errx(1, "`%s' size of %lld is larger than the maxsize of %lld.", + dir, (long long)fsopts->size, (long long)fsopts->maxsize); + } } @@ -395,6 +430,8 @@ static void ffs_dump_fsinfo(fsinfo_t *f) { + ffs_opt_t *fs = f->fs_specific; + printf("fsopts at %p\n", f); printf("\tsize %lld, inodes %lld, curinode %u\n", @@ -409,20 +446,20 @@ ffs_dump_fsinfo(fsinfo_t *f) printf("\tneedswap %d, sectorsize %d\n", f->needswap, f->sectorsize); printf("\tbsize %d, fsize %d, cpg %d, density %d\n", - f->bsize, f->fsize, f->cpg, f->density); + fs->bsize, fs->fsize, fs->cpg, fs->density); printf("\tnsectors %d, rpm %d, minfree %d\n", - f->nsectors, f->rpm, f->minfree); + fs->nsectors, fs->rpm, fs->minfree); printf("\tmaxcontig %d, maxbpg %d\n", - f->maxcontig, f->maxbpg); + fs->maxcontig, fs->maxbpg); printf("\toptimization %s\n", - f->optimization == FS_OPTSPACE ? "space" : "time"); + fs->optimization == FS_OPTSPACE ? "space" : "time"); } static int ffs_create_image(const char *image, fsinfo_t *fsopts) { -#if HAVE_STRUCT_STATVFS_F_IOSIZE +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS struct statvfs sfs; #endif struct fs *fs; @@ -434,18 +471,18 @@ ffs_create_image(const char *image, fsin assert (fsopts != NULL); /* create image */ - if ((fsopts->fd = open(image, O_RDWR | O_CREAT | O_TRUNC, 0777)) + if ((fsopts->fd = open(image, O_RDWR | O_CREAT | O_TRUNC, 0666)) == -1) { warn("Can't open `%s' for writing", image); return (-1); } /* zero image */ -#if HAVE_STRUCT_STATVFS_F_IOSIZE +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS if (fstatvfs(fsopts->fd, &sfs) == -1) { #endif bufsize = 8192; -#if HAVE_STRUCT_STATVFS_F_IOSIZE +#if HAVE_STRUCT_STATVFS_F_IOSIZE && HAVE_FSTATVFS warn("can't fstatvfs `%s', using default %d byte chunk", image, bufsize); } else @@ -465,10 +502,12 @@ ffs_create_image(const char *image, fsin if (i == -1) { warn("zeroing image, %lld bytes to go", (long long)bufrem); + free(buf); return (-1); } bufrem -= i; } + free(buf); /* make the file system */ if (debug & DEBUG_FS_CREATE_IMAGE) @@ -492,7 +531,7 @@ ffs_create_image(const char *image, fsin warnx( "Image file `%s' has %lld free inodes; %lld are required.", image, - (long long)fs->fs_cstotal.cs_nifree + ROOTINO, + (long long)(fs->fs_cstotal.cs_nifree + ROOTINO), (long long)fsopts->inodes); return (-1); } @@ -506,9 +545,11 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso struct direct tmpdir; fsnode * node; int curdirsize, this; + ffs_opt_t *ffs_opts = fsopts->fs_specific; /* node may be NULL (empty directory) */ assert(fsopts != NULL); + assert(ffs_opts != NULL); if (debug & DEBUG_FS_SIZE_DIR) printf("ffs_size_dir: entry: bytes %lld inodes %lld\n", @@ -516,7 +557,7 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso #define ADDDIRENT(e) do { \ tmpdir.d_namlen = strlen((e)); \ - this = DIRSIZ_SWAP(0, &tmpdir, 0); \ + this = DIRSIZ_SWAP(0, &tmpdir, 0); \ if (debug & DEBUG_FS_SIZE_DIR_ADD_DIRENT) \ printf("ADDDIRENT: was: %s (%d) this %d cur %d\n", \ e, tmpdir.d_namlen, this, curdirsize); \ @@ -533,14 +574,12 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso * by indirect blocks, etc. */ #define ADDSIZE(x) do { \ - fsopts->size += roundup((x), fsopts->fsize); \ + fsopts->size += roundup((x), ffs_opts->fsize); \ } while (0); curdirsize = 0; for (node = root; node != NULL; node = node->next) { ADDDIRENT(node->name); - if (FSNODE_EXCLUDE_P(fsopts, node)) - continue; if (node == root) { /* we're at "." */ assert(strcmp(node->name, ".") == 0); ADDDIRENT(".."); @@ -558,7 +597,7 @@ ffs_size_dir(fsnode *root, fsinfo_t *fso int slen; slen = strlen(node->symlink) + 1; - if (slen >= (fsopts->version == 1 ? + if (slen >= (ffs_opts->version == 1 ? MAXSYMLINKLEN_UFS1 : MAXSYMLINKLEN_UFS2)) ADDSIZE(slen); @@ -682,10 +721,12 @@ ffs_populate_dir(const char *dir, fsnode union dinode din; void *membuf; char path[MAXPATHLEN + 1]; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert(dir != NULL); assert(root != NULL); assert(fsopts != NULL); + assert(ffs_opts != NULL); (void)memset(&dirbuf, 0, sizeof(dirbuf)); @@ -696,8 +737,6 @@ ffs_populate_dir(const char *dir, fsnode * pass 1: allocate inode numbers, build directory `file' */ for (cur = root; cur != NULL; cur = cur->next) { - if (FSNODE_EXCLUDE_P(fsopts, cur)) - continue; if ((cur->inode->flags & FI_ALLOCATED) == 0) { cur->inode->flags |= FI_ALLOCATED; if (cur == root && cur->parent != NULL) @@ -732,8 +771,6 @@ ffs_populate_dir(const char *dir, fsnode if (debug & DEBUG_FS_POPULATE) printf("ffs_populate_dir: PASS 2 dir %s\n", dir); for (cur = root; cur != NULL; cur = cur->next) { - if (FSNODE_EXCLUDE_P(fsopts, cur)) - continue; if (cur->inode->flags & FI_WRITTEN) continue; /* skip hard-linked entries */ cur->inode->flags |= FI_WRITTEN; @@ -746,7 +783,7 @@ ffs_populate_dir(const char *dir, fsnode continue; /* child creates own inode */ /* build on-disk inode */ - if (fsopts->version == 1) + if (ffs_opts->version == 1) membuf = ffs_build_dinode1(&din.ffs1_din, &dirbuf, cur, root, fsopts); else @@ -777,8 +814,6 @@ ffs_populate_dir(const char *dir, fsnode if (debug & DEBUG_FS_POPULATE) printf("ffs_populate_dir: PASS 3 dir %s\n", dir); for (cur = root; cur != NULL; cur = cur->next) { - if (FSNODE_EXCLUDE_P(fsopts, cur)) - continue; if (cur->child == NULL) continue; if (snprintf(path, sizeof(path), "%s/%s", dir, cur->name) @@ -804,16 +839,20 @@ ffs_write_file(union dinode *din, uint32 int isfile, ffd; char *fbuf, *p; off_t bufleft, chunk, offset; + ssize_t nread; struct inode in; struct buf * bp; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert (din != NULL); assert (buf != NULL); assert (fsopts != NULL); + assert (ffs_opts != NULL); isfile = S_ISREG(DIP(din, mode)); fbuf = NULL; ffd = -1; + p = NULL; in.i_fs = (struct fs *)fsopts->superblock; @@ -830,7 +869,7 @@ ffs_write_file(union dinode *din, uint32 in.i_number = ino; in.i_size = DIP(din, size); - if (fsopts->version == 1) + if (ffs_opts->version == 1) memcpy(&in.i_din.ffs1_din, &din->ffs1_din, sizeof(in.i_din.ffs1_din)); else @@ -842,7 +881,7 @@ ffs_write_file(union dinode *din, uint32 goto write_inode_and_leave; /* mmm, cheating */ if (isfile) { - if ((fbuf = malloc(fsopts->bsize)) == NULL) + if ((fbuf = malloc(ffs_opts->bsize)) == NULL) err(1, "Allocating memory for write buffer"); if ((ffd = open((char *)buf, O_RDONLY, 0444)) == -1) { warn("Can't open `%s' for reading", (char *)buf); @@ -854,13 +893,20 @@ ffs_write_file(union dinode *din, uint32 chunk = 0; for (bufleft = DIP(din, size); bufleft > 0; bufleft -= chunk) { - chunk = MIN(bufleft, fsopts->bsize); - if (isfile) { - if (read(ffd, fbuf, chunk) != chunk) - err(1, "Reading `%s', %lld bytes to go", - (char *)buf, (long long)bufleft); + chunk = MIN(bufleft, ffs_opts->bsize); + if (!isfile) + ; + else if ((nread = read(ffd, fbuf, chunk)) == -1) + err(EXIT_FAILURE, "Reading `%s', %lld bytes to go", + (char *)buf, (long long)bufleft); + else if (nread != chunk) + errx(EXIT_FAILURE, "Reading `%s', %lld bytes to go, " + "read %zd bytes, expected %ju bytes, does " + "metalog size= attribute mismatch source size?", + (char *)buf, (long long)bufleft, nread, + (uintmax_t)chunk); + else p = fbuf; - } offset = DIP(din, size) - bufleft; if (debug & DEBUG_FS_WRITE_FILE_BLOCK) printf( @@ -932,7 +978,7 @@ ffs_make_dirbuf(dirbuf_t *dbuf, const ch { struct direct de, *dp; uint16_t llen, reclen; - char *newbuf; + u_char *newbuf; assert (dbuf != NULL); assert (name != NULL); @@ -969,7 +1015,7 @@ ffs_make_dirbuf(dirbuf_t *dbuf, const ch dbuf->size += DIRBLKSIZ; memset(dbuf->buf + dbuf->size - DIRBLKSIZ, 0, DIRBLKSIZ); dbuf->cur = dbuf->size - DIRBLKSIZ; - } else { /* shrink end of previous */ + } else if (dp) { /* shrink end of previous */ dp->d_reclen = ufs_rw16(llen,needswap); dbuf->cur += llen; } @@ -993,10 +1039,12 @@ ffs_write_inode(union dinode *dp, uint32 daddr_t d; char sbbuf[FFS_MAXBSIZE]; int32_t initediblk; + ffs_opt_t *ffs_opts = fsopts->fs_specific; assert (dp != NULL); assert (ino > 0); assert (fsopts != NULL); + assert (ffs_opts != NULL); fs = (struct fs *)fsopts->superblock; cg = ino_to_cg(fs, ino); @@ -1041,7 +1089,7 @@ ffs_write_inode(union dinode *dp, uint32 * Initialize inode blocks on the fly for UFS2. */ initediblk = ufs_rw32(cgp->cg_initediblk, fsopts->needswap); - if (fsopts->version == 2 && cgino + INOPB(fs) > initediblk && + if (ffs_opts->version == 2 && cgino + INOPB(fs) > initediblk && initediblk < ufs_rw32(cgp->cg_niblk, fsopts->needswap)) { memset(buf, 0, fs->fs_bsize); dip = (struct ufs2_dinode *)buf; @@ -1065,14 +1113,14 @@ ffs_write_inode(union dinode *dp, uint32 d = fsbtodb(fs, ino_to_fsba(fs, ino)); ffs_rdfs(d, fs->fs_bsize, buf, fsopts); if (fsopts->needswap) { - if (fsopts->version == 1) + if (ffs_opts->version == 1) ffs_dinode1_swap(&dp->ffs1_din, &dp1[ino_to_fsbo(fs, ino)]); else ffs_dinode2_swap(&dp->ffs2_din, &dp2[ino_to_fsbo(fs, ino)]); } else { - if (fsopts->version == 1) + if (ffs_opts->version == 1) dp1[ino_to_fsbo(fs, ino)] = dp->ffs1_din; else dp2[ino_to_fsbo(fs, ino)] = dp->ffs2_din; Copied: stable/7/usr.sbin/makefs/ffs.h (from r214921, head/usr.sbin/makefs/ffs.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/usr.sbin/makefs/ffs.h Tue Jul 26 14:41:54 2011 (r224448, copy of r214921, head/usr.sbin/makefs/ffs.h) @@ -0,0 +1,66 @@ +/* $NetBSD: ffs.h,v 1.1 2004/12/20 20:51:42 jmc Exp $ */ + +/* + * Copyright (c) 2001-2003 Wasabi Systems, Inc. + * All rights reserved. + * + * Written by Luke Mewburn for Wasabi Systems, Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the NetBSD Project by + * Wasabi Systems, Inc. + * 4. The name of Wasabi Systems, Inc. may not be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _FFS_H +#define _FFS_H + +typedef struct { + int bsize; /* block size */ + int fsize; /* fragment size */ + int cpg; /* cylinders per group */ + int cpgflg; /* cpg was specified by user */ + int density; /* bytes per inode */ + int ntracks; /* number of tracks */ + int nsectors; /* number of sectors */ + int rpm; /* rpm */ + int minfree; /* free space threshold */ + int optimization; /* optimization (space or time) */ + int maxcontig; /* max contiguous blocks to allocate */ + int rotdelay; /* rotational delay between blocks */ + int maxbpg; /* maximum blocks per file in a cyl group */ + int nrpos; /* # of distinguished rotational positions */ + int avgfilesize; /* expected average file size */ + int avgfpdir; /* expected # of files per directory */ + int version; /* filesystem version (1 = FFS, 2 = UFS2) */ + int maxbsize; /* maximum extent size */ + int maxblkspercg; /* max # of blocks per cylinder group */ + /* XXX: support `old' file systems ? */ +} ffs_opt_t; + +#endif /* _FFS_H */ Copied: stable/7/usr.sbin/makefs/ffs/Makefile.inc (from r214921, head/usr.sbin/makefs/ffs/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/usr.sbin/makefs/ffs/Makefile.inc Tue Jul 26 14:41:54 2011 (r224448, copy of r214921, head/usr.sbin/makefs/ffs/Makefile.inc) @@ -0,0 +1,9 @@ +# $FreeBSD$ +# + +.PATH: ${.CURDIR}/ffs ${.CURDIR}/../../sys/ufs/ffs + +CFLAGS+= -I${.CURDIR}/../../sys/ufs/ffs + +SRCS+= ffs_alloc.c ffs_balloc.c ffs_bswap.c ffs_subr.c ufs_bmap.c +SRCS+= buf.c mkfs.c Modified: stable/7/usr.sbin/makefs/ffs/buf.c ============================================================================== --- stable/7/usr.sbin/makefs/ffs/buf.c Tue Jul 26 14:41:54 2011 (r224447) +++ stable/7/usr.sbin/makefs/ffs/buf.c Tue Jul 26 14:41:54 2011 (r224448) @@ -118,7 +118,7 @@ brelse(struct buf *bp) bp->b_bcount = 0; return; } - + TAILQ_REMOVE(&buftail, bp, b_tailq); free(bp->b_data); free(bp); @@ -160,7 +160,7 @@ bcleanup(void) * know why there's still some buffers lying around that * aren't brelse()d */ - + if (TAILQ_EMPTY(&buftail)) return; @@ -201,7 +201,7 @@ getblk(int fd, struct fs *fs, daddr_t bl if (bp == NULL) { if ((bp = calloc(1, sizeof(struct buf))) == NULL) err(1, "getblk: calloc"); - + bp->b_bufsize = 0; bp->b_blkno = bp->b_lblkno = blkno; bp->b_fd = fd; Modified: stable/7/usr.sbin/makefs/ffs/ffs_alloc.c ============================================================================== --- stable/7/usr.sbin/makefs/ffs/ffs_alloc.c Tue Jul 26 14:41:54 2011 (r224447) +++ stable/7/usr.sbin/makefs/ffs/ffs_alloc.c Tue Jul 26 14:41:54 2011 (r224448) @@ -87,7 +87,7 @@ static int32_t ffs_mapsearch(struct fs * * available block is located. */ int -ffs_alloc(struct inode *ip, daddr_t lbn, daddr_t bpref, int size, +ffs_alloc(struct inode *ip, daddr_t lbn __unused, daddr_t bpref, int size, daddr_t *bnp) { struct fs *fs = ip->i_fs; @@ -95,7 +95,7 @@ ffs_alloc(struct inode *ip, daddr_t lbn, int cg; *bnp = 0; - if ((u_int)size > fs->fs_bsize || fragoff(fs, size) != 0) { + if (size > fs->fs_bsize || fragoff(fs, size) != 0) { errx(1, "ffs_alloc: bad size: bsize %d size %d", fs->fs_bsize, size); } @@ -187,11 +187,7 @@ ffs_blkpref_ufs1(struct inode *ip, daddr } daddr_t -ffs_blkpref_ufs2(ip, lbn, indx, bap) - struct inode *ip; - daddr_t lbn; - int indx; - int64_t *bap; +ffs_blkpref_ufs2(struct inode *ip, daddr_t lbn, int indx, int64_t *bap) { struct fs *fs; int cg; @@ -385,11 +381,11 @@ ffs_alloccgblk(struct inode *ip, struct int32_t bno; struct fs *fs = ip->i_fs; const int needswap = UFS_FSNEEDSWAP(fs); - u_int8_t *blksfree; + u_int8_t *blksfree_swap; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 16:14:58 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01162106564A; Tue, 26 Jul 2011 16:14:58 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4F538FC13; Tue, 26 Jul 2011 16:14: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 p6QGEvOR016464; Tue, 26 Jul 2011 16:14:57 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QGEvRA016462; Tue, 26 Jul 2011 16:14:57 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201107261614.p6QGEvRA016462@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 26 Jul 2011 16:14:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224449 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 16:14:58 -0000 Author: jh Date: Tue Jul 26 16:14:57 2011 New Revision: 224449 URL: http://svn.freebsd.org/changeset/base/224449 Log: MFC r219925: Recognize "ro", "rdonly", "norw", "rw" and "noro" as equal options in vfs_equalopts(). This allows vfs_sanitizeopts() to filter redundant occurrences of these options. It was possible that for example both "ro" and "rw" options became active concurrently. PR: kern/133614 MFC r220040: Fix some style issues in r219925. Modified: stable/7/sys/kern/vfs_mount.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/vfs_mount.c ============================================================================== --- stable/7/sys/kern/vfs_mount.c Tue Jul 26 14:41:54 2011 (r224448) +++ stable/7/sys/kern/vfs_mount.c Tue Jul 26 16:14:57 2011 (r224449) @@ -195,6 +195,25 @@ vfs_deleteopt(struct vfsoptlist *opts, c } } +static int +vfs_isopt_ro(const char *opt) +{ + + if (strcmp(opt, "ro") == 0 || strcmp(opt, "rdonly") == 0 || + strcmp(opt, "norw") == 0) + return (1); + return (0); +} + +static int +vfs_isopt_rw(const char *opt) +{ + + if (strcmp(opt, "rw") == 0 || strcmp(opt, "noro") == 0) + return (1); + return (0); +} + /* * Check if options are equal (with or without the "no" prefix). */ @@ -211,6 +230,10 @@ vfs_equalopts(const char *opt1, const ch /* "opt" vs. "noopt" */ if (strncmp(opt2, "no", 2) == 0 && strcmp(opt1, opt2 + 2) == 0) return (1); + /* "ro" / "rdonly" / "norw" / "rw" / "noro" */ + if ((vfs_isopt_ro(opt1) || vfs_isopt_rw(opt1)) && + (vfs_isopt_ro(opt2) || vfs_isopt_rw(opt2))) + return (1); return (0); } From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 17:02:54 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33A92106566C; Tue, 26 Jul 2011 17:02:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07E328FC0C; Tue, 26 Jul 2011 17:02: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 p6QH2rZV018190; Tue, 26 Jul 2011 17:02:53 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QH2rmG018188; Tue, 26 Jul 2011 17:02:53 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261702.p6QH2rmG018188@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224451 - stable/7/usr.sbin/faithd X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:02:54 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:02:53 2011 New Revision: 224451 URL: http://svn.freebsd.org/changeset/base/224451 Log: MFC 202386, 224284: 202386 (by ru): Use the newly brought %U macro. 224284: Fix various broken links in manual pages. PR: 159138 Modified: stable/7/usr.sbin/faithd/faithd.8 Directory Properties: stable/7/usr.sbin/faithd/ (props changed) Modified: stable/7/usr.sbin/faithd/faithd.8 ============================================================================== --- stable/7/usr.sbin/faithd/faithd.8 Tue Jul 26 17:02:17 2011 (r224450) +++ stable/7/usr.sbin/faithd/faithd.8 Tue Jul 26 17:02:53 2011 (r224451) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 9, 2010 +.Dd July 23, 2011 .Dt FAITHD 8 .Os .Sh NAME @@ -368,7 +368,7 @@ setting. .%A Kazu Yamamoto .%T "An IPv6-to-IPv4 transport relay translator" .%B RFC3142 -.%O ftp://ftp.isi.edu/in-notes/rfc3142.txt +.%U http://www.ietf.org/rfc/rfc3142.txt .%D June 2001 .Re .\" From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 17:10:25 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECFBE106566B; Tue, 26 Jul 2011 17:10:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCA438FC18; Tue, 26 Jul 2011 17:10: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 p6QHAPce018584; Tue, 26 Jul 2011 17:10:25 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QHAPgx018582; Tue, 26 Jul 2011 17:10:25 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261710.p6QHAPgx018582@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224453 - stable/7/share/man/man8 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:10:26 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:10:25 2011 New Revision: 224453 URL: http://svn.freebsd.org/changeset/base/224453 Log: MFC 224284: Fix various broken links in manual pages. PR: 159137 Modified: stable/7/share/man/man8/crash.8 Directory Properties: stable/7/share/man/man8/ (props changed) Modified: stable/7/share/man/man8/crash.8 ============================================================================== --- stable/7/share/man/man8/crash.8 Tue Jul 26 17:09:44 2011 (r224452) +++ stable/7/share/man/man8/crash.8 Tue Jul 26 17:10:25 2011 (r224453) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 2, 1996 +.Dd July 23, 2011 .Dt CRASH 8 .Os .Sh NAME @@ -207,7 +207,7 @@ the panic message is printed. For more details consult the chapter on kernel debugging in the .%B "FreeBSD Developers' Handbook" -.Pq Pa http://www.FreeBSD.org/ . +.Pq Pa http://www.freebsd.org/doc/en/books/developers-handbook/ . .Sh SEE ALSO .Xr kgdb 1 , .Xr dumpon 8 , From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 17:16:56 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4644A106568A; Tue, 26 Jul 2011 17:16:56 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3626F8FC17; Tue, 26 Jul 2011 17:16: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 p6QHGu5R018896; Tue, 26 Jul 2011 17:16:56 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QHGuqf018894; Tue, 26 Jul 2011 17:16:56 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261716.p6QHGuqf018894@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:16: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: r224455 - stable/7/share/man/man5 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:16:56 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:16:55 2011 New Revision: 224455 URL: http://svn.freebsd.org/changeset/base/224455 Log: MFC 224284: Fix various broken links in manual pages. PR: 159136 Modified: stable/7/share/man/man5/reiserfs.5 Directory Properties: stable/7/share/man/man5/ (props changed) Modified: stable/7/share/man/man5/reiserfs.5 ============================================================================== --- stable/7/share/man/man5/reiserfs.5 Tue Jul 26 17:16:13 2011 (r224454) +++ stable/7/share/man/man5/reiserfs.5 Tue Jul 26 17:16:55 2011 (r224455) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2006 +.Dd July 23, 2011 .Dt REISERFS 5 .Os .Sh NAME @@ -74,7 +74,6 @@ first appeared in .An -nosplit The ReiserFS kernel implementation was written by .An Hans Reiser -.Pq Pa http://www.namesys.com/ , and ported to .Fx by From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 17:39:41 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D7041065670; Tue, 26 Jul 2011 17:39:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3B9D8FC13; Tue, 26 Jul 2011 17:39: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 p6QHdenf019778; Tue, 26 Jul 2011 17:39:40 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QHdeaJ019740; Tue, 26 Jul 2011 17:39:40 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261739.p6QHdeaJ019740@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 17:39:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224457 - in stable/7/share/man/man4: . man4.i386 man4.sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 17:39:41 -0000 Author: gjb (doc committer) Date: Tue Jul 26 17:39:40 2011 New Revision: 224457 URL: http://svn.freebsd.org/changeset/base/224457 Log: MFC 202386, 224284: 202386 (by ru): Use the newly brought %U macro. 224284: Fix various broken links in manual pages. PR: 159130 159131 159132 159133 PR: 159134 159135 159144 Modified: stable/7/share/man/man4/acpi.4 stable/7/share/man/man4/aue.4 stable/7/share/man/man4/axe.4 stable/7/share/man/man4/cdce.4 stable/7/share/man/man4/dc.4 stable/7/share/man/man4/gif.4 stable/7/share/man/man4/hme.4 stable/7/share/man/man4/lge.4 stable/7/share/man/man4/lmc.4 stable/7/share/man/man4/mac.4 stable/7/share/man/man4/man4.i386/vpd.4 stable/7/share/man/man4/man4.sparc64/ebus.4 stable/7/share/man/man4/mpt.4 stable/7/share/man/man4/nge.4 stable/7/share/man/man4/pcm.4 stable/7/share/man/man4/pcn.4 stable/7/share/man/man4/psm.4 stable/7/share/man/man4/ral.4 stable/7/share/man/man4/re.4 stable/7/share/man/man4/rl.4 stable/7/share/man/man4/rue.4 stable/7/share/man/man4/rum.4 stable/7/share/man/man4/sf.4 stable/7/share/man/man4/sis.4 stable/7/share/man/man4/sk.4 stable/7/share/man/man4/smbus.4 stable/7/share/man/man4/snd_uaudio.4 stable/7/share/man/man4/ste.4 stable/7/share/man/man4/stf.4 stable/7/share/man/man4/targ.4 stable/7/share/man/man4/udav.4 stable/7/share/man/man4/ural.4 stable/7/share/man/man4/urio.4 stable/7/share/man/man4/vr.4 stable/7/share/man/man4/wi.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/acpi.4 ============================================================================== --- stable/7/share/man/man4/acpi.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/acpi.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -560,7 +560,7 @@ ACPI is only found and supported on i386 .%A "Toshiba Corporation" .%D August 25, 2003 .%T "Advanced Configuration and Power Interface Specification" -.%O http://acpi.info/spec.htm +.%U http://acpi.info/spec.htm .Re .Sh AUTHORS .An -nosplit Modified: stable/7/share/man/man4/aue.4 ============================================================================== --- stable/7/share/man/man4/aue.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/aue.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -193,7 +193,7 @@ The driver failed to allocate an mbuf fo .Xr ifconfig 8 .Rs .%T ADMtek AN986 data sheet -.%O http://www.admtek.com.tw +.%U http://www.admtek.com.tw .Re .Sh HISTORY The Modified: stable/7/share/man/man4/axe.4 ============================================================================== --- stable/7/share/man/man4/axe.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/axe.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -200,7 +200,7 @@ The driver failed to allocate an mbuf fo .Xr ifconfig 8 .Rs .%T "ASIX AX88172 AX88178 and AX88772 data sheets" -.%O http://www.asix.com.tw +.%U http://www.asix.com.tw .Re .Sh HISTORY The Modified: stable/7/share/man/man4/cdce.4 ============================================================================== --- stable/7/share/man/man4/cdce.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/cdce.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -120,11 +120,11 @@ is running low on mbufs. .Xr ifconfig 8 .Rs .%T "Universal Serial Bus Class Definitions for Communication Devices" -.%O http://www.usb.org/developers/devclass_docs/usbcdc11.pdf +.%U http://www.usb.org/developers/devclass_docs/usbcdc11.pdf .Re .Rs .%T "Data sheet Prolific PL-2501 Host-to-Host Bridge/Network Controller" -.%O http://tech.prolific.com.tw/visitor/fcabdl.asp?fid=20679530 +.%U http://tech.prolific.com.tw/visitor/fcabdl.asp?fid=20679530 .Re .Sh HISTORY The Modified: stable/7/share/man/man4/dc.4 ============================================================================== --- stable/7/share/man/man4/dc.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/dc.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd July 23, 2011 .Dt DC 4 .Os .Sh NAME @@ -351,27 +351,27 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T ADMtek AL981, AL983 and AL985 data sheets -.%O http://www.admtek.com.tw +.%U http://www.admtek.com.tw .Re .Rs .%T ASIX Electronics AX88140A and AX88141 data sheets -.%O http://www.asix.com.tw +.%U http://www.asix.com.tw .Re .Rs .%T Davicom DM9102 data sheet -.%O http://www.davicom8.com +.%U http://www.davicom.com.tw/userfile/24247/DM9102H-DS-F01-021508.pdf .Re .Rs .%T Intel 21143 Hardware Reference Manual -.%O http://developer.intel.com +.%U http://developer.intel.com .Re .Rs .%T Macronix 98713/A, 98715/A and 98725 data sheets -.%O http://www.macronix.com +.%U http://www.macronix.com .Re .Rs .%T Macronix 98713/A and 98715/A app notes -.%O http://www.macronix.com +.%U http://www.macronix.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/gif.4 ============================================================================== --- stable/7/share/man/man4/gif.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/gif.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2009 +.Dd July 23, 2011 .Dt GIF 4 .Os .Sh NAME @@ -198,7 +198,7 @@ to 1. .%B RFC2893 .%T Transition Mechanisms for IPv6 Hosts and Routers .%D August 2000 -.%O ftp://ftp.isi.edu/in-notes/rfc2893.txt +.%U http://www.ietf.org/rfc/rfc2893.txt .Re .Rs .%A Sally Floyd Modified: stable/7/share/man/man4/hme.4 ============================================================================== --- stable/7/share/man/man4/hme.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/hme.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -129,7 +129,7 @@ except the single-port SBus versions. .%T "STP2002QFP Fast Ethernet, Parallel Port, SCSI (FEPS) User's Guide" .%D April 1996 .%A Sun Microelectronics -.%O http://mediacast.sun.com/users/Barton808/media/STP2002QFP-FEPs_UG.pdf +.%U http://mediacast.sun.com/users/Barton808/media/STP2002QFP-FEPs_UG.pdf .Re .Sh HISTORY The Modified: stable/7/share/man/man4/lge.4 ============================================================================== --- stable/7/share/man/man4/lge.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/lge.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -143,7 +143,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T Level 1 LXT1001 Programming Manual -.%O http://www.FreeBSD.org/~wpaul/Level1/LXT1001SRM.pdf +.%U http://www.FreeBSD.org/~wpaul/Level1/LXT1001SRM.pdf .Re .Sh HISTORY The Modified: stable/7/share/man/man4/lmc.4 ============================================================================== --- stable/7/share/man/man4/lmc.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/lmc.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -43,7 +43,7 @@ .\" this program; if not, write to the Free Software Foundation, Inc., 59 .\" Temple Place - Suite 330, Boston, MA 02111-1307, USA. .\" -.Dd May 20, 2006 +.Dd July 23, 2011 .Dt LMC 4 .Os .\" @@ -723,8 +723,6 @@ Thus, cable length does not affect data/ .Xr ngctl 8 , .Xr ping 8 , .Xr ifnet 9 -.Pp -.Pa http://www.sbei.com/ .\" .Sh HISTORY .\" Modified: stable/7/share/man/man4/mac.4 ============================================================================== --- stable/7/share/man/man4/mac.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/mac.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -220,7 +220,7 @@ man page. .Rs .%B "The FreeBSD Handbook" .%T "Mandatory Access Control" -.%O http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mac.html +.%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mac.html .Re .Sh HISTORY The Modified: stable/7/share/man/man4/man4.i386/vpd.4 ============================================================================== --- stable/7/share/man/man4/man4.i386/vpd.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/man4.i386/vpd.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -76,7 +76,7 @@ Motherboard Serial Number. .%T "TP General - Using the BIOS Build ID to identify IBM ThinkPad systems" .%N "Reference #: MIGR-45120" .%D "November 22, 2002" -.%O "http://www.ibm.com/support/docview.wss?uid=psg1MIGR-45120" +.%U "http://www.ibm.com/support/docview.wss?uid=psg1MIGR-45120" .Re .Sh HISTORY The Modified: stable/7/share/man/man4/man4.sparc64/ebus.4 ============================================================================== --- stable/7/share/man/man4/man4.sparc64/ebus.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/man4.sparc64/ebus.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -99,7 +99,7 @@ DMA. .%T "Peripheral Component Interconnect Input Output Controller" .%V "Part No.: 802-7837-01" .%D "March 1997" -.%O "http://www.sun.com/oem/products/manuals/802-7837.pdf" +.%U "http://www.sun.com/oem/products/manuals/802-7837.pdf" .Re .Sh HISTORY The Modified: stable/7/share/man/man4/mpt.4 ============================================================================== --- stable/7/share/man/man4/mpt.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/mpt.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2010 +.Dd July 23, 2011 .Dt MPT 4 .Os .Sh NAME @@ -158,7 +158,7 @@ can take on - no separate compilation is .Xr targ 4 .Rs .%T "LSI Logic Website" -.%O http://www.lsilogic.com/ +.%U http://www.lsi.com/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/nge.4 ============================================================================== --- stable/7/share/man/man4/nge.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/nge.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -209,11 +209,11 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T National Semiconductor DP83820 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Rs .%T National Semiconductor DP83861 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/pcm.4 ============================================================================== --- stable/7/share/man/man4/pcm.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/pcm.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -409,7 +409,7 @@ A device node is not created properly. .Xr sysctl 8 .Rs .%T "The OSS API" -.%O "http://www.opensound.com/pguide/oss.pdf" +.%U "http://www.opensound.com/pguide/oss.pdf" .Re .Sh HISTORY The Modified: stable/7/share/man/man4/pcn.4 ============================================================================== --- stable/7/share/man/man4/pcn.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/pcn.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -179,7 +179,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T AMD PCnet/FAST, PCnet/FAST+ and PCnet/Home datasheets -.%O http://www.amd.com +.%U http://www.amd.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/psm.4 ============================================================================== --- stable/7/share/man/man4/psm.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/psm.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -844,7 +844,7 @@ Clicking any button without moving the m .Xr syslogd 8 .Rs .%T Synaptics TouchPad Interfacing Guide -.%O http://www.synaptics.com/ +.%U http://www.synaptics.com/ .Re .\".Sh HISTORY .Sh AUTHORS Modified: stable/7/share/man/man4/ral.4 ============================================================================== --- stable/7/share/man/man4/ral.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/ral.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -203,7 +203,7 @@ This should not happen. .Xr ifconfig 8 .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/re.4 ============================================================================== --- stable/7/share/man/man4/re.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/re.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -242,7 +242,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T RealTek Semiconductor RTL8139C+, RTL8169, RTL8169S and RTL8110S datasheets -.%O http://www.realtek.com.tw/ +.%U http://www.realtek.com.tw/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/rl.4 ============================================================================== --- stable/7/share/man/man4/rl.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/rl.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -262,7 +262,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%B The RealTek 8129, 8139 and 8139C+ datasheets -.%O http://www.realtek.com.tw +.%U http://www.realtek.com.tw .Re .Sh HISTORY The Modified: stable/7/share/man/man4/rue.4 ============================================================================== --- stable/7/share/man/man4/rue.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/rue.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd July 23, 2011 .Dt RUE 4 .Os .Sh NAME @@ -139,8 +139,8 @@ The driver failed to allocate an mbuf fo .Xr ng_ether 4 , .Xr ifconfig 8 .Rs -.%T "ReakTek RTL8150 data sheet" -.%O ftp://ftp.realtek.com.tw/lancard/data_sheet/8150/ +.%T "RealTek RTL8150 data sheet" +.%U http://pdf.seekdatasheet.com/2008714/200807142333305235.pdf .Re .Sh HISTORY The Modified: stable/7/share/man/man4/rum.4 ============================================================================== --- stable/7/share/man/man4/rum.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/rum.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -144,7 +144,7 @@ This should not happen. .Xr ifconfig 8 .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/sf.4 ============================================================================== --- stable/7/share/man/man4/sf.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/sf.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -197,7 +197,7 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T The Adaptec AIC-6915 Programmer's Manual -.%O http://download.adaptec.com/pdfs/user_guides/aic6915_pg.pdf +.%U http://download.adaptec.com/pdfs/user_guides/aic6915_pg.pdf .Re .Sh HISTORY The Modified: stable/7/share/man/man4/sis.4 ============================================================================== --- stable/7/share/man/man4/sis.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/sis.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -210,11 +210,11 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T SiS 900 and SiS 7016 datasheets -.%O http://www.sis.com.tw +.%U http://www.sis.com.tw .Re .Rs .%T NatSemi DP83815 datasheet -.%O http://www.national.com +.%U http://www.national.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/sk.4 ============================================================================== --- stable/7/share/man/man4/sk.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/sk.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -225,11 +225,11 @@ the network connection (cable). .Xr ifconfig 8 .Rs .%T XaQti XMAC II datasheet -.%O http://www.xaqti.com +.%U http://www.xaqti.com .Re .Rs .%T SysKonnect GEnesis programming manual -.%O http://www.syskonnect.com +.%U http://www.syskonnect.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/smbus.4 ============================================================================== --- stable/7/share/man/man4/smbus.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/smbus.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -67,7 +67,7 @@ between the internal SMB devices and ext .Xr smb 4 .Rs .%T The SMBus specification -.%O http://www.smbus.org/specs/ +.%U http://www.smbus.org/specs/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/snd_uaudio.4 ============================================================================== --- stable/7/share/man/man4/snd_uaudio.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/snd_uaudio.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -78,7 +78,7 @@ for more information. .Xr usb 4 .Rs .%T "USB Audio Class Specifications" -.%O http://www.usb.org/developers/devclass_docs/ +.%U http://www.usb.org/developers/devclass_docs/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/ste.4 ============================================================================== --- stable/7/share/man/man4/ste.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/ste.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -192,7 +192,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T Sundance ST201 data sheet -.%O http://www.sundanceti.com +.%U http://www.sundanceti.com .Re .Sh HISTORY The Modified: stable/7/share/man/man4/stf.4 ============================================================================== --- stable/7/share/man/man4/stf.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/stf.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2001 +.Dd July 23, 2011 .Dt STF 4 .Os .Sh NAME @@ -230,7 +230,7 @@ and not to use your 6to4 prefix as a sou .Xr inet 4 , .Xr inet6 4 .Pp -.Pa http://www.6bone.net/6bone_6to4.html +.Pa http://www.ipv6day.org/action.php?n=En.IPv6day .Rs .%A Brian Carpenter .%A Keith Moore Modified: stable/7/share/man/man4/targ.4 ============================================================================== --- stable/7/share/man/man4/targ.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/targ.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -133,7 +133,7 @@ are the control devices. .Xr scsi 4 .Rs .%T "FreeBSD Target Information" -.%O http://www.root.org/~nate/freebsd/ +.%U http://www.root.org/~nate/freebsd/ .Re .Sh AUTHORS .An -nosplit Modified: stable/7/share/man/man4/udav.4 ============================================================================== --- stable/7/share/man/man4/udav.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/udav.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -87,7 +87,7 @@ For more information on configuring this .Xr ifconfig 8 .Rs .%T "Davicom DM9601 data sheet" -.%O http://www.davicom.com.tw/big5/download/Data%20Sheet/DM9601-DS-P01-930914.pdf +.%U http://www.davicom.com.tw/big5/download/Data%20Sheet/DM9601-DS-P01-930914.pdf .Re .Sh HISTORY The Modified: stable/7/share/man/man4/ural.4 ============================================================================== --- stable/7/share/man/man4/ural.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/ural.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -128,7 +128,7 @@ This should not happen. .Xr ifconfig 8 .Rs .%T "Ralink Technology" -.%O http://www.ralinktech.com/ +.%U http://www.ralinktech.com/ .Re .Sh HISTORY The Modified: stable/7/share/man/man4/urio.4 ============================================================================== --- stable/7/share/man/man4/urio.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/urio.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -106,7 +106,7 @@ section): .Xr usb 4 .Rs .%T The Rio 500 SourceForge Project Web Page -.%O http://rio500.sourceforge.net/ +.%U http://rio500.sourceforge.net/ .Re .Pp The Rio500 tools from SourceForge Modified: stable/7/share/man/man4/vr.4 ============================================================================== --- stable/7/share/man/man4/vr.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/vr.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -192,7 +192,7 @@ the card should be configured correctly. .Xr ifconfig 8 .Rs .%T The VIA Technologies VT86C100A data sheet -.%O http://www.via.com.tw +.%U http://www.via.com.tw .Re .Sh HISTORY The Modified: stable/7/share/man/man4/wi.4 ============================================================================== --- stable/7/share/man/man4/wi.4 Tue Jul 26 17:38:49 2011 (r224456) +++ stable/7/share/man/man4/wi.4 Tue Jul 26 17:39:40 2011 (r224457) @@ -31,7 +31,7 @@ .\" $FreeBSD$ .\" $OpenBSD: wi.4tbl,v 1.14 2002/04/29 19:53:50 jsyn Exp $ .\" -.Dd July 16, 2005 +.Dd July 23, 2011 .Dt WI 4 .Os .Sh NAME @@ -362,7 +362,7 @@ command. .Xr ifconfig 8 , .Rs .%T HCF Light programming specification -.%O http://www.wavelan.com +.%U http://web.archive.org/web/20040130141721/http://wavelan.com/ .Re .Sh HISTORY The From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 18:59:38 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D054106564A; Tue, 26 Jul 2011 18:59:38 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C6718FC19; Tue, 26 Jul 2011 18:59: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 p6QIxcF7022268; Tue, 26 Jul 2011 18:59:38 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QIxcf7022266; Tue, 26 Jul 2011 18:59:38 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201107261859.p6QIxcf7022266@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 26 Jul 2011 18:59:38 +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: r224458 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 18:59:38 -0000 Author: jh Date: Tue Jul 26 18:59:38 2011 New Revision: 224458 URL: http://svn.freebsd.org/changeset/base/224458 Log: MFC r222216: In init_dynamic_kenv(), ignore environment strings exceeding the KENV_MNAMELEN + 1 + KENV_MVALLEN + 1 length limit to avoid buffer overflow in getenv(). Currenly loader(8) doesn't limit the length of environment strings. PR: kern/132104 Modified: stable/7/sys/kern/kern_environment.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_environment.c ============================================================================== --- stable/7/sys/kern/kern_environment.c Tue Jul 26 17:39:40 2011 (r224457) +++ stable/7/sys/kern/kern_environment.c Tue Jul 26 18:59:38 2011 (r224458) @@ -217,13 +217,19 @@ static void init_dynamic_kenv(void *data __unused) { char *cp; - int len, i; + size_t len; + int i; kenvp = malloc((KENV_SIZE + 1) * sizeof(char *), M_KENV, M_WAITOK | M_ZERO); i = 0; for (cp = kern_envp; cp != NULL; cp = kernenv_next(cp)) { len = strlen(cp) + 1; + if (len > KENV_MNAMELEN + 1 + KENV_MVALLEN + 1) { + printf("WARNING: too long kenv string, ignoring %s\n", + cp); + continue; + } if (i < KENV_SIZE) { kenvp[i] = malloc(len, M_KENV, M_WAITOK); strcpy(kenvp[i++], cp); From owner-svn-src-stable-7@FreeBSD.ORG Tue Jul 26 19:06:00 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06326106564A; Tue, 26 Jul 2011 19:06:00 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DFD708FC17; Tue, 26 Jul 2011 19:05:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6QJ5xdq022572; Tue, 26 Jul 2011 19:05:59 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6QJ5xom022570; Tue, 26 Jul 2011 19:05:59 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107261905.p6QJ5xom022570@svn.freebsd.org> From: Glen Barber Date: Tue, 26 Jul 2011 19:05:59 +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: r224460 - stable/7/sys/netinet/libalias X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2011 19:06:00 -0000 Author: gjb (doc committer) Date: Tue Jul 26 19:05:59 2011 New Revision: 224460 URL: http://svn.freebsd.org/changeset/base/224460 Log: MFC 223773: - General grammar and mdoc(7) fixes. - While here, remove a paragraph about userspace operation that has been outdated for some time. PR: 158623 Modified: stable/7/sys/netinet/libalias/libalias.3 Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/libalias/libalias.3 ============================================================================== --- stable/7/sys/netinet/libalias/libalias.3 Tue Jul 26 19:05:10 2011 (r224459) +++ stable/7/sys/netinet/libalias/libalias.3 Tue Jul 26 19:05:59 2011 (r224460) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 1, 2006 +.Dd July 04, 2011 .Dt LIBALIAS 3 .Os .Sh NAME @@ -52,7 +52,7 @@ machine on the local network. .Pp A certain amount of flexibility is built into the packet aliasing engine. In the simplest mode of operation, a many-to-one address mapping takes -place between local network and the packet aliasing host. +place between the local network and the packet aliasing host. This is known as IP masquerading. In addition, one-to-one mappings between local and public addresses can also be implemented, which is known as static NAT. @@ -61,15 +61,11 @@ linked to different public addresses, co many-to-one mappings. Also, a given public address and port can be statically redirected to a private address/port. -.Pp -The packet aliasing engine was designed to operate in user space outside -of the kernel, without any access to private kernel data structure, but -the source code can also be ported to a kernel environment. .Sh INITIALIZATION AND CONTROL One special function, .Fn LibAliasInit , -must always be called before any packet handling may be performed and -the returned instance pointer passed to all the other functions. +must always be called before any packet handling may be performed, and +the returned instance pointer must be passed to all the other functions. Normally, the .Fn LibAliasSetAddress function is called afterwards, to set the default aliasing address. @@ -118,8 +114,8 @@ prior to any packet handling. This function has no return value and is used to clear any resources attached to internal data structures. .Pp -This functions should be called when a program stops using the aliasing -engine; it does, amongst other things, clear out any firewall holes. +This function should be called when a program stops using the aliasing +engine; amongst other things, it clears out any firewall holes. To provide backwards compatibility and extra security, it is added to the .Xr atexit 3 @@ -135,7 +131,7 @@ local area network are aliased. All outgoing packets are re-mapped to this address unless overridden by a static address mapping established by .Fn LibAliasRedirectAddr . -If this function is not called, and no static rules match, an outgoing +If this function has not been called, and no static rules match, an outgoing packet retains its source address. .Pp If the @@ -150,7 +146,7 @@ address may or may not change on success If the .Dv PKT_ALIAS_RESET_ON_ADDR_CHANGE mode bit is set to zero, this function can also be used to dynamically change -the aliasing address on a packet to packet basis (it is a low overhead call). +the aliasing address on a packet-to-packet basis (it is a low overhead call). .Pp It is mandatory that this function be called prior to any packet handling. .Ed @@ -170,7 +166,7 @@ The following mode bits are defined in .It Dv PKT_ALIAS_LOG Enables logging into .Pa /var/log/alias.log . -Each time an aliasing link is created or deleted, the log file is appended +Each time an aliasing link is created or deleted, the log file is appended to with the current number of ICMP, TCP and UDP links. Mainly useful for debugging when the log file is viewed continuously with .Xr tail 1 . @@ -186,7 +182,7 @@ Response packets to connections or trans aliasing host or local network will be unaffected. This mode bit is useful for implementing a one-way firewall. .It Dv PKT_ALIAS_SAME_PORTS -If this mode bit is set, the packet aliasing engine will attempt to leave +If this mode bit is set, the packet-aliasing engine will attempt to leave the alias port numbers unchanged from the actual local port numbers. This can be done as long as the quintuple (proto, alias addr, alias port, remote addr, remote port) is unique. @@ -211,7 +207,7 @@ Standard Class A, B and C unregistered a 192.168.0.0 -> 192.168.255.255 (Class C subnets) .Ed .Pp -This option is useful in the case that packet aliasing host has both +This option is useful in the case that the packet aliasing host has both registered and unregistered subnets on different interfaces. The registered subnet is fully accessible to the outside world, so traffic from it does not need to be passed through the packet aliasing engine. @@ -229,8 +225,9 @@ of an address change. .It Dv PKT_ALIAS_PUNCH_FW This option makes .Nm -`punch holes' in an -.Xr ipfirewall 4 +.Dq punch holes +in an +.Xr ipfirewall 4 - based firewall for FTP/IRC DCC connections. The holes punched are bound by from/to IP address and port; it will not be possible to use a hole for another connection. @@ -240,9 +237,9 @@ To cater to unexpected death of a progra (e.g.\& kill -9), changing the state of the flag will clear the entire firewall range allocated for holes. -This will also happen on the initial call to -.Fn LibAliasSetFWBase . -This call must happen prior to setting this flag. +This clearing will also happen on the initial call to +.Fn LibAliasSetFWBase , +which must happen prior to setting this flag. .It Dv PKT_ALIAS_REVERSE This option makes .Nm @@ -263,10 +260,10 @@ below for details. .Ft void .Fn LibAliasSetFWBase "struct libalias *" "unsigned int base" "unsigned int num" .Bd -ragged -offset indent -Set firewall range allocated for punching firewall holes (with the +Set the firewall range allocated for punching firewall holes (with the .Dv PKT_ALIAS_PUNCH_FW flag). -The range will be cleared for all rules on initialization. +The range is cleared for all rules on initialization. .Ed .Pp .Ft void @@ -292,7 +289,7 @@ the two packet handling functions, .Fn LibAliasIn and .Fn LibAliasOut , -comprise minimal set of functions needed for a basic IP masquerading +comprise the minimal set of functions needed for a basic IP masquerading implementation. .Pp .Ft int @@ -313,11 +310,11 @@ Return codes: The packet aliasing process was successful. .It Dv PKT_ALIAS_IGNORED The packet was ignored and not de-aliased. -This can happen if the protocol is unrecognized, possibly an ICMP message -type is not handled or if incoming packets for new connections are being -ignored (if +This can happen if the protocol is unrecognized, as for an ICMP message +type that is not handled, or if incoming packets for new connections are being +ignored (if the .Dv PKT_ALIAS_DENY_INCOMING -mode bit was set by +mode bit was set using .Fn LibAliasSetMode ) . .It Dv PKT_ALIAS_UNRESOLVED_FRAGMENT This is returned when a fragment cannot be resolved because the header @@ -408,7 +405,7 @@ is called to change the address after .Fn LibAliasRedirectPort is called, a zero reference will track this change. .Pp -If the link is further set up to operate for a load sharing, then +If the link is further set up to operate with load sharing, then .Fa local_addr and .Fa local_port @@ -423,7 +420,7 @@ Likewise, if .Fa remote_port is zero, this indicates to redirect packets originating from any remote port number. -Almost always, the remote port specification will be zero, but non-zero +The remote port specification will almost always be zero, but non-zero remote addresses can sometimes be useful for firewalling. If two calls to .Fn LibAliasRedirectPort @@ -475,9 +472,10 @@ is called to change the address after .Fn LibAliasRedirectAddr is called, a zero reference will track this change. .Pp -If the link is further set up to operate for a load sharing, then +If the link is further set up to operate with load sharing, then the .Fa local_addr -is ignored, and is selected dynamically from the server pool, as described in +argument is ignored, and is selected dynamically from the server pool, +as described in .Fn LibAliasAddServer below. .Pp @@ -532,12 +530,12 @@ up for Load Sharing using IP Network Add LSNAT operates as follows. A client attempts to access a server by using the server virtual address. The LSNAT router transparently redirects the request to one of the hosts -in server pool, selected using a real-time load sharing algorithm. +in the server pool, using a real-time load sharing algorithm. Multiple sessions may be initiated from the same client, and each session -could be directed to a different host based on load balance across server -pool hosts at the time. -If load share is desired for just a few specific services, the configuration -on LSNAT could be defined to restrict load share for just the services +could be directed to a different host based on the load balance across server +pool hosts when the sessions are initiated. +If load sharing is desired for just a few specific services, the configuration +on LSNAT could be defined to restrict load sharing to just the services desired. .Pp Currently, only the simplest selection algorithm is implemented, where a @@ -596,8 +594,8 @@ The parameter is the pointer returned by either of the redirection functions. If an invalid pointer is passed to .Fn LibAliasRedirectDelete , -then a program crash or unpredictable operation could result, so it is -necessary to be careful using this function. +then a program crash or unpredictable operation could result, so +care is needed when using this function. .Ed .Pp .Ft int @@ -704,7 +702,7 @@ access, or to restrict access to certain .Bd -ragged -offset indent This function specifies that any IP packet with protocol number of .Fa proto -from a given remote address to an alias address be +from a given remote address to an alias address will be redirected to a specified local address. .Pp If @@ -1099,9 +1097,9 @@ SLIST_HEAD(dll_chain, dll) dll_chain ... .Ed .Pp .Va handler_chain -keep tracks of all the protocol handlers loaded, while +keeps track of all the protocol handlers loaded, while .Va ddl_chain -takes care of userland modules loaded. +tracks which userland modules are loaded. .Pp .Va handler_chain is composed of @@ -1123,12 +1121,12 @@ struct proto_handler { where: .Bl -inset .It Va pri -is the priority assigned to a protocol handler, lower +is the priority assigned to a protocol handler; lower priority is better. .It Va dir is the direction of packets: ingoing or outgoing. .It Va proto -says at which protocol this packet belongs: IP, TCP or UDP. +indicates to which protocol this packet belongs: IP, TCP or UDP. .It Va fingerprint points to the fingerprint function while protohandler points to the protocol handler function. @@ -1136,8 +1134,8 @@ to the protocol handler function. .Pp The .Va fingerprint -function has the double of scope of checking if the -incoming packet is found and if it belongs to any categories that this +function has the dual role of checking if the +incoming packet is found, and if it belongs to any categories that this module can handle. .Pp The @@ -1152,8 +1150,8 @@ When a packet enters if it meets a module hook, .Va handler_chain is searched to see if there is an handler that matches -this type of a packet (it checks protocol and direction of packet), then if -more than one handler is found, it starts with the module with +this type of a packet (it checks protocol and direction of packet). +Then, if more than one handler is found, it starts with the module with the lowest priority number: it calls the .Va fingerprint function and interprets the result. @@ -1191,8 +1189,8 @@ structure, then is called. The .Fn find_handler -function is responsible for walking out the handler -chain, it receives as input parameters: +function is responsible for walking the handler +chain; it receives as input parameters: .Bl -tag -width indent .It Fa IN direction @@ -1216,9 +1214,9 @@ supporting INcoming UDP packets. .Pp As was mentioned earlier, .Nm -in userland is a bit different, cause -care has to be taken of module handling too (avoiding duplicate load of -module, avoiding module with same name, etc.) so +in userland is a bit different, as +care must be taken in module handling as well (avoiding duplicate load of +modules, avoiding modules with same name, etc.) so .Va dll_chain was introduced. .Pp @@ -1232,9 +1230,8 @@ When an application calls .Nm first unloads all the loaded modules, then reloads all the modules listed in .Pa /etc/libalias.conf : -for every module loaded, a new entry to -.Va dll_chain -is added. +for every module loaded, a new entry is added to +.Va dll_chain . .Pp .Va dll_chain is composed of @@ -1271,8 +1268,8 @@ There is a module (called .Pa alias_dummy.[ch] ) in .Nm -that can be used as a skeleton for future work, here we analyse some parts of that -module. +that can be used as a skeleton for future work. +Here we analyse some parts of that module. From .Pa alias_dummy.c : .Bd -literal @@ -1285,7 +1282,7 @@ The variable is the .Dq "most important thing" in a module -cause it describes the handlers present and lets the outside world use +since it describes the handlers present and lets the outside world use it in an opaque way. .Pp It must ALWAYS be present in every module, and it MUST retain @@ -1328,7 +1325,7 @@ mod_handler(module_t mod, int type, void .Ed When running as KLD, .Fn mod_handler -register/deregister the module using +registers/deregisters the module using .Fn attach_handlers and .Fn detach_handlers , From owner-svn-src-stable-7@FreeBSD.ORG Wed Jul 27 01:57:24 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5F51106568C; Wed, 27 Jul 2011 01:57:24 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D50518FC16; Wed, 27 Jul 2011 01:57: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 p6R1vOhW035895; Wed, 27 Jul 2011 01:57:24 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6R1vOwZ035893; Wed, 27 Jul 2011 01:57:24 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107270157.p6R1vOwZ035893@svn.freebsd.org> From: Glen Barber Date: Wed, 27 Jul 2011 01:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224463 - stable/7/usr.sbin/jail X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 01:57:25 -0000 Author: gjb (doc committer) Date: Wed Jul 27 01:57:24 2011 New Revision: 224463 URL: http://svn.freebsd.org/changeset/base/224463 Log: MFC 224286: Document the potential for jail escape. PR: 142341 Modified: stable/7/usr.sbin/jail/jail.8 Directory Properties: stable/7/usr.sbin/jail/ (props changed) Modified: stable/7/usr.sbin/jail/jail.8 ============================================================================== --- stable/7/usr.sbin/jail/jail.8 Wed Jul 27 01:56:52 2011 (r224462) +++ stable/7/usr.sbin/jail/jail.8 Wed Jul 27 01:57:24 2011 (r224463) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2010 +.Dd July 23, 2011 .Dt JAIL 8 .Os .Sh NAME @@ -708,3 +708,10 @@ Currently, the simplest answer is to min offered on the host, possibly limiting it to services offered from .Xr inetd 8 which is easily configurable. +.Sh NOTES +Great care should be taken when managing directories visible within the jail. +For example, if a jailed process has its current working directory set to a +directory that is moved out of the jail's chroot, then the process may gain +access to the file space outside of the jail. +It is recommended that directories always be copied, rather than moved, out +of a jail. From owner-svn-src-stable-7@FreeBSD.ORG Wed Jul 27 11:21:51 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 233F6106564A; Wed, 27 Jul 2011 11:21: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 1181C8FC0C; Wed, 27 Jul 2011 11:21: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 p6RBLoq6055212; Wed, 27 Jul 2011 11:21:50 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6RBLokF055207; Wed, 27 Jul 2011 11:21:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107271121.p6RBLokF055207@svn.freebsd.org> From: Marius Strobl Date: Wed, 27 Jul 2011 11:21: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: r224468 - in stable/7/lib/libthr/arch/sparc64: . include sparc64 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jul 2011 11:21:51 -0000 Author: marius Date: Wed Jul 27 11:21:50 2011 New Revision: 224468 URL: http://svn.freebsd.org/changeset/base/224468 Log: MFC: r223228 Merge from r161730: o Set TP using inline assembly to avoid dead code elimination. o Eliminate _tcb. Merge from r161840: Stylize: avoid using a global register variable. Merge from r157461: Simplify _get_curthread() and _tcb_ctor because libc and rtld now already allocate thread pointer space in tls block for initial thread. Merge from r177853: Replace function _umtx_op with _umtx_op_err, the later function directly returns errno, because errno can be mucked by user's signal handler and most of pthread api heavily depends on errno to be correct, this change should improve stability of the thread library. Added: stable/7/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S - copied unchanged from r223228, head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S Modified: stable/7/lib/libthr/arch/sparc64/Makefile.inc stable/7/lib/libthr/arch/sparc64/include/pthread_md.h stable/7/lib/libthr/arch/sparc64/sparc64/pthread_md.c Directory Properties: stable/7/lib/libthr/ (props changed) Modified: stable/7/lib/libthr/arch/sparc64/Makefile.inc ============================================================================== --- stable/7/lib/libthr/arch/sparc64/Makefile.inc Wed Jul 27 11:21:49 2011 (r224467) +++ stable/7/lib/libthr/arch/sparc64/Makefile.inc Wed Jul 27 11:21:50 2011 (r224468) @@ -2,4 +2,4 @@ .PATH: ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH} -SRCS+= pthread_md.c +SRCS+= _umtx_op_err.S pthread_md.c Modified: stable/7/lib/libthr/arch/sparc64/include/pthread_md.h ============================================================================== --- stable/7/lib/libthr/arch/sparc64/include/pthread_md.h Wed Jul 27 11:21:49 2011 (r224467) +++ stable/7/lib/libthr/arch/sparc64/include/pthread_md.h Wed Jul 27 11:21:50 2011 (r224468) @@ -50,10 +50,6 @@ struct tcb { void *tcb_spare[1]; }; -register struct tcb *_tp __asm("%g7"); - -#define _tcb (_tp) - /* * The tcb constructors. */ @@ -64,26 +60,25 @@ void _tcb_dtor(struct tcb *); static __inline void _tcb_set(struct tcb *tcb) { - _tp = tcb; + + __asm __volatile("mov %0, %%g7" : : "r" (tcb)); } -/* - * Get the current tcb. - */ static __inline struct tcb * _tcb_get(void) { - return (_tcb); -} + register struct tcb *tp __asm("%g7"); -extern struct pthread *_thr_initial; + return (tp); +} static __inline struct pthread * _get_curthread(void) { - if (_thr_initial) - return (_tcb->tcb_thread); - return (NULL); + + return (_tcb_get()->tcb_thread); } +#define HAS__UMTX_OP_ERR 1 + #endif /* _PTHREAD_MD_H_ */ Copied: stable/7/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S (from r223228, head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S Wed Jul 27 11:21:50 2011 (r224468, copy of r223228, head/lib/libthr/arch/sparc64/sparc64/_umtx_op_err.S) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2011 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include + +ENTRY(_umtx_op_err) + mov SYS__umtx_op, %g1 + retl + ta %xcc, ST_SYSCALL +END(_umtx_op_err) Modified: stable/7/lib/libthr/arch/sparc64/sparc64/pthread_md.c ============================================================================== --- stable/7/lib/libthr/arch/sparc64/sparc64/pthread_md.c Wed Jul 27 11:21:49 2011 (r224467) +++ stable/7/lib/libthr/arch/sparc64/sparc64/pthread_md.c Wed Jul 27 11:21:50 2011 (r224468) @@ -24,10 +24,11 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include @@ -37,13 +38,11 @@ struct tcb * _tcb_ctor(struct pthread *thread, int initial) { struct tcb *tcb; - void *oldtls; if (initial) - oldtls = _tp; + tcb = _tcb_get(); else - oldtls = NULL; - tcb = _rtld_allocate_tls(oldtls, sizeof(struct tcb), 16); + tcb = _rtld_allocate_tls(NULL, sizeof(struct tcb), 16); if (tcb) tcb->tcb_thread = thread; return (tcb); @@ -52,5 +51,6 @@ _tcb_ctor(struct pthread *thread, int in void _tcb_dtor(struct tcb *tcb) { + _rtld_free_tls(tcb, sizeof(struct tcb), 16); } From owner-svn-src-stable-7@FreeBSD.ORG Fri Jul 29 10:51:57 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1F77106566B; Fri, 29 Jul 2011 10:51: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 D8BCD8FC08; Fri, 29 Jul 2011 10:51: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 p6TApuhJ044242; Fri, 29 Jul 2011 10:51:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TApuA0044240; Fri, 29 Jul 2011 10:51:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107291051.p6TApuA0044240@svn.freebsd.org> From: Alexander Motin Date: Fri, 29 Jul 2011 10:51: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: r224492 - stable/7/usr.sbin/diskinfo X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 10:51:57 -0000 Author: mav Date: Fri Jul 29 10:51:56 2011 New Revision: 224492 URL: http://svn.freebsd.org/changeset/base/224492 Log: MFC r224250: Fix `diskinfo -t` operation for disks smaller then 8GB or bigger then 2TB. Tested to work with 1.44MB floppy, 4GB USB stick and 4TB disk array. Modified: stable/7/usr.sbin/diskinfo/diskinfo.c Directory Properties: stable/7/usr.sbin/diskinfo/ (props changed) Modified: stable/7/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- stable/7/usr.sbin/diskinfo/diskinfo.c Fri Jul 29 10:02:03 2011 (r224491) +++ stable/7/usr.sbin/diskinfo/diskinfo.c Fri Jul 29 10:51:56 2011 (r224492) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -161,7 +162,7 @@ static char sector[65536]; static char mega[1024 * 1024]; static void -rdsect(int fd, u_int blockno, u_int sectorsize) +rdsect(int fd, off_t blockno, u_int sectorsize) { int error; @@ -222,21 +223,27 @@ TR(double count) static void speeddisk(int fd, off_t mediasize, u_int sectorsize) { - int i; - uint b0, b1, sectorcount; + int bulk, i; + off_t b0, b1, sectorcount, step; sectorcount = mediasize / sectorsize; + step = 1ULL << (flsll(sectorcount / (4 * 200)) - 1); + if (step > 16384) + step = 16384; + bulk = mediasize / (1024 * 1024); + if (bulk > 100) + bulk = 100; printf("Seek times:\n"); printf("\tFull stroke:\t"); b0 = 0; - b1 = sectorcount - 1 - 16384; + b1 = sectorcount - step; T0(); for (i = 0; i < 125; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 -= 16384; + b1 -= step; } TN(250); @@ -246,9 +253,9 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 125; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 += 16384; + b1 += step; } TN(250); printf("\tQuarter stroke:\t"); @@ -257,9 +264,9 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 250; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 += 16384; + b1 += step; } TN(500); @@ -268,7 +275,7 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 400; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; } TN(400); @@ -277,7 +284,7 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 400; i++) { rdsect(fd, b0, sectorsize); - b0 -= 16384; + b0 -= step; } TN(400); @@ -291,7 +298,7 @@ speeddisk(int fd, off_t mediasize, u_int TN(2048); printf("\tSeq inner:\t"); - b0 = sectorcount - 2048 - 1; + b0 = sectorcount - 2048; T0(); for (i = 0; i < 2048; i++) { rdsect(fd, b0, sectorsize); @@ -303,28 +310,28 @@ speeddisk(int fd, off_t mediasize, u_int printf("\toutside: "); rdsect(fd, 0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\tmiddle: "); - b0 = sectorcount / 2; + b0 = sectorcount / 2 - bulk * (1024*1024 / sectorsize) / 2 - 1; rdsect(fd, b0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\tinside: "); - b0 = sectorcount - 100 * (1024*1024 / sectorsize) - 1;; + b0 = sectorcount - bulk * (1024*1024 / sectorsize) - 1;; rdsect(fd, b0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\n"); return; From owner-svn-src-stable-7@FreeBSD.ORG Fri Jul 29 22:11:06 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F54F1065670; Fri, 29 Jul 2011 22:11:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EF378FC1E; Fri, 29 Jul 2011 22:11: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 p6TMB6ci068220; Fri, 29 Jul 2011 22:11:06 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6TMB6Rd068218; Fri, 29 Jul 2011 22:11:06 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201107292211.p6TMB6Rd068218@svn.freebsd.org> From: Andriy Gapon Date: Fri, 29 Jul 2011 22:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224501 - stable/7/sys/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jul 2011 22:11:06 -0000 Author: avg Date: Fri Jul 29 22:11:05 2011 New Revision: 224501 URL: http://svn.freebsd.org/changeset/base/224501 Log: MFC r223663: add SNDCTL_DSP_HALT specified by OSS PR: kern/156874 Modified: stable/7/sys/sys/soundcard.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sys/soundcard.h ============================================================================== --- stable/7/sys/sys/soundcard.h Fri Jul 29 22:00:32 2011 (r224500) +++ stable/7/sys/sys/soundcard.h Fri Jul 29 22:11:05 2011 (r224501) @@ -752,7 +752,8 @@ typedef struct { * IOCTL commands for /dev/dsp and /dev/audio */ -#define SNDCTL_DSP_RESET _IO ('P', 0) +#define SNDCTL_DSP_HALT _IO ('P', 0) +#define SNDCTL_DSP_RESET SNDCTL_DSP_HALT #define SNDCTL_DSP_SYNC _IO ('P', 1) #define SNDCTL_DSP_SPEED _IOWR('P', 2, int) #define SNDCTL_DSP_STEREO _IOWR('P', 3, int)