From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 15 20:52:31 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB2661065688; Sun, 15 Jan 2012 20:52:31 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93F108FC1B; Sun, 15 Jan 2012 20:52: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 q0FKqV8P099588; Sun, 15 Jan 2012 20:52:31 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FKqVT1099586; Sun, 15 Jan 2012 20:52:31 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201152052.q0FKqVT1099586@svn.freebsd.org> From: Eitan Adler Date: Sun, 15 Jan 2012 20:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230159 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 20:52:31 -0000 Author: eadler (ports committer) Date: Sun Jan 15 20:52:31 2012 New Revision: 230159 URL: http://svn.freebsd.org/changeset/base/230159 Log: MFC r228343: - Fix ktrace leakage if error is set PR: kern/163098 Approved by: sbruno Modified: stable/8/sys/kern/kern_ktrace.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/kern_ktrace.c ============================================================================== --- stable/8/sys/kern/kern_ktrace.c Sun Jan 15 20:52:01 2012 (r230158) +++ stable/8/sys/kern/kern_ktrace.c Sun Jan 15 20:52:31 2012 (r230159) @@ -473,7 +473,7 @@ ktrsysret(code, error, retval) ktp = &req->ktr_data.ktr_sysret; ktp->ktr_code = code; ktp->ktr_error = error; - ktp->ktr_retval = retval; /* what about val2 ? */ + ktp->ktr_retval = ((error == 0) ? retval: 0); /* what about val2 ? */ ktr_submitrequest(curthread, req); } From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 15 21:43:25 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E166106566C; Sun, 15 Jan 2012 21:43:25 +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 3E18C8FC13; Sun, 15 Jan 2012 21:43: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 q0FLhPqi001370; Sun, 15 Jan 2012 21:43:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FLhPf5001366; Sun, 15 Jan 2012 21:43:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201201152143.q0FLhPf5001366@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 Jan 2012 21:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230162 - in stable/8/sys/boot/i386: gptboot gptzfsboot zfsboot X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 21:43:25 -0000 Author: avg Date: Sun Jan 15 21:43:24 2012 New Revision: 230162 URL: http://svn.freebsd.org/changeset/base/230162 Log: MFC r225530: gpt/zfs boot blocks: reduce optimizing CFLAGS to -O1 Modified: stable/8/sys/boot/i386/gptboot/Makefile stable/8/sys/boot/i386/gptzfsboot/Makefile stable/8/sys/boot/i386/zfsboot/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/boot/i386/gptboot/Makefile ============================================================================== --- stable/8/sys/boot/i386/gptboot/Makefile Sun Jan 15 21:39:38 2012 (r230161) +++ stable/8/sys/boot/i386/gptboot/Makefile Sun Jan 15 21:43:24 2012 (r230162) @@ -20,12 +20,7 @@ GPTBOOT_UFS?= UFS1_AND_UFS2 #GPTBOOT_UFS?= UFS1_ONLY CFLAGS= -DBOOTPROG=\"gptboot\" \ - -Os \ - -fno-guess-branch-probability \ - -fomit-frame-pointer \ - -fno-unit-at-a-time \ - -mno-align-long-strings \ - -mrtd \ + -O1 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ -DGPT \ -D${GPTBOOT_UFS} \ Modified: stable/8/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- stable/8/sys/boot/i386/gptzfsboot/Makefile Sun Jan 15 21:39:38 2012 (r230161) +++ stable/8/sys/boot/i386/gptzfsboot/Makefile Sun Jan 15 21:43:24 2012 (r230162) @@ -17,12 +17,7 @@ ORG1= 0x7c00 ORG2= 0x0 CFLAGS= -DBOOTPROG=\"gptzfsboot\" \ - -Os \ - -fno-guess-branch-probability \ - -fomit-frame-pointer \ - -fno-unit-at-a-time \ - -mno-align-long-strings \ - -mrtd \ + -O1 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ -DGPT -DBOOT2 \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ Modified: stable/8/sys/boot/i386/zfsboot/Makefile ============================================================================== --- stable/8/sys/boot/i386/zfsboot/Makefile Sun Jan 15 21:39:38 2012 (r230161) +++ stable/8/sys/boot/i386/zfsboot/Makefile Sun Jan 15 21:43:24 2012 (r230162) @@ -15,12 +15,7 @@ ORG1= 0x7c00 ORG2= 0x2000 CFLAGS= -DBOOTPROG=\"zfsboot\" \ - -Os -g \ - -fno-guess-branch-probability \ - -fomit-frame-pointer \ - -fno-unit-at-a-time \ - -mno-align-long-strings \ - -mrtd \ + -O1 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ -DBOOT2 \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ @@ -81,17 +76,10 @@ zfsboot.bin: zfsboot.out zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} -zfsboot.o: zfsboot.s - SRCS= zfsboot.c -zfsboot.s: zfsboot.c ${.CURDIR}/../../zfs/zfsimpl.c - ${CC} ${CFLAGS} -S -o zfsboot.s.tmp ${.CURDIR}/zfsboot.c - sed -e '/align/d' -e '/nop/d' < zfsboot.s.tmp > zfsboot.s - rm -f zfsboot.s.tmp - .if ${MACHINE_ARCH} == "amd64" -beforedepend zfsboot.s: machine +beforedepend zfsboot.o: machine CLEANFILES+= machine machine: ln -sf ${.CURDIR}/../../../i386/include machine From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 15 21:50:18 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31E491065670; Sun, 15 Jan 2012 21:50:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BD358FC08; Sun, 15 Jan 2012 21:50:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FLoIvI001686; Sun, 15 Jan 2012 21:50:18 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FLoHVW001684; Sun, 15 Jan 2012 21:50:18 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201201152150.q0FLoHVW001684@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 Jan 2012 21:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230164 - stable/8/sys/boot/zfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 21:50:18 -0000 Author: avg Date: Sun Jan 15 21:50:17 2012 New Revision: 230164 URL: http://svn.freebsd.org/changeset/base/230164 Log: MFC r228266: zfs boot: allow file vdevs to be used in testing (e.g. with zfsboottest) Modified: stable/8/sys/boot/zfs/zfsimpl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/8/sys/boot/zfs/zfsimpl.c Sun Jan 15 21:48:42 2012 (r230163) +++ stable/8/sys/boot/zfs/zfsimpl.c Sun Jan 15 21:50:17 2012 (r230164) @@ -458,6 +458,9 @@ vdev_init_from_nvlist(const unsigned cha if (strcmp(type, VDEV_TYPE_MIRROR) && strcmp(type, VDEV_TYPE_DISK) +#ifdef ZFS_TEST + && strcmp(type, VDEV_TYPE_FILE) +#endif && strcmp(type, VDEV_TYPE_RAIDZ) && strcmp(type, VDEV_TYPE_REPLACING)) { printf("ZFS: can only boot from disk, mirror, raidz1, raidz2 and raidz3 vdevs\n"); From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 15 21:52:45 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 626E11065670; Sun, 15 Jan 2012 21:52:45 +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 4DA618FC1B; Sun, 15 Jan 2012 21:52: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 q0FLqj3G001871; Sun, 15 Jan 2012 21:52:45 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FLqj5n001869; Sun, 15 Jan 2012 21:52:45 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201201152152.q0FLqj5n001869@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 Jan 2012 21:52:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230166 - stable/8/sys/boot/i386/zfsboot X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 21:52:45 -0000 Author: avg Date: Sun Jan 15 21:52:45 2012 New Revision: 230166 URL: http://svn.freebsd.org/changeset/base/230166 Log: MFC r228267: zfsboot: print boot.config contents before parsing it Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- stable/8/sys/boot/i386/zfsboot/zfsboot.c Sun Jan 15 21:51:55 2012 (r230165) +++ stable/8/sys/boot/i386/zfsboot/zfsboot.c Sun Jan 15 21:52:45 2012 (r230166) @@ -534,10 +534,10 @@ main(void) } if (*cmd) { - if (parse()) - autoboot = 0; if (!OPT_CHECK(RBX_QUIET)) printf("%s: %s", PATH_CONFIG, cmd); + if (parse()) + autoboot = 0; /* Do not process this command twice */ *cmd = 0; } From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 15 22:02:36 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 493B9106566C; Sun, 15 Jan 2012 22:02:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2857A8FC17; Sun, 15 Jan 2012 22:02: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 q0FM2aOZ002307; Sun, 15 Jan 2012 22:02:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FM2ZAt002302; Sun, 15 Jan 2012 22:02:36 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201201152202.q0FM2ZAt002302@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 Jan 2012 22:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230168 - in stable/8/sys: kern security/mac X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 22:02:36 -0000 Author: avg Date: Sun Jan 15 22:02:35 2012 New Revision: 230168 URL: http://svn.freebsd.org/changeset/base/230168 Log: MFC r228433: put sys/systm.h at its proper place or add it if missing Modified: stable/8/sys/kern/kern_sx.c stable/8/sys/kern/vfs_cache.c stable/8/sys/security/mac/mac_framework.c stable/8/sys/security/mac/mac_priv.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_sx.c ============================================================================== --- stable/8/sys/kern/kern_sx.c Sun Jan 15 21:58:51 2012 (r230167) +++ stable/8/sys/kern/kern_sx.c Sun Jan 15 22:02:35 2012 (r230168) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -51,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #if defined(SMP) && !defined(NO_ADAPTIVE_SX) #include Modified: stable/8/sys/kern/vfs_cache.c ============================================================================== --- stable/8/sys/kern/vfs_cache.c Sun Jan 15 21:58:51 2012 (r230167) +++ stable/8/sys/kern/vfs_cache.c Sun Jan 15 22:02:35 2012 (r230168) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ktrace.h" #include +#include #include #include #include @@ -52,7 +53,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #ifdef KTRACE #include Modified: stable/8/sys/security/mac/mac_framework.c ============================================================================== --- stable/8/sys/security/mac/mac_framework.c Sun Jan 15 21:58:51 2012 (r230167) +++ stable/8/sys/security/mac/mac_framework.c Sun Jan 15 22:02:35 2012 (r230168) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -81,7 +82,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/8/sys/security/mac/mac_priv.c ============================================================================== --- stable/8/sys/security/mac/mac_priv.c Sun Jan 15 21:58:51 2012 (r230167) +++ stable/8/sys/security/mac/mac_priv.c Sun Jan 15 22:02:35 2012 (r230168) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include "opt_mac.h" #include +#include #include #include #include From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 15 22:05:16 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 547441065670; Sun, 15 Jan 2012 22:05:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3ED8A8FC12; Sun, 15 Jan 2012 22:05: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 q0FM5GFU002491; Sun, 15 Jan 2012 22:05:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FM5Gbr002488; Sun, 15 Jan 2012 22:05:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201201152205.q0FM5Gbr002488@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 Jan 2012 22:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230170 - stable/8/sys/dev/syscons X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 22:05:16 -0000 Author: avg Date: Sun Jan 15 22:05:15 2012 New Revision: 230170 URL: http://svn.freebsd.org/changeset/base/230170 Log: MFC r228426: syscons: make sc_puts static as it is used only privately Modified: stable/8/sys/dev/syscons/syscons.c stable/8/sys/dev/syscons/syscons.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/syscons/syscons.c ============================================================================== --- stable/8/sys/dev/syscons/syscons.c Sun Jan 15 22:04:28 2012 (r230169) +++ stable/8/sys/dev/syscons/syscons.c Sun Jan 15 22:05:15 2012 (r230170) @@ -172,6 +172,7 @@ static scr_stat *sc_get_stat(struct tty static void scterm(int unit, int flags); static void scshutdown(void *arg, int howto); static u_int scgetc(sc_softc_t *sc, u_int flags); +static void sc_puts(scr_stat *scp, u_char *buf, int len, int kernel); #define SCGETC_CN 1 #define SCGETC_NONBLOCK 2 static void sccnupdate(scr_stat *scp); @@ -2553,7 +2554,7 @@ exchange_scr(sc_softc_t *sc) mark_all(scp); } -void +static void sc_puts(scr_stat *scp, u_char *buf, int len, int kernel) { int need_unlock = 0; Modified: stable/8/sys/dev/syscons/syscons.h ============================================================================== --- stable/8/sys/dev/syscons/syscons.h Sun Jan 15 22:04:28 2012 (r230169) +++ stable/8/sys/dev/syscons/syscons.h Sun Jan 15 22:05:15 2012 (r230170) @@ -557,7 +557,6 @@ void sc_save_font(scr_stat *scp, int pa void sc_show_font(scr_stat *scp, int page); void sc_touch_scrn_saver(void); -void sc_puts(scr_stat *scp, u_char *buf, int len, int kernel); void sc_draw_cursor_image(scr_stat *scp); void sc_remove_cursor_image(scr_stat *scp); void sc_set_cursor_image(scr_stat *scp); From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 15 22:08:44 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD930106564A; Sun, 15 Jan 2012 22:08:44 +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 C7BEA8FC0C; Sun, 15 Jan 2012 22:08: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 q0FM8ieQ002695; Sun, 15 Jan 2012 22:08:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FM8iSj002693; Sun, 15 Jan 2012 22:08:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201201152208.q0FM8iSj002693@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 Jan 2012 22:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230172 - stable/8/sys/cddl/compat/opensolaris/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 22:08:45 -0000 Author: avg Date: Sun Jan 15 22:08:44 2012 New Revision: 230172 URL: http://svn.freebsd.org/changeset/base/230172 Log: MFC r228710: opensolaris compat: fix vcmn_err so that panic(9) produces a proper message Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Sun Jan 15 22:07:14 2012 (r230171) +++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Sun Jan 15 22:08:44 2012 (r230172) @@ -28,29 +28,35 @@ void vcmn_err(int ce, const char *fmt, va_list adx) { char buf[256]; + const char *prefix; + prefix = NULL; /* silence unwitty compilers */ switch (ce) { case CE_CONT: - snprintf(buf, sizeof(buf), "Solaris(cont): %s\n", fmt); + prefix = "Solaris(cont): "; break; case CE_NOTE: - snprintf(buf, sizeof(buf), "Solaris: NOTICE: %s\n", fmt); + prefix = "Solaris: NOTICE: "; break; case CE_WARN: - snprintf(buf, sizeof(buf), "Solaris: WARNING: %s\n", fmt); + prefix = "Solaris: WARNING: "; break; case CE_PANIC: - snprintf(buf, sizeof(buf), "Solaris(panic): %s\n", fmt); + prefix = "Solaris(panic): "; break; case CE_IGNORE: break; default: panic("Solaris: unknown severity level"); } - if (ce == CE_PANIC) - panic("%s", buf); - if (ce != CE_IGNORE) - vprintf(buf, adx); + if (ce == CE_PANIC) { + vsnprintf(buf, sizeof(buf), fmt, adx); + panic("%s%s", prefix, buf); + } + if (ce != CE_IGNORE) { + printf("%s", prefix); + vprintf(fmt, adx); + } } void From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 15 22:18:54 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7832106566C; Sun, 15 Jan 2012 22:18:54 +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 D0C818FC12; Sun, 15 Jan 2012 22:18: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 q0FMIsZi003168; Sun, 15 Jan 2012 22:18:54 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FMIsMS003166; Sun, 15 Jan 2012 22:18:54 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201201152218.q0FMIsMS003166@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 Jan 2012 22:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230174 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 22:18:55 -0000 Author: avg Date: Sun Jan 15 22:18:54 2012 New Revision: 230174 URL: http://svn.freebsd.org/changeset/base/230174 Log: MFC r228718: ule: ensure that batch timeshare threads are scheduled fairly Modified: stable/8/sys/kern/sched_ule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Sun Jan 15 22:10:35 2012 (r230173) +++ stable/8/sys/kern/sched_ule.c Sun Jan 15 22:18:54 2012 (r230174) @@ -62,10 +62,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef KTRACE -#include -#include -#endif #ifdef HWPMC_HOOKS #include @@ -80,7 +76,7 @@ dtrace_vtime_switch_func_t dtrace_vtime_ #include #include -#if defined(__sparc64__) +#if defined(__powerpc__) && defined(E500) #error "This architecture is not currently compatible with ULE" #endif @@ -88,7 +84,7 @@ dtrace_vtime_switch_func_t dtrace_vtime_ #define TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__XSTRING(UINT_MAX))) #define TDQ_NAME_LEN (sizeof("sched lock ") + sizeof(__XSTRING(MAXCPU))) -#define TDQ_LOADNAME_LEN (PCPU_NAME_LEN + sizeof(" load")) +#define TDQ_LOADNAME_LEN (sizeof("CPU ") + sizeof(__XSTRING(MAXCPU)) - 1 + sizeof(" load")) /* * Thread scheduler specific section. All fields are protected @@ -122,11 +118,17 @@ static struct td_sched td_sched0; /* * Priority ranges used for interactive and non-interactive timeshare - * threads. Interactive threads use realtime priorities. - */ -#define PRI_MIN_INTERACT PRI_MIN_REALTIME -#define PRI_MAX_INTERACT PRI_MAX_REALTIME -#define PRI_MIN_BATCH PRI_MIN_TIMESHARE + * threads. The timeshare priorities are split up into four ranges. + * The first range handles interactive threads. The last three ranges + * (NHALF, x, and NHALF) handle non-interactive threads with the outer + * ranges supporting nice values. + */ +#define PRI_TIMESHARE_RANGE (PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE + 1) +#define PRI_INTERACT_RANGE ((PRI_TIMESHARE_RANGE - SCHED_PRI_NRESV) / 2) + +#define PRI_MIN_INTERACT PRI_MIN_TIMESHARE +#define PRI_MAX_INTERACT (PRI_MIN_TIMESHARE + PRI_INTERACT_RANGE - 1) +#define PRI_MIN_BATCH (PRI_MIN_TIMESHARE + PRI_INTERACT_RANGE) #define PRI_MAX_BATCH PRI_MAX_TIMESHARE /* @@ -209,7 +211,7 @@ static int preempt_thresh = 0; #endif static int static_boost = PRI_MIN_BATCH; static int sched_idlespins = 10000; -static int sched_idlespinthresh = 4; +static int sched_idlespinthresh = 16; /* * tdq - per processor runqs and statistics. All fields are protected by the @@ -221,6 +223,7 @@ struct tdq { struct mtx tdq_lock; /* run queue lock. */ struct cpu_group *tdq_cg; /* Pointer to cpu topology. */ volatile int tdq_load; /* Aggregate load. */ + volatile int tdq_cpu_idle; /* cpu_idle() is active. */ int tdq_sysload; /* For loadavg, !ITHD load. */ int tdq_transferable; /* Transferable thread count. */ short tdq_switchcnt; /* Switches this tick. */ @@ -561,7 +564,7 @@ struct cpu_search { #define CPUSET_FOREACH(cpu, mask) \ for ((cpu) = 0; (cpu) <= mp_maxid; (cpu)++) \ - if ((mask) & 1 << (cpu)) + if (CPU_ISSET(cpu, &mask)) static __inline int cpu_search(struct cpu_group *cg, struct cpu_search *low, struct cpu_search *high, const int match); @@ -836,6 +839,7 @@ sched_balance_pair(struct tdq *high, str int low_load; int moved; int move; + int cpu; int diff; int i; @@ -857,10 +861,14 @@ sched_balance_pair(struct tdq *high, str for (i = 0; i < move; i++) moved += tdq_move(high, low); /* - * IPI the target cpu to force it to reschedule with the new - * workload. + * In case the target isn't the current cpu IPI it to force a + * reschedule with the new workload. */ - ipi_cpu(TDQ_ID(low), IPI_PREEMPT); + cpu = TDQ_ID(low); + sched_pin(); + if (cpu != PCPU_GET(cpuid)) + ipi_cpu(cpu, IPI_PREEMPT); + sched_unpin(); } tdq_unlock_pair(high, low); return (moved); @@ -979,7 +987,7 @@ tdq_notify(struct tdq *tdq, struct threa * If the MD code has an idle wakeup routine try that before * falling back to IPI. */ - if (cpu_idle_wakeup(cpu)) + if (!tdq->tdq_cpu_idle || cpu_idle_wakeup(cpu)) return; } tdq->tdq_ipipending = 1; @@ -1426,8 +1434,7 @@ sched_priority(struct thread *td) } else { pri = SCHED_PRI_MIN; if (td->td_sched->ts_ticks) - pri += min(SCHED_PRI_TICKS(td->td_sched), - SCHED_PRI_RANGE); + pri += SCHED_PRI_TICKS(td->td_sched); pri += SCHED_PRI_NICE(td->td_proc->p_nice); KASSERT(pri >= PRI_MIN_BATCH && pri <= PRI_MAX_BATCH, ("sched_priority: invalid priority %d: nice %d, " @@ -1688,39 +1695,24 @@ sched_prio(struct thread *td, u_char pri void sched_user_prio(struct thread *td, u_char prio) { - u_char oldprio; td->td_base_user_pri = prio; - if (td->td_flags & TDF_UBORROWING && td->td_user_pri <= prio) - return; - oldprio = td->td_user_pri; + if (td->td_lend_user_pri <= prio) + return; td->td_user_pri = prio; } void sched_lend_user_prio(struct thread *td, u_char prio) { - u_char oldprio; THREAD_LOCK_ASSERT(td, MA_OWNED); - td->td_flags |= TDF_UBORROWING; - oldprio = td->td_user_pri; - td->td_user_pri = prio; -} - -void -sched_unlend_user_prio(struct thread *td, u_char prio) -{ - u_char base_pri; - - THREAD_LOCK_ASSERT(td, MA_OWNED); - base_pri = td->td_base_user_pri; - if (prio >= base_pri) { - td->td_flags &= ~TDF_UBORROWING; - sched_user_prio(td, base_pri); - } else { - sched_lend_user_prio(td, prio); - } + td->td_lend_user_pri = prio; + td->td_user_pri = min(prio, td->td_base_user_pri); + if (td->td_priority > td->td_user_pri) + sched_prio(td, td->td_user_pri); + else if (td->td_priority != td->td_user_pri) + td->td_flags |= TDF_NEEDRESCHED; } /* @@ -1913,6 +1905,8 @@ sched_sleep(struct thread *td, int prio) td->td_slptick = ticks; if (TD_IS_SUSPENDED(td) || prio >= PSOCK) td->td_flags |= TDF_CANSWAP; + if (PRI_BASE(td->td_pri_class) != PRI_TIMESHARE) + return; if (static_boost == 1 && prio) sched_prio(td, prio); else if (static_boost && td->td_priority > static_boost) @@ -2179,7 +2173,7 @@ sched_clock(struct thread *td) * is easier than trying to scale based on stathz. */ void -sched_tick(void) +sched_tick(int cnt) { struct td_sched *ts; @@ -2191,7 +2185,7 @@ sched_tick(void) if (ts->ts_incrtick == ticks) return; /* Adjust ticks for pctcpu */ - ts->ts_ticks += 1 << SCHED_TICK_SHIFT; + ts->ts_ticks += cnt << SCHED_TICK_SHIFT; ts->ts_ltick = ticks; ts->ts_incrtick = ticks; /* @@ -2562,8 +2556,14 @@ sched_idletd(void *dummy) } } switchcnt = tdq->tdq_switchcnt + tdq->tdq_oldswitchcnt; - if (tdq->tdq_load == 0) - cpu_idle(switchcnt > 1); + if (tdq->tdq_load == 0) { + tdq->tdq_cpu_idle = 1; + if (tdq->tdq_load == 0) { + cpu_idle(switchcnt > sched_idlespinthresh * 4); + tdq->tdq_switchcnt++; + } + tdq->tdq_cpu_idle = 0; + } if (tdq->tdq_load) { thread_lock(td); mi_switch(SW_VOL | SWT_IDLE, NULL); @@ -2586,8 +2586,6 @@ sched_throw(struct thread *td) /* Correct spinlock nesting and acquire the correct lock. */ TDQ_LOCK(tdq); spinlock_exit(); - PCPU_SET(switchtime, cpu_ticks()); - PCPU_SET(switchticks, ticks); } else { MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); tdq_load_rem(tdq, td); @@ -2596,6 +2594,8 @@ sched_throw(struct thread *td) KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count")); newtd = choosethread(); TDQ_LOCKPTR(tdq)->mtx_lock = (uintptr_t)newtd; + PCPU_SET(switchtime, cpu_ticks()); + PCPU_SET(switchticks, ticks); cpu_throw(td, newtd); /* doesn't return */ } @@ -2655,15 +2655,16 @@ static int sysctl_kern_sched_topology_spec_internal(struct sbuf *sb, struct cpu_group *cg, int indent) { + char cpusetbuf[CPUSETBUFSIZ]; int i, first; sbuf_printf(sb, "%*s\n", indent, "", 1 + indent / 2, cg->cg_level); - sbuf_printf(sb, "%*s ", indent, "", - cg->cg_count, cg->cg_mask); + sbuf_printf(sb, "%*s ", indent, "", + cg->cg_count, cpusetobj_strprint(cpusetbuf, &cg->cg_mask)); first = TRUE; for (i = 0; i < MAXCPU; i++) { - if ((cg->cg_mask & (1 << i)) != 0) { + if (CPU_ISSET(i, &cg->cg_mask)) { if (!first) sbuf_printf(sb, ", "); else @@ -2722,6 +2723,7 @@ sysctl_kern_sched_topology_spec(SYSCTL_H sbuf_delete(topo); return (err); } + #endif SYSCTL_NODE(_kern, OID_AUTO, sched, CTLFLAG_RW, 0, "Scheduler"); @@ -2758,6 +2760,7 @@ SYSCTL_INT(_kern_sched, OID_AUTO, steal_ SYSCTL_PROC(_kern_sched, OID_AUTO, topology_spec, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, sysctl_kern_sched_topology_spec, "A", "XML dump of detected CPU topology"); + #endif /* ps compat. All cpu percentages from ULE are weighted. */ From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 15 22:23:42 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CDC51065795; Sun, 15 Jan 2012 22:23:42 +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 27AA38FC28; Sun, 15 Jan 2012 22:23: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 q0FMNgJb003424; Sun, 15 Jan 2012 22:23:42 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FMNg0Y003422; Sun, 15 Jan 2012 22:23:42 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201201152223.q0FMNg0Y003422@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 Jan 2012 22:23:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230176 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 22:23:42 -0000 Author: avg Date: Sun Jan 15 22:23:41 2012 New Revision: 230176 URL: http://svn.freebsd.org/changeset/base/230176 Log: MFC r228265: critical_exit: ignore td_owepreempt if kdb_active is set Modified: stable/8/sys/kern/kern_switch.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_switch.c ============================================================================== --- stable/8/sys/kern/kern_switch.c Sun Jan 15 22:20:52 2012 (r230175) +++ stable/8/sys/kern/kern_switch.c Sun Jan 15 22:23:41 2012 (r230176) @@ -200,7 +200,7 @@ critical_exit(void) if (td->td_critnest == 1) { td->td_critnest = 0; - if (td->td_owepreempt) { + if (td->td_owepreempt && !kdb_active) { td->td_critnest = 1; thread_lock(td); td->td_critnest--; From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 15 22:42:06 2012 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 04A4D106566C; Sun, 15 Jan 2012 22:42:06 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id D6AFD14DC1A; Sun, 15 Jan 2012 22:42:04 +0000 (UTC) Message-ID: <4F13563C.8060108@FreeBSD.org> Date: Sun, 15 Jan 2012 14:42:04 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Andriy Gapon References: <201201152218.q0FMIsMS003166@svn.freebsd.org> <4F1354FA.1070300@FreeBSD.org> In-Reply-To: <4F1354FA.1070300@FreeBSD.org> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r230174 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 22:42:06 -0000 On 01/15/2012 14:36, Andriy Gapon wrote: > What happened. There was a merge conflict. I initially chose the postpone > option. Then edited the file to get a correct merge. Then ran svn resolve. > It complained that it needed --accept option, so I used --accept=base. I didn't > do another svn diff after that before committing the change and that was my > mistake. Apparently svn resolve --accept=base changed the file. I'm pretty sure that after you've edited the file you want mine-full there, but the options to --accept confuse me as well (FWIW). hth, Doug -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 15 22:43:34 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 819BD1065675; Sun, 15 Jan 2012 22:43:34 +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 6B94C8FC0A; Sun, 15 Jan 2012 22:43:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0FMhYFp004132; Sun, 15 Jan 2012 22:43:34 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FMhYra004130; Sun, 15 Jan 2012 22:43:34 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201201152243.q0FMhYra004130@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 Jan 2012 22:43:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230177 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 22:43:34 -0000 Author: avg Date: Sun Jan 15 22:43:34 2012 New Revision: 230177 URL: http://svn.freebsd.org/changeset/base/230177 Log: Revert r230174, a botched MFC This is a direct commit to the branch for obvious reasons. Pointyhat to: avg Modified: stable/8/sys/kern/sched_ule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Sun Jan 15 22:23:41 2012 (r230176) +++ stable/8/sys/kern/sched_ule.c Sun Jan 15 22:43:34 2012 (r230177) @@ -62,6 +62,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef KTRACE +#include +#include +#endif #ifdef HWPMC_HOOKS #include @@ -76,7 +80,7 @@ dtrace_vtime_switch_func_t dtrace_vtime_ #include #include -#if defined(__powerpc__) && defined(E500) +#if defined(__sparc64__) #error "This architecture is not currently compatible with ULE" #endif @@ -84,7 +88,7 @@ dtrace_vtime_switch_func_t dtrace_vtime_ #define TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__XSTRING(UINT_MAX))) #define TDQ_NAME_LEN (sizeof("sched lock ") + sizeof(__XSTRING(MAXCPU))) -#define TDQ_LOADNAME_LEN (sizeof("CPU ") + sizeof(__XSTRING(MAXCPU)) - 1 + sizeof(" load")) +#define TDQ_LOADNAME_LEN (PCPU_NAME_LEN + sizeof(" load")) /* * Thread scheduler specific section. All fields are protected @@ -118,17 +122,11 @@ static struct td_sched td_sched0; /* * Priority ranges used for interactive and non-interactive timeshare - * threads. The timeshare priorities are split up into four ranges. - * The first range handles interactive threads. The last three ranges - * (NHALF, x, and NHALF) handle non-interactive threads with the outer - * ranges supporting nice values. - */ -#define PRI_TIMESHARE_RANGE (PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE + 1) -#define PRI_INTERACT_RANGE ((PRI_TIMESHARE_RANGE - SCHED_PRI_NRESV) / 2) - -#define PRI_MIN_INTERACT PRI_MIN_TIMESHARE -#define PRI_MAX_INTERACT (PRI_MIN_TIMESHARE + PRI_INTERACT_RANGE - 1) -#define PRI_MIN_BATCH (PRI_MIN_TIMESHARE + PRI_INTERACT_RANGE) + * threads. Interactive threads use realtime priorities. + */ +#define PRI_MIN_INTERACT PRI_MIN_REALTIME +#define PRI_MAX_INTERACT PRI_MAX_REALTIME +#define PRI_MIN_BATCH PRI_MIN_TIMESHARE #define PRI_MAX_BATCH PRI_MAX_TIMESHARE /* @@ -211,7 +209,7 @@ static int preempt_thresh = 0; #endif static int static_boost = PRI_MIN_BATCH; static int sched_idlespins = 10000; -static int sched_idlespinthresh = 16; +static int sched_idlespinthresh = 4; /* * tdq - per processor runqs and statistics. All fields are protected by the @@ -223,7 +221,6 @@ struct tdq { struct mtx tdq_lock; /* run queue lock. */ struct cpu_group *tdq_cg; /* Pointer to cpu topology. */ volatile int tdq_load; /* Aggregate load. */ - volatile int tdq_cpu_idle; /* cpu_idle() is active. */ int tdq_sysload; /* For loadavg, !ITHD load. */ int tdq_transferable; /* Transferable thread count. */ short tdq_switchcnt; /* Switches this tick. */ @@ -564,7 +561,7 @@ struct cpu_search { #define CPUSET_FOREACH(cpu, mask) \ for ((cpu) = 0; (cpu) <= mp_maxid; (cpu)++) \ - if (CPU_ISSET(cpu, &mask)) + if ((mask) & 1 << (cpu)) static __inline int cpu_search(struct cpu_group *cg, struct cpu_search *low, struct cpu_search *high, const int match); @@ -839,7 +836,6 @@ sched_balance_pair(struct tdq *high, str int low_load; int moved; int move; - int cpu; int diff; int i; @@ -861,14 +857,10 @@ sched_balance_pair(struct tdq *high, str for (i = 0; i < move; i++) moved += tdq_move(high, low); /* - * In case the target isn't the current cpu IPI it to force a - * reschedule with the new workload. + * IPI the target cpu to force it to reschedule with the new + * workload. */ - cpu = TDQ_ID(low); - sched_pin(); - if (cpu != PCPU_GET(cpuid)) - ipi_cpu(cpu, IPI_PREEMPT); - sched_unpin(); + ipi_cpu(TDQ_ID(low), IPI_PREEMPT); } tdq_unlock_pair(high, low); return (moved); @@ -987,7 +979,7 @@ tdq_notify(struct tdq *tdq, struct threa * If the MD code has an idle wakeup routine try that before * falling back to IPI. */ - if (!tdq->tdq_cpu_idle || cpu_idle_wakeup(cpu)) + if (cpu_idle_wakeup(cpu)) return; } tdq->tdq_ipipending = 1; @@ -1434,7 +1426,8 @@ sched_priority(struct thread *td) } else { pri = SCHED_PRI_MIN; if (td->td_sched->ts_ticks) - pri += SCHED_PRI_TICKS(td->td_sched); + pri += min(SCHED_PRI_TICKS(td->td_sched), + SCHED_PRI_RANGE); pri += SCHED_PRI_NICE(td->td_proc->p_nice); KASSERT(pri >= PRI_MIN_BATCH && pri <= PRI_MAX_BATCH, ("sched_priority: invalid priority %d: nice %d, " @@ -1695,24 +1688,39 @@ sched_prio(struct thread *td, u_char pri void sched_user_prio(struct thread *td, u_char prio) { + u_char oldprio; td->td_base_user_pri = prio; - if (td->td_lend_user_pri <= prio) - return; + if (td->td_flags & TDF_UBORROWING && td->td_user_pri <= prio) + return; + oldprio = td->td_user_pri; td->td_user_pri = prio; } void sched_lend_user_prio(struct thread *td, u_char prio) { + u_char oldprio; THREAD_LOCK_ASSERT(td, MA_OWNED); - td->td_lend_user_pri = prio; - td->td_user_pri = min(prio, td->td_base_user_pri); - if (td->td_priority > td->td_user_pri) - sched_prio(td, td->td_user_pri); - else if (td->td_priority != td->td_user_pri) - td->td_flags |= TDF_NEEDRESCHED; + td->td_flags |= TDF_UBORROWING; + oldprio = td->td_user_pri; + td->td_user_pri = prio; +} + +void +sched_unlend_user_prio(struct thread *td, u_char prio) +{ + u_char base_pri; + + THREAD_LOCK_ASSERT(td, MA_OWNED); + base_pri = td->td_base_user_pri; + if (prio >= base_pri) { + td->td_flags &= ~TDF_UBORROWING; + sched_user_prio(td, base_pri); + } else { + sched_lend_user_prio(td, prio); + } } /* @@ -1905,8 +1913,6 @@ sched_sleep(struct thread *td, int prio) td->td_slptick = ticks; if (TD_IS_SUSPENDED(td) || prio >= PSOCK) td->td_flags |= TDF_CANSWAP; - if (PRI_BASE(td->td_pri_class) != PRI_TIMESHARE) - return; if (static_boost == 1 && prio) sched_prio(td, prio); else if (static_boost && td->td_priority > static_boost) @@ -2173,7 +2179,7 @@ sched_clock(struct thread *td) * is easier than trying to scale based on stathz. */ void -sched_tick(int cnt) +sched_tick(void) { struct td_sched *ts; @@ -2185,7 +2191,7 @@ sched_tick(int cnt) if (ts->ts_incrtick == ticks) return; /* Adjust ticks for pctcpu */ - ts->ts_ticks += cnt << SCHED_TICK_SHIFT; + ts->ts_ticks += 1 << SCHED_TICK_SHIFT; ts->ts_ltick = ticks; ts->ts_incrtick = ticks; /* @@ -2556,14 +2562,8 @@ sched_idletd(void *dummy) } } switchcnt = tdq->tdq_switchcnt + tdq->tdq_oldswitchcnt; - if (tdq->tdq_load == 0) { - tdq->tdq_cpu_idle = 1; - if (tdq->tdq_load == 0) { - cpu_idle(switchcnt > sched_idlespinthresh * 4); - tdq->tdq_switchcnt++; - } - tdq->tdq_cpu_idle = 0; - } + if (tdq->tdq_load == 0) + cpu_idle(switchcnt > 1); if (tdq->tdq_load) { thread_lock(td); mi_switch(SW_VOL | SWT_IDLE, NULL); @@ -2586,6 +2586,8 @@ sched_throw(struct thread *td) /* Correct spinlock nesting and acquire the correct lock. */ TDQ_LOCK(tdq); spinlock_exit(); + PCPU_SET(switchtime, cpu_ticks()); + PCPU_SET(switchticks, ticks); } else { MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); tdq_load_rem(tdq, td); @@ -2594,8 +2596,6 @@ sched_throw(struct thread *td) KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count")); newtd = choosethread(); TDQ_LOCKPTR(tdq)->mtx_lock = (uintptr_t)newtd; - PCPU_SET(switchtime, cpu_ticks()); - PCPU_SET(switchticks, ticks); cpu_throw(td, newtd); /* doesn't return */ } @@ -2655,16 +2655,15 @@ static int sysctl_kern_sched_topology_spec_internal(struct sbuf *sb, struct cpu_group *cg, int indent) { - char cpusetbuf[CPUSETBUFSIZ]; int i, first; sbuf_printf(sb, "%*s\n", indent, "", 1 + indent / 2, cg->cg_level); - sbuf_printf(sb, "%*s ", indent, "", - cg->cg_count, cpusetobj_strprint(cpusetbuf, &cg->cg_mask)); + sbuf_printf(sb, "%*s ", indent, "", + cg->cg_count, cg->cg_mask); first = TRUE; for (i = 0; i < MAXCPU; i++) { - if (CPU_ISSET(i, &cg->cg_mask)) { + if ((cg->cg_mask & (1 << i)) != 0) { if (!first) sbuf_printf(sb, ", "); else @@ -2723,7 +2722,6 @@ sysctl_kern_sched_topology_spec(SYSCTL_H sbuf_delete(topo); return (err); } - #endif SYSCTL_NODE(_kern, OID_AUTO, sched, CTLFLAG_RW, 0, "Scheduler"); @@ -2760,7 +2758,6 @@ SYSCTL_INT(_kern_sched, OID_AUTO, steal_ SYSCTL_PROC(_kern_sched, OID_AUTO, topology_spec, CTLTYPE_STRING | CTLFLAG_RD, NULL, 0, sysctl_kern_sched_topology_spec, "A", "XML dump of detected CPU topology"); - #endif /* ps compat. All cpu percentages from ULE are weighted. */ From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 15 22:47:50 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52C43106564A; Sun, 15 Jan 2012 22:47:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D8358FC0A; Sun, 15 Jan 2012 22:47: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 q0FMlo6m004316; Sun, 15 Jan 2012 22:47:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0FMloZ7004314; Sun, 15 Jan 2012 22:47:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201201152247.q0FMloZ7004314@svn.freebsd.org> From: Andriy Gapon Date: Sun, 15 Jan 2012 22:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230178 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 22:47:50 -0000 Author: avg Date: Sun Jan 15 22:47:49 2012 New Revision: 230178 URL: http://svn.freebsd.org/changeset/base/230178 Log: MFC r228718: ule: ensure that batch timeshare threads are scheduled fairly Second take. Modified: stable/8/sys/kern/sched_ule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Sun Jan 15 22:43:34 2012 (r230177) +++ stable/8/sys/kern/sched_ule.c Sun Jan 15 22:47:49 2012 (r230178) @@ -413,7 +413,6 @@ sched_shouldpreempt(int pri, int cpri, i return (0); } -#define TS_RQ_PPQ (((PRI_MAX_BATCH - PRI_MIN_BATCH) + 1) / RQ_NQS) /* * Add a thread to the actual run-queue. Keeps transferable counts up to * date with what is actually on the run-queue. Selects the correct @@ -446,7 +445,8 @@ tdq_runq_add(struct tdq *tdq, struct thr * realtime. Use the whole queue to represent these values. */ if ((flags & (SRQ_BORROWING|SRQ_PREEMPTED)) == 0) { - pri = (pri - PRI_MIN_BATCH) / TS_RQ_PPQ; + pri = RQ_NQS * (pri - PRI_MIN_BATCH) / + (PRI_MAX_BATCH - PRI_MIN_BATCH + 1); pri = (pri + tdq->tdq_idx) % RQ_NQS; /* * This effectively shortens the queue by one so we From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 15 22:53:39 2012 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 346B8106566C; Sun, 15 Jan 2012 22:53:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0B38FC08; Sun, 15 Jan 2012 22:53:37 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA11416; Mon, 16 Jan 2012 00:41:05 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RmYl7-000P8R-5F; Mon, 16 Jan 2012 00:41:05 +0200 Message-ID: <4F135600.1090004@FreeBSD.org> Date: Mon, 16 Jan 2012 00:41:04 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-stable-8@FreeBSD.org References: <201201152218.q0FMIsMS003166@svn.freebsd.org> <4F1354FA.1070300@FreeBSD.org> In-Reply-To: <4F1354FA.1070300@FreeBSD.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r230174 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 22:53:39 -0000 on 16/01/2012 00:36 Andriy Gapon said the following: > on 16/01/2012 00:18 Andriy Gapon said the following: >> Author: avg >> Date: Sun Jan 15 22:18:54 2012 >> New Revision: 230174 >> URL: http://svn.freebsd.org/changeset/base/230174 >> >> Log: >> MFC r228718: ule: ensure that batch timeshare threads are scheduled >> fairly > > Apologies, this commit is screwed up. > > What happened. There was a merge conflict. I initially chose the postpone > option. Then edited the file to get a correct merge. Then ran svn resolve. > It complained that it needed --accept option, so I used --accept=base. I didn't > do another svn diff after that before committing the change and that was my > mistake. Apparently svn resolve --accept=base changed the file. A shorter version: I used svn resolve instead of svn resolved and even having to specify the --accept option didn't alert me to my mistake. Sigh. -- Andriy Gapon From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 15 22:53:40 2012 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D411B106564A; Sun, 15 Jan 2012 22:53:40 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 036DA8FC0A; Sun, 15 Jan 2012 22:53:39 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA11389; Mon, 16 Jan 2012 00:36:44 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RmYgu-000P8B-2n; Mon, 16 Jan 2012 00:36:44 +0200 Message-ID: <4F1354FA.1070300@FreeBSD.org> Date: Mon, 16 Jan 2012 00:36:42 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable@FreeBSD.org, svn-src-stable-8@FreeBSD.org References: <201201152218.q0FMIsMS003166@svn.freebsd.org> In-Reply-To: <201201152218.q0FMIsMS003166@svn.freebsd.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r230174 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 22:53:41 -0000 on 16/01/2012 00:18 Andriy Gapon said the following: > Author: avg > Date: Sun Jan 15 22:18:54 2012 > New Revision: 230174 > URL: http://svn.freebsd.org/changeset/base/230174 > > Log: > MFC r228718: ule: ensure that batch timeshare threads are scheduled > fairly Apologies, this commit is screwed up. What happened. There was a merge conflict. I initially chose the postpone option. Then edited the file to get a correct merge. Then ran svn resolve. It complained that it needed --accept option, so I used --accept=base. I didn't do another svn diff after that before committing the change and that was my mistake. Apparently svn resolve --accept=base changed the file. > Modified: > stable/8/sys/kern/sched_ule.c > Directory Properties: > stable/8/sys/ (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) > > Modified: stable/8/sys/kern/sched_ule.c > ============================================================================== > --- stable/8/sys/kern/sched_ule.c Sun Jan 15 22:10:35 2012 (r230173) > +++ stable/8/sys/kern/sched_ule.c Sun Jan 15 22:18:54 2012 (r230174) > @@ -62,10 +62,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#ifdef KTRACE > -#include > -#include > -#endif > > #ifdef HWPMC_HOOKS > #include > @@ -80,7 +76,7 @@ dtrace_vtime_switch_func_t dtrace_vtime_ > #include > #include > > -#if defined(__sparc64__) > +#if defined(__powerpc__) && defined(E500) > #error "This architecture is not currently compatible with ULE" > #endif > > @@ -88,7 +84,7 @@ dtrace_vtime_switch_func_t dtrace_vtime_ > > #define TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__XSTRING(UINT_MAX))) > #define TDQ_NAME_LEN (sizeof("sched lock ") + sizeof(__XSTRING(MAXCPU))) > -#define TDQ_LOADNAME_LEN (PCPU_NAME_LEN + sizeof(" load")) > +#define TDQ_LOADNAME_LEN (sizeof("CPU ") + sizeof(__XSTRING(MAXCPU)) - 1 + sizeof(" load")) > > /* > * Thread scheduler specific section. All fields are protected > @@ -122,11 +118,17 @@ static struct td_sched td_sched0; > > /* > * Priority ranges used for interactive and non-interactive timeshare > - * threads. Interactive threads use realtime priorities. > - */ > -#define PRI_MIN_INTERACT PRI_MIN_REALTIME > -#define PRI_MAX_INTERACT PRI_MAX_REALTIME > -#define PRI_MIN_BATCH PRI_MIN_TIMESHARE > + * threads. The timeshare priorities are split up into four ranges. > + * The first range handles interactive threads. The last three ranges > + * (NHALF, x, and NHALF) handle non-interactive threads with the outer > + * ranges supporting nice values. > + */ > +#define PRI_TIMESHARE_RANGE (PRI_MAX_TIMESHARE - PRI_MIN_TIMESHARE + 1) > +#define PRI_INTERACT_RANGE ((PRI_TIMESHARE_RANGE - SCHED_PRI_NRESV) / 2) > + > +#define PRI_MIN_INTERACT PRI_MIN_TIMESHARE > +#define PRI_MAX_INTERACT (PRI_MIN_TIMESHARE + PRI_INTERACT_RANGE - 1) > +#define PRI_MIN_BATCH (PRI_MIN_TIMESHARE + PRI_INTERACT_RANGE) > #define PRI_MAX_BATCH PRI_MAX_TIMESHARE > > /* > @@ -209,7 +211,7 @@ static int preempt_thresh = 0; > #endif > static int static_boost = PRI_MIN_BATCH; > static int sched_idlespins = 10000; > -static int sched_idlespinthresh = 4; > +static int sched_idlespinthresh = 16; > > /* > * tdq - per processor runqs and statistics. All fields are protected by the > @@ -221,6 +223,7 @@ struct tdq { > struct mtx tdq_lock; /* run queue lock. */ > struct cpu_group *tdq_cg; /* Pointer to cpu topology. */ > volatile int tdq_load; /* Aggregate load. */ > + volatile int tdq_cpu_idle; /* cpu_idle() is active. */ > int tdq_sysload; /* For loadavg, !ITHD load. */ > int tdq_transferable; /* Transferable thread count. */ > short tdq_switchcnt; /* Switches this tick. */ > @@ -561,7 +564,7 @@ struct cpu_search { > > #define CPUSET_FOREACH(cpu, mask) \ > for ((cpu) = 0; (cpu) <= mp_maxid; (cpu)++) \ > - if ((mask) & 1 << (cpu)) > + if (CPU_ISSET(cpu, &mask)) > > static __inline int cpu_search(struct cpu_group *cg, struct cpu_search *low, > struct cpu_search *high, const int match); > @@ -836,6 +839,7 @@ sched_balance_pair(struct tdq *high, str > int low_load; > int moved; > int move; > + int cpu; > int diff; > int i; > > @@ -857,10 +861,14 @@ sched_balance_pair(struct tdq *high, str > for (i = 0; i < move; i++) > moved += tdq_move(high, low); > /* > - * IPI the target cpu to force it to reschedule with the new > - * workload. > + * In case the target isn't the current cpu IPI it to force a > + * reschedule with the new workload. > */ > - ipi_cpu(TDQ_ID(low), IPI_PREEMPT); > + cpu = TDQ_ID(low); > + sched_pin(); > + if (cpu != PCPU_GET(cpuid)) > + ipi_cpu(cpu, IPI_PREEMPT); > + sched_unpin(); > } > tdq_unlock_pair(high, low); > return (moved); > @@ -979,7 +987,7 @@ tdq_notify(struct tdq *tdq, struct threa > * If the MD code has an idle wakeup routine try that before > * falling back to IPI. > */ > - if (cpu_idle_wakeup(cpu)) > + if (!tdq->tdq_cpu_idle || cpu_idle_wakeup(cpu)) > return; > } > tdq->tdq_ipipending = 1; > @@ -1426,8 +1434,7 @@ sched_priority(struct thread *td) > } else { > pri = SCHED_PRI_MIN; > if (td->td_sched->ts_ticks) > - pri += min(SCHED_PRI_TICKS(td->td_sched), > - SCHED_PRI_RANGE); > + pri += SCHED_PRI_TICKS(td->td_sched); > pri += SCHED_PRI_NICE(td->td_proc->p_nice); > KASSERT(pri >= PRI_MIN_BATCH && pri <= PRI_MAX_BATCH, > ("sched_priority: invalid priority %d: nice %d, " > @@ -1688,39 +1695,24 @@ sched_prio(struct thread *td, u_char pri > void > sched_user_prio(struct thread *td, u_char prio) > { > - u_char oldprio; > > td->td_base_user_pri = prio; > - if (td->td_flags & TDF_UBORROWING && td->td_user_pri <= prio) > - return; > - oldprio = td->td_user_pri; > + if (td->td_lend_user_pri <= prio) > + return; > td->td_user_pri = prio; > } > > void > sched_lend_user_prio(struct thread *td, u_char prio) > { > - u_char oldprio; > > THREAD_LOCK_ASSERT(td, MA_OWNED); > - td->td_flags |= TDF_UBORROWING; > - oldprio = td->td_user_pri; > - td->td_user_pri = prio; > -} > - > -void > -sched_unlend_user_prio(struct thread *td, u_char prio) > -{ > - u_char base_pri; > - > - THREAD_LOCK_ASSERT(td, MA_OWNED); > - base_pri = td->td_base_user_pri; > - if (prio >= base_pri) { > - td->td_flags &= ~TDF_UBORROWING; > - sched_user_prio(td, base_pri); > - } else { > - sched_lend_user_prio(td, prio); > - } > + td->td_lend_user_pri = prio; > + td->td_user_pri = min(prio, td->td_base_user_pri); > + if (td->td_priority > td->td_user_pri) > + sched_prio(td, td->td_user_pri); > + else if (td->td_priority != td->td_user_pri) > + td->td_flags |= TDF_NEEDRESCHED; > } > > /* > @@ -1913,6 +1905,8 @@ sched_sleep(struct thread *td, int prio) > td->td_slptick = ticks; > if (TD_IS_SUSPENDED(td) || prio >= PSOCK) > td->td_flags |= TDF_CANSWAP; > + if (PRI_BASE(td->td_pri_class) != PRI_TIMESHARE) > + return; > if (static_boost == 1 && prio) > sched_prio(td, prio); > else if (static_boost && td->td_priority > static_boost) > @@ -2179,7 +2173,7 @@ sched_clock(struct thread *td) > * is easier than trying to scale based on stathz. > */ > void > -sched_tick(void) > +sched_tick(int cnt) > { > struct td_sched *ts; > > @@ -2191,7 +2185,7 @@ sched_tick(void) > if (ts->ts_incrtick == ticks) > return; > /* Adjust ticks for pctcpu */ > - ts->ts_ticks += 1 << SCHED_TICK_SHIFT; > + ts->ts_ticks += cnt << SCHED_TICK_SHIFT; > ts->ts_ltick = ticks; > ts->ts_incrtick = ticks; > /* > @@ -2562,8 +2556,14 @@ sched_idletd(void *dummy) > } > } > switchcnt = tdq->tdq_switchcnt + tdq->tdq_oldswitchcnt; > - if (tdq->tdq_load == 0) > - cpu_idle(switchcnt > 1); > + if (tdq->tdq_load == 0) { > + tdq->tdq_cpu_idle = 1; > + if (tdq->tdq_load == 0) { > + cpu_idle(switchcnt > sched_idlespinthresh * 4); > + tdq->tdq_switchcnt++; > + } > + tdq->tdq_cpu_idle = 0; > + } > if (tdq->tdq_load) { > thread_lock(td); > mi_switch(SW_VOL | SWT_IDLE, NULL); > @@ -2586,8 +2586,6 @@ sched_throw(struct thread *td) > /* Correct spinlock nesting and acquire the correct lock. */ > TDQ_LOCK(tdq); > spinlock_exit(); > - PCPU_SET(switchtime, cpu_ticks()); > - PCPU_SET(switchticks, ticks); > } else { > MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); > tdq_load_rem(tdq, td); > @@ -2596,6 +2594,8 @@ sched_throw(struct thread *td) > KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count")); > newtd = choosethread(); > TDQ_LOCKPTR(tdq)->mtx_lock = (uintptr_t)newtd; > + PCPU_SET(switchtime, cpu_ticks()); > + PCPU_SET(switchticks, ticks); > cpu_throw(td, newtd); /* doesn't return */ > } > > @@ -2655,15 +2655,16 @@ static int > sysctl_kern_sched_topology_spec_internal(struct sbuf *sb, struct cpu_group *cg, > int indent) > { > + char cpusetbuf[CPUSETBUFSIZ]; > int i, first; > > sbuf_printf(sb, "%*s\n", indent, > "", 1 + indent / 2, cg->cg_level); > - sbuf_printf(sb, "%*s ", indent, "", > - cg->cg_count, cg->cg_mask); > + sbuf_printf(sb, "%*s ", indent, "", > + cg->cg_count, cpusetobj_strprint(cpusetbuf, &cg->cg_mask)); > first = TRUE; > for (i = 0; i < MAXCPU; i++) { > - if ((cg->cg_mask & (1 << i)) != 0) { > + if (CPU_ISSET(i, &cg->cg_mask)) { > if (!first) > sbuf_printf(sb, ", "); > else > @@ -2722,6 +2723,7 @@ sysctl_kern_sched_topology_spec(SYSCTL_H > sbuf_delete(topo); > return (err); > } > + > #endif > > SYSCTL_NODE(_kern, OID_AUTO, sched, CTLFLAG_RW, 0, "Scheduler"); > @@ -2758,6 +2760,7 @@ SYSCTL_INT(_kern_sched, OID_AUTO, steal_ > SYSCTL_PROC(_kern_sched, OID_AUTO, topology_spec, CTLTYPE_STRING | > CTLFLAG_RD, NULL, 0, sysctl_kern_sched_topology_spec, "A", > "XML dump of detected CPU topology"); > + > #endif > > /* ps compat. All cpu percentages from ULE are weighted. */ -- Andriy Gapon From owner-svn-src-stable-8@FreeBSD.ORG Sun Jan 15 23:07:29 2012 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50C0C106564A; Sun, 15 Jan 2012 23:07:29 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id AAEC48FC12; Sun, 15 Jan 2012 23:07:28 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id B9EA81DDA7D; Mon, 16 Jan 2012 00:07:27 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id A11AB28468; Mon, 16 Jan 2012 00:07:27 +0100 (CET) Date: Mon, 16 Jan 2012 00:07:27 +0100 From: Jilles Tjoelker To: Doug Barton Message-ID: <20120115230727.GA67248@stack.nl> References: <201201152218.q0FMIsMS003166@svn.freebsd.org> <4F1354FA.1070300@FreeBSD.org> <4F13563C.8060108@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F13563C.8060108@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org, Andriy Gapon Subject: Re: svn commit: r230174 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 23:07:29 -0000 On Sun, Jan 15, 2012 at 02:42:04PM -0800, Doug Barton wrote: > On 01/15/2012 14:36, Andriy Gapon wrote: > > What happened. There was a merge conflict. I initially chose the > > postpone option. Then edited the file to get a correct merge. Then > > ran svn resolve. It complained that it needed --accept option, so I > > used --accept=base. I didn't do another svn diff after that before > > committing the change and that was my mistake. Apparently svn > > resolve --accept=base changed the file. > I'm pretty sure that after you've edited the file you want mine-full > there, but the options to --accept confuse me as well (FWIW). I think 'mine-full' means you want the version that was in the stable branch before the MFC. As shown in 'svn help resolved', the equivalent of 'svn resolved' is 'svn resolve --accept working'. I still prefer 'svn resolved' though as it is less typing :) I have also found the questions asked by 'svn merge' to be usable in many cases. -- Jilles Tjoelker From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 16 08:29:53 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E29C1065672; Mon, 16 Jan 2012 08:29:53 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 490028FC08; Mon, 16 Jan 2012 08:29:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0G8TrPF023915; Mon, 16 Jan 2012 08:29:53 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G8Trqk023906; Mon, 16 Jan 2012 08:29:53 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201201160829.q0G8Trqk023906@svn.freebsd.org> From: Kevin Lo Date: Mon, 16 Jan 2012 08:29:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230205 - in stable/8: lib/libkiconv sys/conf sys/fs/msdosfs sys/fs/smbfs sys/libkern sys/modules/libiconv sys/modules/libmchain sys/netsmb sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 08:29:53 -0000 Author: kevlo Date: Mon Jan 16 08:29:52 2012 New Revision: 230205 URL: http://svn.freebsd.org/changeset/base/230205 Log: MFC r228796: Discarding local array based on return values. MFC r227650: Add unicode support to msdosfs and smbfs; original pathes from imura, bug fixes by Kuan-Chung Chiu . Added: stable/8/sys/libkern/iconv_ucs.c (contents, props changed) Modified: stable/8/lib/libkiconv/xlat16_iconv.c stable/8/sys/conf/files stable/8/sys/fs/msdosfs/msdosfs_conv.c stable/8/sys/fs/smbfs/smbfs_smb.c stable/8/sys/fs/smbfs/smbfs_subr.c stable/8/sys/libkern/iconv.c stable/8/sys/modules/libiconv/Makefile stable/8/sys/modules/libmchain/Makefile stable/8/sys/netsmb/smb_conn.c stable/8/sys/netsmb/smb_conn.h stable/8/sys/netsmb/smb_smb.c stable/8/sys/netsmb/smb_subr.c stable/8/sys/sys/iconv.h stable/8/sys/sys/mchain.h Modified: stable/8/lib/libkiconv/xlat16_iconv.c ============================================================================== --- stable/8/lib/libkiconv/xlat16_iconv.c Mon Jan 16 08:13:25 2012 (r230204) +++ stable/8/lib/libkiconv/xlat16_iconv.c Mon Jan 16 08:29:52 2012 (r230205) @@ -74,6 +74,18 @@ kiconv_add_xlat16_cspair(const char *toc struct xlat16_table xt; void *data; char *p; + const char unicode[] = ENCODING_UNICODE; + + if ((flag & KICONV_WCTYPE) == 0 && + strcmp(unicode, tocode) != 0 && + strcmp(unicode, fromcode) != 0 && + kiconv_lookupconv(unicode) == 0) { + error = kiconv_add_xlat16_cspair(unicode, fromcode, flag); + if (error) + return (-1); + error = kiconv_add_xlat16_cspair(tocode, unicode, flag); + return (error); + } if (kiconv_lookupcs(tocode, fromcode) == 0) return (0); Modified: stable/8/sys/conf/files ============================================================================== --- stable/8/sys/conf/files Mon Jan 16 08:13:25 2012 (r230204) +++ stable/8/sys/conf/files Mon Jan 16 08:29:52 2012 (r230205) @@ -2366,6 +2366,7 @@ libkern/fnmatch.c standard libkern/gets.c standard libkern/iconv.c optional libiconv libkern/iconv_converter_if.m optional libiconv +libkern/iconv_ucs.c optional libiconv libkern/iconv_xlat.c optional libiconv libkern/iconv_xlat16.c optional libiconv libkern/index.c standard Modified: stable/8/sys/fs/msdosfs/msdosfs_conv.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_conv.c Mon Jan 16 08:13:25 2012 (r230204) +++ stable/8/sys/fs/msdosfs/msdosfs_conv.c Mon Jan 16 08:29:52 2012 (r230205) @@ -61,9 +61,9 @@ extern struct iconv_functions *msdosfs_iconv; static int mbsadjpos(const char **, size_t, size_t, int, int, void *handle); -static u_int16_t dos2unixchr(const u_char **, size_t *, int, struct msdosfsmount *); +static u_char * dos2unixchr(u_char *, const u_char **, size_t *, int, struct msdosfsmount *); static u_int16_t unix2doschr(const u_char **, size_t *, struct msdosfsmount *); -static u_int16_t win2unixchr(u_int16_t, struct msdosfsmount *); +static u_char * win2unixchr(u_char *, u_int16_t, struct msdosfsmount *); static u_int16_t unix2winchr(const u_char **, size_t *, int, struct msdosfsmount *); /* @@ -242,7 +242,7 @@ dos2unixfn(dn, un, lower, pmp) { size_t i; int thislong = 0; - u_int16_t c; + u_char *c, tmpbuf[5]; /* * If first char of the filename is SLOT_E5 (0x05), then the real @@ -257,14 +257,12 @@ dos2unixfn(dn, un, lower, pmp) * Copy the name portion into the unix filename string. */ for (i = 8; i > 0 && *dn != ' ';) { - c = dos2unixchr((const u_char **)&dn, &i, lower & LCASE_BASE, - pmp); - if (c & 0xff00) { - *un++ = c >> 8; + c = dos2unixchr(tmpbuf, (const u_char **)&dn, &i, + lower & LCASE_BASE, pmp); + while (*c != '\0') { + *un++ = *c++; thislong++; } - *un++ = c; - thislong++; } dn += i; @@ -276,14 +274,12 @@ dos2unixfn(dn, un, lower, pmp) *un++ = '.'; thislong++; for (i = 3; i > 0 && *dn != ' ';) { - c = dos2unixchr((const u_char **)&dn, &i, + c = dos2unixchr(tmpbuf, (const u_char **)&dn, &i, lower & LCASE_EXT, pmp); - if (c & 0xff00) { - *un++ = c >> 8; + while (*c != '\0') { + *un++ = *c++; thislong++; } - *un++ = c; - thislong++; } } *un++ = 0; @@ -652,8 +648,9 @@ win2unixfn(nbp, wep, chksum, pmp) int chksum; struct msdosfsmount *pmp; { + u_char *c, tmpbuf[5]; u_int8_t *cp; - u_int8_t *np, name[WIN_CHARS * 2 + 1]; + u_int8_t *np, name[WIN_CHARS * 3 + 1]; u_int16_t code; int i; @@ -686,10 +683,9 @@ win2unixfn(nbp, wep, chksum, pmp) *np = '\0'; return -1; default: - code = win2unixchr(code, pmp); - if (code & 0xff00) - *np++ = code >> 8; - *np++ = code; + c = win2unixchr(tmpbuf, code, pmp); + while (*c != '\0') + *np++ = *c++; break; } cp += 2; @@ -705,10 +701,9 @@ win2unixfn(nbp, wep, chksum, pmp) *np = '\0'; return -1; default: - code = win2unixchr(code, pmp); - if (code & 0xff00) - *np++ = code >> 8; - *np++ = code; + c = win2unixchr(tmpbuf, code, pmp); + while (*c != '\0') + *np++ = *c++; break; } cp += 2; @@ -724,10 +719,9 @@ win2unixfn(nbp, wep, chksum, pmp) *np = '\0'; return -1; default: - code = win2unixchr(code, pmp); - if (code & 0xff00) - *np++ = code >> 8; - *np++ = code; + c = win2unixchr(tmpbuf, code, pmp); + while (*c != '\0') + *np++ = *c++; break; } cp += 2; @@ -817,24 +811,22 @@ mbsadjpos(const char **instr, size_t inl /* * Convert DOS char to Local char */ -static u_int16_t -dos2unixchr(const u_char **instr, size_t *ilen, int lower, struct msdosfsmount *pmp) +static u_char * +dos2unixchr(u_char *outbuf, const u_char **instr, size_t *ilen, int lower, struct msdosfsmount *pmp) { - u_char c; - char *outp, outbuf[3]; - u_int16_t wc; + u_char c, *outp; size_t len, olen; + outp = outbuf; if (pmp->pm_flags & MSDOSFSMNT_KICONV && msdosfs_iconv) { - olen = len = 2; - outp = outbuf; + olen = len = 4; if (lower & (LCASE_BASE | LCASE_EXT)) msdosfs_iconv->convchr_case(pmp->pm_d2u, (const char **)instr, - ilen, &outp, &olen, KICONV_LOWER); + ilen, (char **)&outp, &olen, KICONV_LOWER); else msdosfs_iconv->convchr(pmp->pm_d2u, (const char **)instr, - ilen, &outp, &olen); + ilen, (char **)&outp, &olen); len -= olen; /* @@ -843,21 +835,21 @@ dos2unixchr(const u_char **instr, size_t if (len == 0) { (*ilen)--; (*instr)++; - return ('?'); + *outp++ = '?'; } - - wc = 0; - while(len--) - wc |= (*(outp - len - 1) & 0xff) << (len << 3); - return (wc); + } else { + (*ilen)--; + c = *(*instr)++; + c = dos2unix[c]; + if (lower & (LCASE_BASE | LCASE_EXT)) + c = u2l[c]; + *outp++ = c; + outbuf[1] = '\0'; } - (*ilen)--; - c = *(*instr)++; - c = dos2unix[c]; - if (lower & (LCASE_BASE | LCASE_EXT)) - c = u2l[c]; - return ((u_int16_t)c); + *outp = '\0'; + outp = outbuf; + return (outp); } /* @@ -940,23 +932,21 @@ unix2doschr(const u_char **instr, size_t /* * Convert Windows char to Local char */ -static u_int16_t -win2unixchr(u_int16_t wc, struct msdosfsmount *pmp) +static u_char * +win2unixchr(u_char *outbuf, u_int16_t wc, struct msdosfsmount *pmp) { - u_char *inp, *outp, inbuf[3], outbuf[3]; + u_char *inp, *outp, inbuf[3]; size_t ilen, olen, len; - if (wc == 0) - return (0); - + outp = outbuf; if (pmp->pm_flags & MSDOSFSMNT_KICONV && msdosfs_iconv) { inbuf[0] = (u_char)(wc>>8); inbuf[1] = (u_char)wc; inbuf[2] = '\0'; - ilen = olen = len = 2; + ilen = 2; + olen = len = 4; inp = inbuf; - outp = outbuf; msdosfs_iconv->convchr(pmp->pm_w2u, (const char **)&inp, &ilen, (char **)&outp, &olen); len -= olen; @@ -964,21 +954,15 @@ win2unixchr(u_int16_t wc, struct msdosfs /* * return '?' if failed to convert */ - if (len == 0) { - wc = '?'; - return (wc); - } - - wc = 0; - while(len--) - wc |= (*(outp - len - 1) & 0xff) << (len << 3); - return (wc); + if (len == 0) + *outp++ = '?'; + } else { + *outp++ = (wc & 0xff00) ? '?' : (u_char)(wc & 0xff); } - if (wc & 0xff00) - wc = '?'; - - return (wc); + *outp = '\0'; + outp = outbuf; + return (outp); } /* Modified: stable/8/sys/fs/smbfs/smbfs_smb.c ============================================================================== --- stable/8/sys/fs/smbfs/smbfs_smb.c Mon Jan 16 08:13:25 2012 (r230204) +++ stable/8/sys/fs/smbfs/smbfs_smb.c Mon Jan 16 08:29:52 2012 (r230205) @@ -40,6 +40,7 @@ #include #include #include +#include #ifdef USE_MD5_HASH #include @@ -509,6 +510,10 @@ smbfs_smb_setpattr(struct smbnode *np, u if (error) break; mb_put_uint8(mbp, SMB_DT_ASCII); + if (SMB_UNICODE_STRINGS(SSTOVC(ssp))) { + mb_put_padbyte(mbp); + mb_put_uint8(mbp, 0); /* 1st byte of NULL Unicode char */ + } mb_put_uint8(mbp, 0); smb_rq_bend(rqp); error = smb_rq_simple(rqp); @@ -1025,6 +1030,10 @@ smbfs_smb_search(struct smbfs_fctx *ctx) mb_put_uint16le(mbp, 0); /* context length */ ctx->f_flags &= ~SMBFS_RDD_FINDFIRST; } else { + if (SMB_UNICODE_STRINGS(vcp)) { + mb_put_padbyte(mbp); + mb_put_uint8(mbp, 0); + } mb_put_uint8(mbp, 0); /* file name length */ mb_put_uint8(mbp, SMB_DT_VARIABLE); mb_put_uint16le(mbp, SMB_SKEYLEN); @@ -1185,7 +1194,7 @@ smbfs_smb_trans2find2(struct smbfs_fctx mb_put_uint32le(mbp, 0); /* resume key */ mb_put_uint16le(mbp, flags); if (ctx->f_rname) - mb_put_mem(mbp, ctx->f_rname, strlen(ctx->f_rname) + 1, MB_MSYSTEM); + mb_put_mem(mbp, ctx->f_rname, ctx->f_rnamelen + 1, MB_MSYSTEM); else mb_put_uint8(mbp, 0); /* resume file name */ #if 0 @@ -1268,7 +1277,10 @@ static int smbfs_findopenLM2(struct smbfs_fctx *ctx, struct smbnode *dnp, const char *wildcard, int wclen, int attr, struct smb_cred *scred) { - ctx->f_name = malloc(SMB_MAXFNAMELEN, M_SMBFSDATA, M_WAITOK); + if (SMB_UNICODE_STRINGS(SSTOVC(ctx->f_ssp))) { + ctx->f_name = malloc(SMB_MAXFNAMELEN * 2, M_SMBFSDATA, M_WAITOK); + } else + ctx->f_name = malloc(SMB_MAXFNAMELEN, M_SMBFSDATA, M_WAITOK); if (ctx->f_name == NULL) return ENOMEM; ctx->f_infolevel = SMB_DIALECT(SSTOVC(ctx->f_ssp)) < SMB_DIALECT_NTLM0_12 ? @@ -1347,7 +1359,10 @@ smbfs_findnextLM2(struct smbfs_fctx *ctx SMBERROR("unexpected info level %d\n", ctx->f_infolevel); return EINVAL; } - nmlen = min(size, SMB_MAXFNAMELEN); + if (SMB_UNICODE_STRINGS(SSTOVC(ctx->f_ssp))) { + nmlen = min(size, SMB_MAXFNAMELEN * 2); + } else + nmlen = min(size, SMB_MAXFNAMELEN); cp = ctx->f_name; error = md_get_mem(mbp, cp, nmlen, MB_MSYSTEM); if (error) @@ -1361,8 +1376,12 @@ smbfs_findnextLM2(struct smbfs_fctx *ctx return EBADRPC; } } - if (nmlen && cp[nmlen - 1] == 0) - nmlen--; + if (SMB_UNICODE_STRINGS(SSTOVC(ctx->f_ssp))) { + if (nmlen > 1 && cp[nmlen - 1] == 0 && cp[nmlen - 2] == 0) + nmlen -= 2; + } else + if (nmlen && cp[nmlen - 1] == 0) + nmlen--; if (nmlen == 0) return EBADRPC; @@ -1446,10 +1465,17 @@ smbfs_findnext(struct smbfs_fctx *ctx, i error = smbfs_findnextLM2(ctx, limit); if (error) return error; - if ((ctx->f_nmlen == 1 && ctx->f_name[0] == '.') || - (ctx->f_nmlen == 2 && ctx->f_name[0] == '.' && - ctx->f_name[1] == '.')) - continue; + if (SMB_UNICODE_STRINGS(SSTOVC(ctx->f_ssp))) { + if ((ctx->f_nmlen == 2 && + *(u_int16_t *)ctx->f_name == htole16(0x002e)) || + (ctx->f_nmlen == 4 && + *(u_int32_t *)ctx->f_name == htole32(0x002e002e))) + continue; + } else + if ((ctx->f_nmlen == 1 && ctx->f_name[0] == '.') || + (ctx->f_nmlen == 2 && ctx->f_name[0] == '.' && + ctx->f_name[1] == '.')) + continue; break; } smbfs_fname_tolocal(SSTOVC(ctx->f_ssp), ctx->f_name, &ctx->f_nmlen, Modified: stable/8/sys/fs/smbfs/smbfs_subr.c ============================================================================== --- stable/8/sys/fs/smbfs/smbfs_subr.c Mon Jan 16 08:13:25 2012 (r230204) +++ stable/8/sys/fs/smbfs/smbfs_subr.c Mon Jan 16 08:29:52 2012 (r230205) @@ -136,7 +136,10 @@ smb_fphelp(struct mbchain *mbp, struct s return smb_put_dmem(mbp, vcp, "\\", 2, caseopt);*/ while (i--) { np = *--npp; - error = mb_put_uint8(mbp, '\\'); + if (SMB_UNICODE_STRINGS(vcp)) + error = mb_put_uint16le(mbp, '\\'); + else + error = mb_put_uint8(mbp, '\\'); if (error) break; error = smb_put_dmem(mbp, vcp, np->n_name, np->n_nmlen, caseopt); @@ -154,6 +157,11 @@ smbfs_fullpath(struct mbchain *mbp, stru int caseopt = SMB_CS_NONE; int error; + if (SMB_UNICODE_STRINGS(vcp)) { + error = mb_put_padbyte(mbp); + if (error) + return error; + } if (SMB_DIALECT(vcp) < SMB_DIALECT_LANMAN1_0) caseopt |= SMB_CS_UPPER; if (dnp != NULL) { @@ -162,7 +170,10 @@ smbfs_fullpath(struct mbchain *mbp, stru return error; } if (name) { - error = mb_put_uint8(mbp, '\\'); + if (SMB_UNICODE_STRINGS(vcp)) + error = mb_put_uint16le(mbp, '\\'); + else + error = mb_put_uint8(mbp, '\\'); if (error) return error; error = smb_put_dmem(mbp, vcp, name, nmlen, caseopt); @@ -170,6 +181,8 @@ smbfs_fullpath(struct mbchain *mbp, stru return error; } error = mb_put_uint8(mbp, 0); + if (SMB_UNICODE_STRINGS(vcp) && error == 0) + error = mb_put_uint8(mbp, 0); return error; } @@ -197,6 +210,17 @@ smbfs_fname_tolocal(struct smb_vc *vcp, error = iconv_conv_case (vcp->vc_tolocal, (const char **)&ibuf, &ilen, &obuf, &olen, copt); + if (error && SMB_UNICODE_STRINGS(vcp)) { + /* + * If using unicode, leaving a file name as it was when + * convert fails will cause a problem because the file name + * will contain NULL. + * Here, put '?' and give converted file name. + */ + *obuf = '?'; + olen--; + error = 0; + } if (!error) { *nmlen = sizeof(outbuf) - olen; memcpy(name, outbuf, *nmlen); Modified: stable/8/sys/libkern/iconv.c ============================================================================== --- stable/8/sys/libkern/iconv.c Mon Jan 16 08:13:25 2012 (r230204) +++ stable/8/sys/libkern/iconv.c Mon Jan 16 08:29:52 2012 (r230205) @@ -383,6 +383,18 @@ iconv_sysctl_cslist(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_kern_iconv, OID_AUTO, cslist, CTLFLAG_RD | CTLTYPE_OPAQUE, NULL, 0, iconv_sysctl_cslist, "S,xlat", "registered charset pairs"); +int +iconv_add(const char *converter, const char *to, const char *from) +{ + struct iconv_converter_class *dcp; + struct iconv_cspair *csp; + + if (iconv_lookupconv(converter, &dcp) != 0) + return EINVAL; + + return iconv_register_cspair(to, from, dcp, NULL, &csp); +} + /* * Add new charset pair */ Added: stable/8/sys/libkern/iconv_ucs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/libkern/iconv_ucs.c Mon Jan 16 08:29:52 2012 (r230205) @@ -0,0 +1,540 @@ +/*- + * Copyright (c) 2003, 2005 Ryuichiro Imura + * 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 +#include +#include +#include + +#include "iconv_converter_if.h" + +/* + * "UCS" converter + */ + +#define KICONV_UCS_COMBINE 0x1 +#define KICONV_UCS_FROM_UTF8 0x2 +#define KICONV_UCS_TO_UTF8 0x4 +#define KICONV_UCS_FROM_LE 0x8 +#define KICONV_UCS_TO_LE 0x10 +#define KICONV_UCS_FROM_UTF16 0x20 +#define KICONV_UCS_TO_UTF16 0x40 +#define KICONV_UCS_UCS4 0x80 + +#define ENCODING_UTF16 "UTF-16BE" +#define ENCODING_UTF8 "UTF-8" + +static struct { + const char *name; + int from_flag, to_flag; +} unicode_family[] = { + { "UTF-8", KICONV_UCS_FROM_UTF8, KICONV_UCS_TO_UTF8 }, + { "UCS-2LE", KICONV_UCS_FROM_LE, KICONV_UCS_TO_LE }, + { "UTF-16BE", KICONV_UCS_FROM_UTF16, KICONV_UCS_TO_UTF16 }, + { "UTF-16LE", KICONV_UCS_FROM_UTF16|KICONV_UCS_FROM_LE, + KICONV_UCS_TO_UTF16|KICONV_UCS_TO_LE }, + { NULL, 0, 0 } +}; + +static uint32_t utf8_to_ucs4(const char *src, size_t *utf8width, size_t srclen); +static u_char *ucs4_to_utf8(uint32_t ucs4, char * dst, size_t *utf8width, size_t dstlen); +static uint32_t encode_surrogate(uint32_t code); +static uint32_t decode_surrogate(const u_char *ucs); + +#ifdef MODULE_DEPEND +MODULE_DEPEND(iconv_ucs, libiconv, 2, 2, 2); +#endif + +/* + * UCS converter instance + */ +struct iconv_ucs { + KOBJ_FIELDS; + int convtype; + struct iconv_cspair * d_csp; + struct iconv_cspair * d_cspf; + void * f_ctp; + void * t_ctp; + void * ctype; +}; + +static int +iconv_ucs_open(struct iconv_converter_class *dcp, + struct iconv_cspair *csp, struct iconv_cspair *cspf, void **dpp) +{ + struct iconv_ucs *dp; + int i; + const char *from, *to; + + dp = (struct iconv_ucs *)kobj_create((struct kobj_class*)dcp, M_ICONV, M_WAITOK); + to = csp->cp_to; + from = cspf ? cspf->cp_from : csp->cp_from; + + dp->convtype = 0; + + if (cspf) + dp->convtype |= KICONV_UCS_COMBINE; + for (i = 0; unicode_family[i].name; i++) { + if (strcmp(from, unicode_family[i].name) == 0) + dp->convtype |= unicode_family[i].from_flag; + if (strcmp(to, unicode_family[i].name) == 0) + dp->convtype |= unicode_family[i].to_flag; + } + if (strcmp(ENCODING_UNICODE, ENCODING_UTF16) == 0) + dp->convtype |= KICONV_UCS_UCS4; + else + dp->convtype &= ~KICONV_UCS_UCS4; + + dp->f_ctp = dp->t_ctp = NULL; + if (dp->convtype & KICONV_UCS_COMBINE) { + if ((dp->convtype & KICONV_UCS_FROM_UTF8) == 0 && + (dp->convtype & KICONV_UCS_FROM_LE) == 0) { + iconv_open(ENCODING_UNICODE, from, &dp->f_ctp); + } + if ((dp->convtype & KICONV_UCS_TO_UTF8) == 0 && + (dp->convtype & KICONV_UCS_TO_LE) == 0) { + iconv_open(to, ENCODING_UNICODE, &dp->t_ctp); + } + } + + dp->ctype = NULL; + if (dp->convtype & (KICONV_UCS_FROM_UTF8 | KICONV_UCS_TO_UTF8)) + iconv_open(KICONV_WCTYPE_NAME, ENCODING_UTF8, &dp->ctype); + + dp->d_csp = csp; + if (dp->convtype & (KICONV_UCS_FROM_UTF8 | KICONV_UCS_FROM_LE)) { + if (cspf) { + dp->d_cspf = cspf; + cspf->cp_refcount++; + } else + csp->cp_refcount++; + } + if (dp->convtype & (KICONV_UCS_TO_UTF8 | KICONV_UCS_TO_LE)) + csp->cp_refcount++; + *dpp = (void*)dp; + return 0; +} + +static int +iconv_ucs_close(void *data) +{ + struct iconv_ucs *dp = data; + + if (dp->f_ctp) + iconv_close(dp->f_ctp); + if (dp->t_ctp) + iconv_close(dp->t_ctp); + if (dp->ctype) + iconv_close(dp->ctype); + if (dp->d_cspf) + dp->d_cspf->cp_refcount--; + else if (dp->convtype & (KICONV_UCS_FROM_UTF8 | KICONV_UCS_FROM_LE)) + dp->d_csp->cp_refcount--; + if (dp->convtype & (KICONV_UCS_TO_UTF8 | KICONV_UCS_TO_LE)) + dp->d_csp->cp_refcount--; + kobj_delete((struct kobj*)data, M_ICONV); + return 0; +} + +static int +iconv_ucs_conv(void *d2p, const char **inbuf, + size_t *inbytesleft, char **outbuf, size_t *outbytesleft, + int convchar, int casetype) +{ + struct iconv_ucs *dp = (struct iconv_ucs*)d2p; + int ret = 0, i; + size_t in, on, ir, or, inlen, outlen, ucslen; + const char *src, *p; + char *dst; + u_char ucs[4], *q; + uint32_t code; + + if (inbuf == NULL || *inbuf == NULL || outbuf == NULL || *outbuf == NULL) + return 0; + ir = in = *inbytesleft; + or = on = *outbytesleft; + src = *inbuf; + dst = *outbuf; + + while (ir > 0 && or > 0) { + + /* + * The first half of conversion. + * (convert any code into ENCODING_UNICODE) + */ + code = 0; + p = src; + if (dp->convtype & KICONV_UCS_FROM_UTF8) { + /* convert UTF-8 to ENCODING_UNICODE */ + inlen = 0; + code = utf8_to_ucs4(p, &inlen, ir); + if (code == 0) { + ret = -1; + break; + } + + if (casetype == KICONV_FROM_LOWER && dp->ctype) { + code = towlower(code, dp->ctype); + } else if (casetype == KICONV_FROM_UPPER && dp->ctype) { + code = towupper(code, dp->ctype); + } + + if ((code >= 0xd800 && code < 0xe000) || code >= 0x110000 ) { + /* reserved for utf-16 surrogate pair */ + /* invalid unicode */ + ret = -1; + break; + } + + if (inlen == 4) { + if (dp->convtype & KICONV_UCS_UCS4) { + ucslen = 4; + code = encode_surrogate(code); + } else { + /* can't handle with ucs-2 */ + ret = -1; + break; + } + } else { + ucslen = 2; + } + + /* save UCS-4 into ucs[] */ + for (q = ucs, i = ucslen - 1 ; i >= 0 ; i--) + *q++ = (code >> (i << 3)) & 0xff; + + } else if (dp->convtype & KICONV_UCS_COMBINE && dp->f_ctp) { + /* convert local code to ENCODING_UNICODE */ + ucslen = 4; + inlen = ir; + q = ucs; + ret = iconv_convchr_case(dp->f_ctp, &p, &inlen, (char **)&q, + &ucslen, casetype & (KICONV_FROM_LOWER | KICONV_FROM_UPPER)); + if (ret) + break; + inlen = ir - inlen; + ucslen = 4 - ucslen; + + } else { + /* src code is a proper subset of ENCODING_UNICODE */ + q = ucs; + if (dp->convtype & KICONV_UCS_FROM_LE) { + *q = *(p + 1); + *(q + 1) = *p; + p += 2; + } else { + *q = *p++; + *(q + 1) = *p++; + } + if ((*q & 0xfc) == 0xd8) { + if (dp->convtype & KICONV_UCS_UCS4 && + dp->convtype & KICONV_UCS_FROM_UTF16) { + inlen = ucslen = 4; + } else { + /* invalid unicode */ + ret = -1; + break; + } + } else { + inlen = ucslen = 2; + } + if (ir < inlen) { + ret = -1; + break; + } + if (ucslen == 4) { + q += 2; + if (dp->convtype & KICONV_UCS_FROM_LE) { + *q = *(p + 1); + *(q + 1) = *p; + } else { + *q = *p++; + *(q + 1) = *p; + } + if ((*q & 0xfc) != 0xdc) { + /* invalid unicode */ + ret = -1; + break; + } + } + } + + /* + * The second half of conversion. + * (convert ENCODING_UNICODE into any code) + */ + p = ucs; + if (dp->convtype & KICONV_UCS_TO_UTF8) { + q = (u_char *)dst; + if (ucslen == 4 && dp->convtype & KICONV_UCS_UCS4) { + /* decode surrogate pair */ + code = decode_surrogate(p); + } else { + code = (ucs[0] << 8) | ucs[1]; + } + + if (casetype == KICONV_LOWER && dp->ctype) { + code = towlower(code, dp->ctype); + } else if (casetype == KICONV_UPPER && dp->ctype) { + code = towupper(code, dp->ctype); + } + + outlen = 0; + if (ucs4_to_utf8(code, q, &outlen, or) == NULL) { + ret = -1; + break; + } + + src += inlen; + ir -= inlen; + dst += outlen; + or -= outlen; + + } else if (dp->convtype & KICONV_UCS_COMBINE && dp->t_ctp) { + ret = iconv_convchr_case(dp->t_ctp, &p, &ucslen, &dst, + &or, casetype & (KICONV_LOWER | KICONV_UPPER)); + if (ret) + break; + + src += inlen; + ir -= inlen; + + } else { + /* dst code is a proper subset of ENCODING_UNICODE */ + if (or < ucslen) { + ret = -1; + break; + } + src += inlen; + ir -= inlen; + or -= ucslen; + if (dp->convtype & KICONV_UCS_TO_LE) { + *dst++ = *(p + 1); + *dst++ = *p; + p += 2; + } else { + *dst++ = *p++; + *dst++ = *p++; + } + if (ucslen == 4) { + if ((dp->convtype & KICONV_UCS_UCS4) == 0 || + (dp->convtype & KICONV_UCS_TO_UTF16) == 0) { + ret = -1; + break; + } + if (dp->convtype & KICONV_UCS_TO_LE) { + *dst++ = *(p + 1); + *dst++ = *p; + } else { + *dst++ = *p++; + *dst++ = *p; + } + } + } + + if (convchar == 1) + break; + } + + *inbuf += in - ir; + *outbuf += on - or; + *inbytesleft -= in - ir; + *outbytesleft -= on - or; + return (ret); +} + +static int +iconv_ucs_init(struct iconv_converter_class *dcp) +{ + int error; + + error = iconv_add(ENCODING_UNICODE, ENCODING_UNICODE, ENCODING_UTF8); + if (error) + return (error); + error = iconv_add(ENCODING_UNICODE, ENCODING_UTF8, ENCODING_UNICODE); + if (error) + return (error); + return (0); +} + +static int +iconv_ucs_done(struct iconv_converter_class *dcp) +{ + return (0); +} + +static const char * +iconv_ucs_name(struct iconv_converter_class *dcp) +{ + return (ENCODING_UNICODE); +} + +static kobj_method_t iconv_ucs_methods[] = { + KOBJMETHOD(iconv_converter_open, iconv_ucs_open), + KOBJMETHOD(iconv_converter_close, iconv_ucs_close), + KOBJMETHOD(iconv_converter_conv, iconv_ucs_conv), + KOBJMETHOD(iconv_converter_init, iconv_ucs_init), + KOBJMETHOD(iconv_converter_done, iconv_ucs_done), + KOBJMETHOD(iconv_converter_name, iconv_ucs_name), + {0, 0} +}; + +KICONV_CONVERTER(ucs, sizeof(struct iconv_ucs)); + +static uint32_t +utf8_to_ucs4(const char *src, size_t *utf8width, size_t srclen) +{ + size_t i, w = 0; + uint32_t ucs4 = 0; + + /* + * get leading 1 byte from utf-8 + */ + if ((*src & 0x80) == 0) { + /* + * leading 1 bit is "0" + * utf-8: 0xxxxxxx + * ucs-4: 00000000 00000000 00000000 0xxxxxxx + */ + w = 1; + /* get trailing 7 bits */ + ucs4 = *src & 0x7f; + } else if ((*src & 0xe0) == 0xc0) { + /* + * leading 3 bits are "110" + * utf-8: 110xxxxx 10yyyyyy + * ucs-4: 00000000 00000000 00000xxx xxyyyyyy + */ + w = 2; + /* get trailing 5 bits */ + ucs4 = *src & 0x1f; + } else if ((*src & 0xf0) == 0xe0) { + /* + * leading 4 bits are "1110" + * utf-8: 1110xxxx 10yyyyyy 10zzzzzz + * ucs-4: 00000000 00000000 xxxxyyyy yyzzzzzz + */ + w = 3; + /* get trailing 4 bits */ + ucs4 = *src & 0x0f; + } else if ((*src & 0xf8) == 0xf0) { + /* + * leading 5 bits are "11110" + * utf-8: 11110www 10xxxxxx 10yyyyyy 10zzzzzz + * ucs-4: 00000000 000wwwxx xxxxyyyy yyzzzzzz + */ + w = 4; + /* get trailing 3 bits */ + ucs4 = *src & 0x07; + } else { + /* out of utf-16 range or having illegal bits */ + return (0); + } + if (w == 0) + return (0); + + if (srclen < w) + return (0); + + /* + * get left parts from utf-8 + */ + for (i = 1 ; i < w ; i++) { + if ((*(src + i) & 0xc0) != 0x80) { + /* invalid: leading 2 bits are not "10" */ + return (0); + } + /* concatenate trailing 6 bits into ucs4 */ + ucs4 <<= 6; + ucs4 |= *(src + i) & 0x3f; + } + + *utf8width = w; + return (ucs4); +} + +static u_char * +ucs4_to_utf8(uint32_t ucs4, char *dst, size_t *utf8width, size_t dstlen) +{ + u_char lead, *p; + size_t i, w; + + /* + * determine utf-8 width and leading bits + */ + if (ucs4 < 0x80) { + w = 1; + lead = 0; /* "0" */ + } else if (ucs4 < 0x800) { + w = 2; + lead = 0xc0; /* "11" */ + } else if (ucs4 < 0x10000) { + w = 3; + lead = 0xe0; /* "111" */ + } else if (ucs4 < 0x200000) { + w = 4; + lead = 0xf0; /* "1111" */ + } else { + return (NULL); + } + + if (dstlen < w) + return (NULL); + + /* + * construct utf-8 + */ + p = dst; + for (i = w - 1 ; i >= 1 ; i--) { + /* get trailing 6 bits and put it with leading bit as "1" */ + *(p + i) = (ucs4 & 0x3f) | 0x80; + ucs4 >>= 6; + } + *p = ucs4 | lead; + + *utf8width = w; + + return (p); +} + +static uint32_t +encode_surrogate(register uint32_t code) +{ + return ((((code - 0x10000) << 6) & 0x3ff0000) | + ((code - 0x10000) & 0x3ff) | 0xd800dc00); +} + +static uint32_t +decode_surrogate(register const u_char *ucs) +{ + return ((((ucs[0] & 0x3) << 18) | (ucs[1] << 10) | + ((ucs[2] & 0x3) << 8) | ucs[3]) + 0x10000); +} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 16 08:31:32 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF9C61065676; Mon, 16 Jan 2012 08:31:32 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3F558FC08; Mon, 16 Jan 2012 08:31: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 q0G8VWr4024016; Mon, 16 Jan 2012 08:31:32 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0G8VWGO024012; Mon, 16 Jan 2012 08:31:32 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201201160831.q0G8VWGO024012@svn.freebsd.org> From: Kevin Lo Date: Mon, 16 Jan 2012 08:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230206 - stable/8/sys/fs/ntfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 08:31:33 -0000 Author: kevlo Date: Mon Jan 16 08:31:32 2012 New Revision: 230206 URL: http://svn.freebsd.org/changeset/base/230206 Log: MFC r228864: Discard local array based on return values. Pointed out by: uqs Found with: Coverity Prevent(tm) CID: 10089 MFC 228023: Add unicode support to ntfs Obtained from: imura Modified: stable/8/sys/fs/ntfs/ntfs_subr.c stable/8/sys/fs/ntfs/ntfs_subr.h stable/8/sys/fs/ntfs/ntfs_vnops.c Modified: stable/8/sys/fs/ntfs/ntfs_subr.c ============================================================================== --- stable/8/sys/fs/ntfs/ntfs_subr.c Mon Jan 16 08:29:52 2012 (r230205) +++ stable/8/sys/fs/ntfs/ntfs_subr.c Mon Jan 16 08:31:32 2012 (r230206) @@ -666,23 +666,18 @@ ntfs_uastricmp(ntmp, ustr, ustrlen, astr const char *astr; size_t astrlen; { - int len; + const char *astrp = astr; + char tmpbuf[5]; + int len, res; size_t i, j, mbstrlen = astrlen; - int res; - wchar wc; if (ntmp->ntm_ic_l2u) { - for (i = 0, j = 0; i < ustrlen && j < astrlen; i++, j++) { - if (j < astrlen -1) { - wc = (wchar)astr[j]<<8 | (astr[j+1]&0xFF); - len = 2; - } else { - wc = (wchar)astr[j]<<8 & 0xFF00; - len = 1; - } + for (i = 0, j = 0; i < ustrlen && j < astrlen; i++) { + len = 4; res = ((int) NTFS_TOUPPER(ustr[i])) - - ((int)NTFS_TOUPPER(NTFS_82U(wc, &len))); - j += len - 1; + ((int)NTFS_TOUPPER(NTFS_82U(astrp, &len))); + astrp += len; + j += len; mbstrlen -= len - 1; if (res) @@ -695,7 +690,8 @@ ntfs_uastricmp(ntmp, ustr, ustrlen, astr */ for (i = 0; i < ustrlen && i < astrlen; i++) { res = ((int) NTFS_TOUPPER(NTFS_82U(NTFS_U28(ustr[i]), &len))) - - ((int)NTFS_TOUPPER(NTFS_82U((wchar)astr[i], &len))); + ((int)NTFS_TOUPPER(NTFS_82U(astrp, &len))); + astrp++; if (res) return res; } @@ -714,23 +710,18 @@ ntfs_uastrcmp(ntmp, ustr, ustrlen, astr, const char *astr; size_t astrlen; { - char u, l; + char *c, tmpbuf[5]; size_t i, j, mbstrlen = astrlen; int res; - wchar wc; - for (i = 0, j = 0; (i < ustrlen) && (j < astrlen); i++, j++) { - res = 0; - wc = NTFS_U28(ustr[i]); - u = (char)(wc>>8); - l = (char)wc; - if (u != '\0' && j < astrlen -1) { - res = (int) (u - astr[j++]); + for (i = 0, j = 0; (i < ustrlen) && (j < astrlen); i++, mbstrlen++) { + c = NTFS_U28(ustr[i]); + while (*c != '\0') { + res = (int) (*c++ - astr[j++]); + if (res) + return res; mbstrlen--; } - res = (res<<8) + (int) (l - astr[j]); - if (res) - return res; } return (ustrlen - mbstrlen); } @@ -2131,50 +2122,48 @@ ntfs_82u_uninit(struct ntfsmount *ntmp) } /* - * maps the Unicode char to 8bit equivalent - * XXX currently only gets lower 8bit from the Unicode char - * and substitutes a '_' for it if the result would be '\0'; - * something better has to be definitely though out + * maps the Unicode char to local character */ -wchar +char * ntfs_u28( + char *outbuf, struct ntfsmount *ntmp, wchar wc) { - char *p, *outp, inbuf[3], outbuf[3]; + char *p, *outp, inbuf[3]; size_t ilen, olen; + outp = outbuf; if (ntfs_iconv && ntmp->ntm_ic_u2l) { - ilen = olen = 2; + ilen = 2; + olen = 4; inbuf[0] = (char)(wc>>8); inbuf[1] = (char)wc; inbuf[2] = '\0'; p = inbuf; - outp = outbuf; ntfs_iconv->convchr(ntmp->ntm_ic_u2l, (const char **)&p, &ilen, &outp, &olen); - if (olen == 1) { - return ((wchar)(outbuf[0]&0xFF)); - } else if (olen == 0) { - return ((wchar)((outbuf[0]<<8) | (outbuf[1]&0xFF))); - } - return ('?'); + if (olen == 4) + *outp++ = '?'; + *outp = '\0'; + outp = outbuf; + return (outp); } p = ntmp->ntm_u28[(wc>>8)&0xFF]; - if (p == NULL) - return ('_'); - return (p[wc&0xFF]&0xFF); + outbuf[0] = (p == NULL) ? '_' : p[wc&0xFF] & 0xFF; + outbuf[1] = '\0'; + return (outp); } wchar ntfs_82u( struct ntfsmount *ntmp, - wchar wc, + const char *c, int *len) { - char *p, *outp, inbuf[3], outbuf[3]; + char *outp, outbuf[3]; wchar uc; size_t ilen, olen; @@ -2182,13 +2171,8 @@ ntfs_82u( ilen = (size_t)*len; olen = 2; - inbuf[0] = (char)(wc>>8); - inbuf[1] = (char)wc; - inbuf[2] = '\0'; - p = inbuf; outp = outbuf; - ntfs_iconv->convchr(ntmp->ntm_ic_l2u, (const char **)&p, &ilen, - &outp, &olen); + ntfs_iconv->convchr(ntmp->ntm_ic_l2u, &c, &ilen, &outp, &olen); *len -= (int)ilen; uc = (wchar)((outbuf[0]<<8) | (outbuf[1]&0xFF)); @@ -2196,7 +2180,7 @@ ntfs_82u( } if (ntmp->ntm_82u != NULL) - return (ntmp->ntm_82u[wc&0xFF]); + return (ntmp->ntm_82u[*c&0xFF]); return ('?'); } Modified: stable/8/sys/fs/ntfs/ntfs_subr.h ============================================================================== --- stable/8/sys/fs/ntfs/ntfs_subr.h Mon Jan 16 08:29:52 2012 (r230205) +++ stable/8/sys/fs/ntfs/ntfs_subr.h Mon Jan 16 08:31:32 2012 (r230206) @@ -112,9 +112,9 @@ int ntfs_u28_init(struct ntfsmount *ntmp int ntfs_u28_uninit(struct ntfsmount *ntmp); int ntfs_82u_init(struct ntfsmount *ntmp, char *cs_local, char *cs_ntfs); int ntfs_82u_uninit(struct ntfsmount *ntmp); -wchar ntfs_u28(struct ntfsmount *ntmp, wchar wc); -wchar ntfs_82u(struct ntfsmount *ntmp, wchar wc, int *len); -#define NTFS_U28(ch) ntfs_u28(ntmp, (ch)) +char * ntfs_u28(char *outbuf, struct ntfsmount *ntmp, wchar wc); +wchar ntfs_82u(struct ntfsmount *ntmp, const char *c, int *len); +#define NTFS_U28(ch) ntfs_u28(tmpbuf, ntmp, (ch)) #define NTFS_82U(ch, len) ntfs_82u(ntmp, (ch), len) #define NTFS_UASTRCMP(ustr, ustrlen, astr, astrlen) \ ntfs_uastrcmp(ntmp, (ustr), (ustrlen), (astr), (astrlen)) Modified: stable/8/sys/fs/ntfs/ntfs_vnops.c ============================================================================== --- stable/8/sys/fs/ntfs/ntfs_vnops.c Mon Jan 16 08:29:52 2012 (r230205) +++ stable/8/sys/fs/ntfs/ntfs_vnops.c Mon Jan 16 08:31:32 2012 (r230206) @@ -481,7 +481,7 @@ ntfs_readdir(ap) struct uio *uio = ap->a_uio; struct ntfsmount *ntmp = ip->i_mp; int i, j, error = 0; - wchar c; + char *c, tmpbuf[5]; u_int32_t faked = 0, num; int ncookies = 0; struct dirent cde; @@ -538,11 +538,10 @@ ntfs_readdir(ap) if(!ntfs_isnamepermitted(ntmp,iep)) continue; - for(i=0, j=0; iie_fnamelen; i++, j++) { + for(i=0, j=0; iie_fnamelen; i++) { c = NTFS_U28(iep->ie_fname[i]); - if (c&0xFF00) - cde.d_name[j++] = (char)(c>>8); - cde.d_name[j] = (char)c&0xFF; + while (*c != '\0') + cde.d_name[j++] = *c++; } cde.d_name[j] = '\0'; dprintf(("ntfs_readdir: elem: %d, fname:[%s] type: %d, flag: %d, ", From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 16 13:22:47 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C544F106566C; Mon, 16 Jan 2012 13:22:47 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 586858FC12; Mon, 16 Jan 2012 13:22:47 +0000 (UTC) Received: by obcwo16 with SMTP id wo16so1383744obc.13 for ; Mon, 16 Jan 2012 05:22:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=X5vOMY8WJbVNrnj5rsrEDTvyQRiXCSt968Ne8r/+vSw=; b=m/dAsBWOnTGO/EcdmMjFVdJelljEvXGoGIJAdl5GQdhKAP8fZ1mzbkxAPZSSnht9pG LGgBCnUSOfifcJuZCY5oq5fYMbEWKuw2qxxznnzaRFrT7jaR+hH0eKGTdPymLej/sPAi FoRkoJkwHYuO/MTObrVN5u30CCNv5yROI0r94= MIME-Version: 1.0 Received: by 10.182.11.37 with SMTP id n5mr1885690obb.13.1326720166875; Mon, 16 Jan 2012 05:22:46 -0800 (PST) Received: by 10.182.171.67 with HTTP; Mon, 16 Jan 2012 05:22:46 -0800 (PST) In-Reply-To: <201201160831.q0G8VWGO024012@svn.freebsd.org> References: <201201160831.q0G8VWGO024012@svn.freebsd.org> Date: Mon, 16 Jan 2012 16:22:46 +0300 Message-ID: From: Sergey Kandaurov To: Kevin Lo Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r230206 - stable/8/sys/fs/ntfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 13:22:47 -0000 On 16 January 2012 12:31, Kevin Lo wrote: > Author: kevlo > Date: Mon Jan 16 08:31:32 2012 > New Revision: 230206 > URL: http://svn.freebsd.org/changeset/base/230206 > > Log: > =A0MFC r228864: > =A0Discard local array based on return values. > > =A0Pointed out by: =A0 =A0 =A0 uqs > =A0Found with: =A0 Coverity Prevent(tm) > =A0CID: =A010089 > > =A0MFC 228023: > =A0Add unicode support to ntfs > > =A0Obtained from: =A0 =A0 =A0 =A0imura > > Modified: > =A0stable/8/sys/fs/ntfs/ntfs_subr.c > =A0stable/8/sys/fs/ntfs/ntfs_subr.h > =A0stable/8/sys/fs/ntfs/ntfs_vnops.c > Hi, this looks like a direct commit without svn mergeinfo. --=20 wbr, pluknet From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 16 14:40:23 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B2A71065673; Mon, 16 Jan 2012 14:40:23 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 397C88FC12; Mon, 16 Jan 2012 14:40: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 q0GEeNNZ038441; Mon, 16 Jan 2012 14:40:23 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GEeNYI038439; Mon, 16 Jan 2012 14:40:23 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201201161440.q0GEeNYI038439@svn.freebsd.org> From: Kevin Lo Date: Mon, 16 Jan 2012 14:40:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230217 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 14:40:23 -0000 Author: kevlo Date: Mon Jan 16 14:40:22 2012 New Revision: 230217 URL: http://svn.freebsd.org/changeset/base/230217 Log: Fix build breakage by adding missing mb_put_padbyte() Modified: stable/8/sys/kern/subr_mchain.c Modified: stable/8/sys/kern/subr_mchain.c ============================================================================== --- stable/8/sys/kern/subr_mchain.c Mon Jan 16 14:31:01 2012 (r230216) +++ stable/8/sys/kern/subr_mchain.c Mon Jan 16 14:40:22 2012 (r230217) @@ -125,6 +125,21 @@ mb_reserve(struct mbchain *mbp, int size } int +mb_put_padbyte(struct mbchain *mbp) +{ + caddr_t dst; + char x = 0; + + dst = mtod(mbp->mb_cur, caddr_t) + mbp->mb_cur->m_len; + + /* only add padding if address is odd */ + if ((unsigned long)dst & 1) + return mb_put_mem(mbp, (caddr_t)&x, 1, MB_MSYSTEM); + else + return 0; +} + +int mb_put_uint8(struct mbchain *mbp, u_int8_t x) { return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 16 14:46:31 2012 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA6DE1065672; Mon, 16 Jan 2012 14:46:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 531598FC08; Mon, 16 Jan 2012 14:46:30 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA22062; Mon, 16 Jan 2012 16:46:28 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <4F143843.9020505@FreeBSD.org> Date: Mon, 16 Jan 2012 16:46:27 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111109 Thunderbird/8.0 MIME-Version: 1.0 To: Kevin Lo References: <201201161440.q0GEeNYI038439@svn.freebsd.org> In-Reply-To: <201201161440.q0GEeNYI038439@svn.freebsd.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r230217 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 14:46:31 -0000 on 16/01/2012 16:40 Kevin Lo said the following: > Author: kevlo > Date: Mon Jan 16 14:40:22 2012 > New Revision: 230217 > URL: http://svn.freebsd.org/changeset/base/230217 > > Log: > Fix build breakage by adding missing mb_put_padbyte() > > Modified: > stable/8/sys/kern/subr_mchain.c > > Modified: stable/8/sys/kern/subr_mchain.c > ============================================================================== > --- stable/8/sys/kern/subr_mchain.c Mon Jan 16 14:31:01 2012 (r230216) > +++ stable/8/sys/kern/subr_mchain.c Mon Jan 16 14:40:22 2012 (r230217) > @@ -125,6 +125,21 @@ mb_reserve(struct mbchain *mbp, int size > } > > int > +mb_put_padbyte(struct mbchain *mbp) > +{ > + caddr_t dst; > + char x = 0; > + > + dst = mtod(mbp->mb_cur, caddr_t) + mbp->mb_cur->m_len; > + > + /* only add padding if address is odd */ > + if ((unsigned long)dst & 1) > + return mb_put_mem(mbp, (caddr_t)&x, 1, MB_MSYSTEM); > + else > + return 0; Broken style above? > +} > + > +int > mb_put_uint8(struct mbchain *mbp, u_int8_t x) > { > return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); -- Andriy Gapon From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 16 15:50:49 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D88681065672; Mon, 16 Jan 2012 15:50:49 +0000 (UTC) (envelope-from kevlo@ns.kevlo.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id 631688FC28; Mon, 16 Jan 2012 15:50:49 +0000 (UTC) Received: from ns.kevlo.org (kevlo@localhost [127.0.0.1]) by ns.kevlo.org (8.14.3/8.14.3) with ESMTP id q0GFF6R1030636; Mon, 16 Jan 2012 23:15:07 +0800 (CST) Received: (from kevlo@localhost) by ns.kevlo.org (8.14.3/8.14.3/Submit) id q0GFF65X015266; Mon, 16 Jan 2012 23:15:06 +0800 (CST) Date: Mon, 16 Jan 2012 23:15:06 +0800 From: Kevin Lo To: Sergey Kandaurov Message-ID: <20120116151506.GA32593@ns.kevlo.org> References: <201201160831.q0G8VWGO024012@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r230206 - stable/8/sys/fs/ntfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 15:50:50 -0000 On Mon, Jan 16, 2012 at 04:22:46PM +0300, Sergey Kandaurov wrote: > On 16 January 2012 12:31, Kevin Lo wrote: > > Author: kevlo > > Date: Mon Jan 16 08:31:32 2012 > > New Revision: 230206 > > URL: http://svn.freebsd.org/changeset/base/230206 > > > > Log: > > MFC r228864: > > Discard local array based on return values. > > > > Pointed out by: uqs > > Found with: Coverity Prevent(tm) > > CID: 10089 > > > > MFC 228023: > > Add unicode support to ntfs > > > > Obtained from: imura > > > > Modified: > > stable/8/sys/fs/ntfs/ntfs_subr.c > > stable/8/sys/fs/ntfs/ntfs_subr.h > > stable/8/sys/fs/ntfs/ntfs_vnops.c > > > > Hi, > this looks like a direct commit without svn mergeinfo. There was something wrong with my svn tree. I'm sorry for any inconvenience caused to you. > > -- > wbr, > pluknet Kevin From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 16 15:57:18 2012 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6643106564A; Mon, 16 Jan 2012 15:57:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 3503F8FC08; Mon, 16 Jan 2012 15:57:16 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA22870; Mon, 16 Jan 2012 17:57:15 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <4F1448DB.10508@FreeBSD.org> Date: Mon, 16 Jan 2012 17:57:15 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111109 Thunderbird/8.0 MIME-Version: 1.0 To: Kevin Lo References: <201201160831.q0G8VWGO024012@svn.freebsd.org> <20120116151506.GA32593@ns.kevlo.org> In-Reply-To: <20120116151506.GA32593@ns.kevlo.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r230206 - stable/8/sys/fs/ntfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 15:57:18 -0000 on 16/01/2012 17:15 Kevin Lo said the following: > On Mon, Jan 16, 2012 at 04:22:46PM +0300, Sergey Kandaurov wrote: >> On 16 January 2012 12:31, Kevin Lo wrote: >>> Author: kevlo >>> Date: Mon Jan 16 08:31:32 2012 >>> New Revision: 230206 >>> URL: http://svn.freebsd.org/changeset/base/230206 >>> >>> Log: >>> MFC r228864: >>> Discard local array based on return values. >>> >>> Pointed out by: uqs >>> Found with: Coverity Prevent(tm) >>> CID: 10089 >>> >>> MFC 228023: >>> Add unicode support to ntfs >>> >>> Obtained from: imura >>> >>> Modified: >>> stable/8/sys/fs/ntfs/ntfs_subr.c >>> stable/8/sys/fs/ntfs/ntfs_subr.h >>> stable/8/sys/fs/ntfs/ntfs_vnops.c >>> >> >> Hi, >> this looks like a direct commit without svn mergeinfo. > > There was something wrong with my svn tree. > I'm sorry for any inconvenience caused to you. You need to use svn merge with --record-only option to update svn mergeinfo data. -- Andriy Gapon From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 16 17:31:27 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6584A106566B; Mon, 16 Jan 2012 17:31:27 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38D1C8FC27; Mon, 16 Jan 2012 17:31:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GHVR9T044155; Mon, 16 Jan 2012 17:31:27 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GHVRAr044151; Mon, 16 Jan 2012 17:31:27 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201201161731.q0GHVRAr044151@svn.freebsd.org> From: Jim Harris Date: Mon, 16 Jan 2012 17:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230224 - in stable/8/sys/dev: ahci ata ata/chipsets X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 17:31:27 -0000 Author: jimharris Date: Mon Jan 16 17:31:26 2012 New Revision: 230224 URL: http://svn.freebsd.org/changeset/base/230224 Log: MFC r229671: Add 0x2826 device ID for C600 (Patsburg) SATA controller in RAID mode. Sponsored by: Intel Approved by: sbruno Modified: stable/8/sys/dev/ahci/ahci.c stable/8/sys/dev/ata/ata-pci.h stable/8/sys/dev/ata/chipsets/ata-intel.c Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Mon Jan 16 17:30:00 2012 (r230223) +++ stable/8/sys/dev/ahci/ahci.c Mon Jan 16 17:31:26 2012 (r230224) @@ -171,6 +171,7 @@ static struct { {0x1d028086, 0x00, "Intel Patsburg", 0}, {0x1d048086, 0x00, "Intel Patsburg", 0}, {0x1d068086, 0x00, "Intel Patsburg", 0}, + {0x28268086, 0x00, "Intel Patsburg (RAID)", 0}, {0x1e028086, 0x00, "Intel Panther Point", 0}, {0x1e038086, 0x00, "Intel Panther Point", 0}, {0x1e048086, 0x00, "Intel Panther Point", 0}, Modified: stable/8/sys/dev/ata/ata-pci.h ============================================================================== --- stable/8/sys/dev/ata/ata-pci.h Mon Jan 16 17:30:00 2012 (r230223) +++ stable/8/sys/dev/ata/ata-pci.h Mon Jan 16 17:31:26 2012 (r230224) @@ -236,6 +236,7 @@ struct ata_pci_controller { #define ATA_PBG_AH1 0x1d028086 #define ATA_PBG_R1 0x1d048086 #define ATA_PBG_R2 0x1d068086 +#define ATA_PBG_R3 0x28268086 #define ATA_PBG_S2 0x1d088086 #define ATA_PPT_S1 0x1e008086 Modified: stable/8/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-intel.c Mon Jan 16 17:30:00 2012 (r230223) +++ stable/8/sys/dev/ata/chipsets/ata-intel.c Mon Jan 16 17:31:26 2012 (r230224) @@ -197,6 +197,7 @@ ata_intel_probe(device_t dev) { ATA_PBG_AH1, 0, INTEL_AHCI, 0, ATA_SA300, "Patsburg" }, { ATA_PBG_R1, 0, INTEL_AHCI, 0, ATA_SA300, "Patsburg" }, { ATA_PBG_R2, 0, INTEL_AHCI, 0, ATA_SA300, "Patsburg" }, + { ATA_PBG_R3, 0, INTEL_AHCI, 0, ATA_SA300, "Patsburg" }, { ATA_PBG_S2, 0, INTEL_6CH2, 0, ATA_SA300, "Patsburg" }, { ATA_PPT_S1, 0, INTEL_6CH, 0, ATA_SA300, "Panther Point" }, { ATA_PPT_S2, 0, INTEL_6CH, 0, ATA_SA300, "Panther Point" }, From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 16 17:41:23 2012 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A30611065673; Mon, 16 Jan 2012 17:41:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 10A268FC14; Mon, 16 Jan 2012 17:41:21 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA24002; Mon, 16 Jan 2012 19:41:20 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <4F146140.4040203@FreeBSD.org> Date: Mon, 16 Jan 2012 19:41:20 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111109 Thunderbird/8.0 MIME-Version: 1.0 To: Eitan Adler References: <201201152052.q0FKqVT1099586@svn.freebsd.org> In-Reply-To: <201201152052.q0FKqVT1099586@svn.freebsd.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r230159 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 17:41:23 -0000 on 15/01/2012 22:52 Eitan Adler said the following: > Author: eadler (ports committer) > Date: Sun Jan 15 20:52:31 2012 > New Revision: 230159 > URL: http://svn.freebsd.org/changeset/base/230159 > > Log: > MFC r228343: > - Fix ktrace leakage if error is set > > PR: kern/163098 > Approved by: sbruno > > Modified: > stable/8/sys/kern/kern_ktrace.c > Directory Properties: > stable/8/sys/ (props changed) Eitan, the list of the directory properties changes seems to be too short. Have you made a common mistake of "cleaning up" the results of svn merge or do you have a sparse checkout of sys? Or something else? > Modified: stable/8/sys/kern/kern_ktrace.c > ============================================================================== > --- stable/8/sys/kern/kern_ktrace.c Sun Jan 15 20:52:01 2012 (r230158) > +++ stable/8/sys/kern/kern_ktrace.c Sun Jan 15 20:52:31 2012 (r230159) > @@ -473,7 +473,7 @@ ktrsysret(code, error, retval) > ktp = &req->ktr_data.ktr_sysret; > ktp->ktr_code = code; > ktp->ktr_error = error; > - ktp->ktr_retval = retval; /* what about val2 ? */ > + ktp->ktr_retval = ((error == 0) ? retval: 0); /* what about val2 ? */ > ktr_submitrequest(curthread, req); > } > -- Andriy Gapon From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 16 21:40:43 2012 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C3C6106566B; Mon, 16 Jan 2012 21:40:43 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id AD0198FC14; Mon, 16 Jan 2012 21:40:42 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 6E69B25D3A47; Mon, 16 Jan 2012 21:40:41 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 8AAE2BD952D; Mon, 16 Jan 2012 21:40:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id xKYsA1bN4sLN; Mon, 16 Jan 2012 21:40:39 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 25147BD952F; Mon, 16 Jan 2012 21:40:39 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <4F146140.4040203@FreeBSD.org> Date: Mon, 16 Jan 2012 21:40:38 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201201152052.q0FKqVT1099586@svn.freebsd.org> <4F146140.4040203@FreeBSD.org> To: Andriy Gapon X-Mailer: Apple Mail (2.1084) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler , svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r230159 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 21:40:43 -0000 On 16. Jan 2012, at 17:41 , Andriy Gapon wrote: > on 15/01/2012 22:52 Eitan Adler said the following: >> Author: eadler (ports committer) >> Date: Sun Jan 15 20:52:31 2012 >> New Revision: 230159 >> URL: http://svn.freebsd.org/changeset/base/230159 >>=20 >> Log: >> MFC r228343: >> - Fix ktrace leakage if error is set >>=20 >> PR: kern/163098 >> Approved by: sbruno >>=20 >> Modified: >> stable/8/sys/kern/kern_ktrace.c >> Directory Properties: >> stable/8/sys/ (props changed) >=20 > Eitan, >=20 > the list of the directory properties changes seems to be too short. > Have you made a common mistake of "cleaning up" the results of svn = merge or do you > have a sparse checkout of sys? Or something else? I think he just uses svn 1.7.x /bz >=20 >> Modified: stable/8/sys/kern/kern_ktrace.c >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- stable/8/sys/kern/kern_ktrace.c Sun Jan 15 20:52:01 2012 = (r230158) >> +++ stable/8/sys/kern/kern_ktrace.c Sun Jan 15 20:52:31 2012 = (r230159) >> @@ -473,7 +473,7 @@ ktrsysret(code, error, retval) >> ktp =3D &req->ktr_data.ktr_sysret; >> ktp->ktr_code =3D code; >> ktp->ktr_error =3D error; >> - ktp->ktr_retval =3D retval; /* what about val2 ? */ >> + ktp->ktr_retval =3D ((error =3D=3D 0) ? retval: 0); = /* what about val2 ? */ >> ktr_submitrequest(curthread, req); >> } >>=20 >=20 >=20 > --=20 > Andriy Gapon --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 16 22:26:46 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A256106566C; Mon, 16 Jan 2012 22:26:46 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2F338FC16; Mon, 16 Jan 2012 22:26:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0GMQj8n054538; Mon, 16 Jan 2012 22:26:45 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GMQjaa054533; Mon, 16 Jan 2012 22:26:45 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201201162226.q0GMQjaa054533@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 16 Jan 2012 22:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230239 - in stable/8: contrib/gperf contrib/gperf/doc contrib/gperf/lib contrib/gperf/src contrib/gperf/tests gnu/usr.bin/gperf sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 22:26:46 -0000 Author: bapt Date: Mon Jan 16 22:26:45 2012 New Revision: 230239 URL: http://svn.freebsd.org/changeset/base/230239 Log: MFC r228060, r228068, r228060 Upgrade gperf to 3.0.3 latest GPLv2 version Approved by: des (mentor) Added: stable/8/contrib/gperf/configure.ac - copied unchanged from r228060, head/contrib/gperf/configure.ac stable/8/contrib/gperf/doc/configure.ac - copied unchanged from r228060, head/contrib/gperf/doc/configure.ac stable/8/contrib/gperf/lib/configure.ac - copied unchanged from r228060, head/contrib/gperf/lib/configure.ac stable/8/contrib/gperf/lib/getline.cc - copied unchanged from r228060, head/contrib/gperf/lib/getline.cc stable/8/contrib/gperf/lib/getline.h - copied unchanged from r228060, head/contrib/gperf/lib/getline.h stable/8/contrib/gperf/src/config.h_vms - copied unchanged from r228060, head/contrib/gperf/src/config.h_vms stable/8/contrib/gperf/src/configure.ac - copied unchanged from r228060, head/contrib/gperf/src/configure.ac stable/8/contrib/gperf/src/input.cc - copied unchanged from r228060, head/contrib/gperf/src/input.cc stable/8/contrib/gperf/src/input.h - copied unchanged from r228060, head/contrib/gperf/src/input.h stable/8/contrib/gperf/src/keyword-list.cc - copied unchanged from r228060, head/contrib/gperf/src/keyword-list.cc stable/8/contrib/gperf/src/keyword-list.h - copied unchanged from r228060, head/contrib/gperf/src/keyword-list.h stable/8/contrib/gperf/src/keyword-list.icc - copied unchanged from r228060, head/contrib/gperf/src/keyword-list.icc stable/8/contrib/gperf/src/keyword.cc - copied unchanged from r228060, head/contrib/gperf/src/keyword.cc stable/8/contrib/gperf/src/keyword.h - copied unchanged from r228060, head/contrib/gperf/src/keyword.h stable/8/contrib/gperf/src/keyword.icc - copied unchanged from r228060, head/contrib/gperf/src/keyword.icc stable/8/contrib/gperf/src/output.cc - copied, changed from r228060, head/contrib/gperf/src/output.cc stable/8/contrib/gperf/src/output.h - copied unchanged from r228060, head/contrib/gperf/src/output.h stable/8/contrib/gperf/src/positions.cc - copied unchanged from r228060, head/contrib/gperf/src/positions.cc stable/8/contrib/gperf/src/positions.h - copied unchanged from r228060, head/contrib/gperf/src/positions.h stable/8/contrib/gperf/src/positions.icc - copied unchanged from r228060, head/contrib/gperf/src/positions.icc stable/8/contrib/gperf/src/search.cc - copied unchanged from r228060, head/contrib/gperf/src/search.cc stable/8/contrib/gperf/src/search.h - copied unchanged from r228060, head/contrib/gperf/src/search.h Replaced: stable/8/contrib/gperf/doc/gperf.texi - copied unchanged from r228068, head/contrib/gperf/doc/gperf.texi stable/8/contrib/gperf/doc/gpl.texinfo - copied unchanged from r228068, head/contrib/gperf/doc/gpl.texinfo Deleted: stable/8/contrib/gperf/acconfig.h stable/8/contrib/gperf/configure.in stable/8/contrib/gperf/doc/configure.in stable/8/contrib/gperf/doc/texinfo.tex stable/8/contrib/gperf/lib/configure.in stable/8/contrib/gperf/src/configure.in stable/8/contrib/gperf/src/gen-perf.h stable/8/contrib/gperf/src/iterator.cc stable/8/contrib/gperf/src/iterator.h stable/8/contrib/gperf/src/key-list.h stable/8/contrib/gperf/src/list-node.cc stable/8/contrib/gperf/src/list-node.h stable/8/contrib/gperf/src/new.cc stable/8/contrib/gperf/src/read-line.cc stable/8/contrib/gperf/src/read-line.h stable/8/contrib/gperf/src/read-line.icc stable/8/contrib/gperf/src/trace.cc stable/8/contrib/gperf/src/trace.h stable/8/contrib/gperf/src/vectors.cc stable/8/contrib/gperf/src/vectors.h stable/8/contrib/gperf/tests/ Modified: stable/8/contrib/gperf/AUTHORS stable/8/contrib/gperf/COPYING stable/8/contrib/gperf/ChangeLog stable/8/contrib/gperf/FREEBSD-Xlist stable/8/contrib/gperf/INSTALL stable/8/contrib/gperf/Makefile.devel stable/8/contrib/gperf/Makefile.in stable/8/contrib/gperf/NEWS stable/8/contrib/gperf/README stable/8/contrib/gperf/aclocal.m4 stable/8/contrib/gperf/configure stable/8/contrib/gperf/doc/Makefile.in stable/8/contrib/gperf/doc/configure stable/8/contrib/gperf/doc/gperf.1 stable/8/contrib/gperf/doc/help2man stable/8/contrib/gperf/lib/Makefile.in stable/8/contrib/gperf/lib/configure stable/8/contrib/gperf/lib/hash.cc stable/8/contrib/gperf/lib/hash.h stable/8/contrib/gperf/src/Makefile.in stable/8/contrib/gperf/src/bool-array.cc stable/8/contrib/gperf/src/bool-array.h stable/8/contrib/gperf/src/bool-array.icc stable/8/contrib/gperf/src/config.h.in stable/8/contrib/gperf/src/configure stable/8/contrib/gperf/src/hash-table.cc stable/8/contrib/gperf/src/hash-table.h stable/8/contrib/gperf/src/main.cc stable/8/contrib/gperf/src/options.cc stable/8/contrib/gperf/src/options.h stable/8/contrib/gperf/src/options.icc stable/8/contrib/gperf/src/version.cc stable/8/contrib/gperf/src/version.h stable/8/gnu/usr.bin/gperf/Makefile stable/8/gnu/usr.bin/gperf/config.h stable/8/sys/sys/param.h Directory Properties: stable/8/contrib/gperf/ (props changed) stable/8/gnu/usr.bin/gperf/ (props changed) Modified: stable/8/contrib/gperf/AUTHORS ============================================================================== --- stable/8/contrib/gperf/AUTHORS Mon Jan 16 22:26:25 2012 (r230238) +++ stable/8/contrib/gperf/AUTHORS Mon Jan 16 22:26:45 2012 (r230239) @@ -1,2 +1,2 @@ Douglas C. Schmidt -Bruno Haible +Bruno Haible Modified: stable/8/contrib/gperf/COPYING ============================================================================== --- stable/8/contrib/gperf/COPYING Mon Jan 16 22:26:25 2012 (r230238) +++ stable/8/contrib/gperf/COPYING Mon Jan 16 22:26:45 2012 (r230239) @@ -2,7 +2,7 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Modified: stable/8/contrib/gperf/ChangeLog ============================================================================== --- stable/8/contrib/gperf/ChangeLog Mon Jan 16 22:26:25 2012 (r230238) +++ stable/8/contrib/gperf/ChangeLog Mon Jan 16 22:26:45 2012 (r230239) @@ -1,3 +1,1646 @@ +2007-04-30 Brendan Kehoe + + * gperf-3.0.3 released. + * src/version.cc: Bump to 3.0.3. + * tests/*.exp: Bump to 3.0.3 in header. + * doc/gperf.1: Regenerate with gperf 3.0.3. + +2007-04-06 Bruno Haible + + Improve support for mingw. + * tests/Makefile.in (check-c, check-ada, check-modula3, check-pascal, + check-lang-utf8, check-lang-ucs2): Remove '\r' from output before diff. + (POSTPROCESS_FOR_MINGW): New variable. + (check-test): Use it to postprocess output before diff. + +2007-04-04 Bruno Haible + + Support for newer GNU standards. + * doc/configure.ac (mandir): Remove assignment. + * doc/Makefile.in (datarootdir): New variable. + (docdir, dvidir, psdir, pdfdir, htmldir): Use value determined by + autoconf. + * configure.ac: Require autoconf >= 2.60. + * doc/configure.ac: Likewise. + * lib/configure.ac: Likewise. + * src/configure.ac: Likewise. + * tests/configure.ac: Likewise. + * configure: Regenerated with autoconf-2.61. + * doc/configure: Likewise. + * lib/configure: Likewise. + * src/configure: Likewise. + * tests/configure: Likewise. + * src/config.h.in: Likewise. + * src/config.h.msvc: Likewise. + * src/config.h_vms: Likewise. + +2007-04-04 Bruno Haible + + * doc/Makefile.in (MAKEINFO): Disable also the LC_MESSAGES and LC_ALL + environment variables. + +2007-04-04 Bruno Haible + + * configure.ac: Renamed from configure.in. + * doc/configure.ac: Renamed from doc/configure.in. + * lib/configure.ac: Renamed from lib/configure.in. + * src/configure.ac: Renamed from src/configure.in. + * tests/configure.ac: Renamed from tests/configure.in. + * Makefile.devel: Update. + * INSTALL: Update. + +2007-03-31 Bruno Haible + + * tests/test.c (in_word_set): New declaration. + * tests/test2.c (in_word_set): Likewise. + +2007-03-31 Bruno Haible + + * src/options.cc (Options::parse_options): Bump copyright year. + +2007-03-31 Bruno Haible + + * doc/gperf.texi: Fix typo. + +2007-03-31 Bruno Haible + + Change generated code after the meaning of __inline is changed in + GCC 4.3. + * src/output.cc (Output::output_lookup_function): Emit an inline + marker that also works with gcc-4.3 in c99 or gnu99 mode. + * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp, + tests/cplusplus.exp, tests/gpc.exp, tests/incomplete.exp, + tests/java.exp, tests/languages.exp, tests/modula2.exp, + tests/objc.exp, tests/permut2.exp, tests/permut3.exp, + tests/permutc2.exp, tests/test-4.exp: Update. + Reported by Bruce Korb . + +2006-06-29 Brendan Kehoe + + * gperf-3.0.2 released. + + * doc/Makefile.in (all): No longer depend on dvi. + +2006-01-22 Brendan Kehoe + + * doc/gperf.texi: Update copyright to be 1989-2006. + (UPDATED): Change to 22 January 2006. + * doc/gperf.1 (TH): Fix date. + * configure.in: Update copyright years. + * configure: Regenerate. + * src/Makefile.in: Update copyright years. + + * doc/gperf.{dvi,ps,pdf}: Regenerated by manually invoking tex + instead of trying to use texi2dvi, whose run of etex ends up + actually always running pdfetex, thus always recreating gperf.pdf. + +2006-01-13 Brendan Kehoe + + * NEWS: Add note about #line directive fix. + * doc/gperf.1: Regenerate with Makefile.devel. + + * doc/gperf.texi (UPDATED): Correct to be today. + * doc: Regenerated by doing make in a configured tree. + Requires makeinfo, texi2dvi, texi2pdf, and texi2html. + + * configure.in: Add AC_OBJEXT and AC_EXEEXT. + * lib/Makefile.in (OBJEXT): Define for subst. + (OBJECTS): Use $(OBJEXT) instead of '.o'. + * src/Makefile.in: Make dependencies use $(OBJEXT). + (OBJEXT, EXEEXT): Define for subst. + (TARGETPROG): Add $(EXEEXT). + (OBJECTS): Use $(OBJEXT) instead of '.o'. + (clean): Remove *.$(OBJEXT) instead of *.o. + +2006-01-13 Bruno Haible + + Fix #line directives for filenames containing backslashes. + * src/output.cc (output_line_directive): New function. + (output_keyword_entry, Output::output): Use it. + Reported by Alexander . + + * src/options.cc (Options::parse_options): Update years in --version + output. + +2005-08-29 Brendan Kehoe + + * src/keyword.cc: Tweak comment to avoid nesting. + +2005-08-27 Bruno Haible + + Fix missing ranlib detection when cross-compiling. + * aclocal.m4 (CL_PROG_RANLIB): Remove macro. + * lib/configure.in: Use AC_PROG_RANLIB instead of CL_PROG_RANLIB. + +2005-07-30 Bruno Haible + + * src/version.cc: Bump version number to 3.0.2. + * doc/gperf.texi: Likewise. + * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp, + tests/cplusplus.exp, tests/gpc.exp, tests/incomplete.exp, + tests/java.exp, tests/languages.exp, tests/modula2.exp, + tests/objc.exp, tests/permut2.exp, tests/permut3.exp, + tests/permutc2.exp, tests/test-4.exp: Update. + +2005-07-30 Bruno Haible + + * src/positions.h: Add forward declarations of friend classes. + Needed for compilation with g++ 4.0. + +2004-08-22 Bruno Haible + + * tests/Makefile.in (check-lang-syntax): Add test for the + --length-table-name option. + * tests/test-6.exp: Update. + +2004-08-21 Bruce Lilly + + * src/input.cc (Input::read_input): Accept length-table-name + declaration. + * src/options.h (Options::get_lengthtable_name, + Options::set_lengthtable_name): New declarations. + (Options): Add field _lengthtable_name. + * src/options.icc (Options::get_lengthtable_name): New inline method. + * src/options.cc (DEFAULT_LENGTHTABLE_NAME): New constant. + (Options::long_usage): Document --length-table-name option. + (Options::Options): Initialize _lengthtable_name field. + (Options::~Options): Update. + (Options::set_lengthtable_name): New method. + (long_options): Add option --length-table-name. + (Options::parse_options): Implement --length-table-name option. + * src/output.cc (Output::output_keylength_table, output_switch_case, + Output::output_lookup_function_body): Use option.get_lengthtable_name. + * doc/gperf.texi (Gperf Declarations): Document %define + length-table-name. + (Output Details): Document --length-table-name option. + +2003-06-12 Bruno Haible + + * gperf-3.0.1 released. + + * src/version.cc: Bump version number to 3.0.1. + * doc/gperf.texi: Likewise. + * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp, + tests/cplusplus.exp, tests/gpc.exp, tests/incomplete.exp, + tests/java.exp, tests/languages.exp, tests/modula2.exp, + tests/objc.exp, tests/permut2.exp, tests/permut3.exp, + tests/permutc2.exp, tests/test-4.exp: Update. + +2003-05-31 Bruno Haible + + * doc/gperf.texi (User-supplied Struct): Mention the possibility of an + abbreviated struct declaration. + * src/input.cc (Input::read_input): Support struct declarations of the + form "struct foo;". + * tests/incomplete.gperf: New file. + * tests/incomplete.exp: New file. + * tests/Makefile.in (check-test): Check incomplete.gperf too. + Reported by Rob Leslie . + +2003-05-20 Bruno Haible + + * doc/Makefile.in (gperf.ps): Don't use $< in a target rule. + +2003-05-27 Bruno Haible + + * Makefile.vms (CC): Correct value. + (getopt.obj, getopt1.obj, getline.obj, hash.obj): Don't set + HAVE_CONFIG_H. + +2003-05-17 Bruno Haible + + * Makefile.msvc (DEBUGFLAGS): New variable. + (gperf.exe): Use it, and MFLAGS too. + +2003-05-08 Bruno Haible + + * gperf-3.0 released. + +2003-05-07 Bruno Haible + + * src/version.cc: Bump version number to 3.0. + * doc/gperf.texi: Likewise. + * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp, + tests/cplusplus.exp, tests/gpc.exp, tests/java.exp, + tests/languages.exp, tests/modula2.exp, tests/objc.exp, + tests/permut2.exp, tests/permut3.exp, tests/permutc2.exp, + tests/test-4.exp: Update. + + * src/configure.in: Fix AC_INIT argument. + + * Makefile.devel (configure, lib/configure, src/configure, + tests/configure, doc/configure): Use the newest autoconf. + (src/config.h.in): Use the newest autoheader. + +2003-05-03 Bruno Haible + + * doc/gperf.texi: Use two spaces as sentence separator, as recommended + by the texinfo manual. + +2003-04-12 Bruno Haible + + * doc/configure.in (mandir): Change default value. + * doc/Makefile.in (docdir): Use datadir instead of prefix. + * Makefile.msvc (datadir): New variable. + (mandir, docdir): Use it instead of prefix. + (install, installdirs): Update. + * Makefile.vms (datadir): New variable. + (mandir, docdir): Use it instead of prefix. + (install, installdirs): Update. + +2003-04-12 Bruno Haible + + * README.vms: New file. + * Makefile.vms: New file. + * Makefile.devel (src/config.h_vms): New rule. + (all): Depend on it. + +2003-03-19 Bruno Haible + + * src/input.cc (Input::read_input): Ignore comments at the beginning + of the declarations section. + * doc/gperf.texi (Controls for GNU indent): New section. + Reported by Bruce Lilly . + +2003-03-19 Bruno Haible + + * src/output.cc (Output::output_hash_function): Avoid lint warning if + not all arguments of the hash function are used. Avoid lint warning + for fallthrough in switch. + * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp, + tests/cplusplus.exp, tests/java.exp, tests/languages.exp, + tests/modula2.exp, tests/objc.exp: All /*FALLTHROUGH*/ to expected + output. + Reported by Bruce Lilly . + +2003-03-01 Bruno Haible + + * src/options.h (Options::set_initializer_suffix): New declaration. + * src/options.cc (Options::set_initializer_suffix): New method. + * src/input.cc (Input::read_input): Recognize %define + initializer-suffix. + * doc/gperf.texi (Gperf Declarations): Document %define + initializer-suffix. + * NEWS: Update. + +2003-02-26 Bruno Haible + + * Makefile.msvc: New file. + * README.woe32: New file. + * Makefile.devel (all): Depend on src/config.h.msvc. + (src/config.h.msvc): New rule. + +2003-01-07 Bruno Haible + + * src/input.h (Input::_charset_dependent): New field. + * src/input.cc (Input::read_input): Also set _charset_dependent. + * src/main.cc (main): Pass _charset_dependent from Input to Output. + * src/output.h (Output::Output): Add charset_dependent argument. + (Output::_charset_dependent): New field. + * src/output.cc (Output::Output): Add charset_dependent argument. + (Output::output): Provoke a compilation error if the execution + character set doesn't match the expectations. + * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp, + tests/cplusplus.exp, tests/gpc.exp, tests/java.exp, + tests/languages.exp, tests/modula2.exp, tests/objc.exp, + tests/permut2.exp, tests/permut3.exp, tests/permutc2.exp, + tests/test-4.exp: Update. + + * src/options.cc (Options::long_usage): Change bug report address to + . + * tests/test-6.exp: Update. + + * src/output.cc (USE_DOWNCASE_TABLE): New macro. + (output_upperlower_table): New function. + (output_upperlower_strcmp, output_upperlower_strncmp, + output_upperlower_memcmp): Emit gperf_downcase array accesses. + (Output::output): Call output_upperlower_table. + * tests/permutc2.exp: Update. + + * src/keyword-list.icc (KeywordExt_List::rest): Use a portable cast. + (Only in GCC a cast of an lvalue is an lvalue.) + +2003-01-01 Bruno Haible + + * src/options.cc (Options::parse_options): Update copyright year. + + * doc/gperf.texi (@author): Add me. + + * src/options.h (NULLSTRINGS): New enum value. + (Options::get_stringpool_name, Options::set_stringpool_name): New + method declarations. + (Options::_stringpool_name): New field. + * src/options.icc (Options::get_stringpool_name): New method. + * src/options.cc (DEFAULT_STRINGPOOL_NAME): New variable. + (Options::long_usage): Document -Q and --null-strings. + (Options::Options): Initialize _stringpool_name. + (Options::~Options): Output _stringpool_name, NULLSTRINGS values too. + (Options::set_stringpool_name): New method. + (long_options): Add options --string-pool-name, --null-strings. + (Options::parse_options): Implement options -P, -Q and --null-strings. + * src/input.cc (Input::read_input): Recognize declarations %pic, + %define string-pool-name, %null-strings. + * src/output.h (Output::output_string_pool, + Output::output_lookup_pools): New method declarations. + (Output::_wordlist_eltype): New field. + * src/output.cc (Output::output_keylength_table): Trivial + simplification. + (Output::output_string_pool): New method. + (output_keyword_entry): Add stringpool_index argument. For SHAREDLIB, + use struct offsets. + (output_keyword_blank_entries): For SHAREDLIB, use -1 instead of "". + (Output::output_keyword_table): Use _wordlist_eltype instead of + _struct_tag. Compute stringpool_index for output_keyword_entry. + (Output::output_lookup_pools): New method. + (Output::output_lookup_function_body): Use _wordlist_eltype instead of + _struct_tag. For SHAREDLIB, use "+ stringpool" to convert offsets to + strings. Use "o >= 0" to test for nonempty table entry. + (Output::output_lookup_function): Call output_lookup_pools. + (Output::output): Initialize _wordlist_eltype. Call + output_lookup_pools. + * tests/jstest4.gperf: New file. + * tests/test-6.exp: Update. + * tests/Makefile.in (check-lang-syntax): Drop test of -p. Add tests of + -P and -Q. + * doc/gperf.texi (User-supplied Struct): Mention that first field has + to be of type 'int' if -P is given. + (Gperf Declarations): Document %pic, %define string-pool-name, + %null-strings. + (Output Details): Update description of option -P. Document options -Q + and --null-strings. + + * tests/Makefile.in (check-link-c, check-ada, check-pascal, + check-test): Omit option -p. + * tests/c-parse.exp: Regenerated. + * tests/chill.exp: Regenerated. + * tests/cplusplus.exp: Regenerated. + * tests/gpc.exp: Regenerated. + * tests/java.exp: Regenerated. + * tests/objc.exp: Regenerated. + * tests/test-4.exp: Regenerated. + + * src/output.cc (Output::output_lookup_function_body): Omit the + multicompare code section and its variables when it is not used. + * tests/chill.exp: Regenerated. + + * src/output.c (Output_Compare::output_firstchar_comparison): New + method. + (Output_Compare_Strcmp::output_comparison, + Output_Compare_Strncmp::output_comparison, + Output_Compare_Memcmp::output_comparison): Use it. + * tests/permutc2.exp: Update. + + * tests/smtp.gperf: New file, based on a contribution by Bruce Lilly. + * tests/Makefile.in (check-smtp): New rule. + (check): Depend on it. + (clean): Update. + +2002-12-12 Bruno Haible + + * src/search.h (Search::init_selchars_tuple, + Search::count_duplicates_tuple): Add alpha_unify argument. + (Search::count_duplicates_tuple): New method declaration. + * src/search.cc (Search::init_selchars_tuple, + Search::count_duplicates_tuple): Add alpha_unify argument. + (Search::find_positions): Update. + (Search::count_duplicates_tuple): New method. + (Search::count_duplicates_multiset): Free temp alpha_unify vector. + (Search::find_alpha_inc): Call count_duplicates_tuple. + + * src/configure.in: Add test for stack-allocated variable-size arrays. + * src/config.h.in: Regenerated. + * src/search.cc: Include config.h. + (DYNAMIC_ARRAY, FREE_DYNAMIC_ARRAY): New macros. + (Search::find_alpha_inc, Search::count_possible_collisions, + Search::find_asso_values): Use them. + * src/Makefile.in (search.o): Depend on config.h. + + * src/search.h (Search::keyword_list_length, Search::max_key_length, + Search::get_max_keysig_size, Search::prepare): Remove declarations. + (Search::prepare): Renamed from Search::preprepare. + (Search::_max_selchars_length): New field. + * src/search.cc (Search::prepare): Renamed from Search::preprepare. + (Search::prepare_asso_values): Merged with old Search::prepare. + Initialize _max_selchars_length. + (Search::keyword_list_length): Remove function. Use _list_len instead. + (Search::max_key_length): Remove function. Use _max_key_len instead. + (Search::get_max_keysig_size): Remove function. Use + _max_selchars_length instead. + (Search::count_possible_collisions, Search::find_asso_values): Update. + (Search::find_good_asso_values): Call just prepare_asso_values. + (Search::~Search): Update. + + * src/output.h (Output::output_asso_values_ref): New declaration. + * src/output.cc (char_to_index): Remove variable. + (Output::output_asso_values_ref): New function. + (Output::output_hash_function): Use it. + (Output::output): Update. + + * src/positions.h (Positions::is_useall, Positions::set_useall, + Positions::iterator, Positions::reviterator): New method declarations. + (Positions::_useall): New field. + (PositionIterator): Make constructor private. Add a constructor and a + copy constructor. + (PositionIterator::remaining): New declaration. + (PositionReverseIterator): Make constructor private. Add a constructor + and a copy constructor. + (PositionReverseIterator::remaining): New declaration. + (PositionReverseIterator::_minindex): New field. + * src/positions.icc (Positions::Positions): Initialize _useall. + (Positions::operator=): Likewise. + (Positions::is_useall, Positions::set_useall): New methods. + (Positions::sort): Do nothing if _useall is set. + (Positions::iterator, Positions::reviterator): New methods. + (PositionIterator::PositionIterator): New constructor. + (PositionIterator::remaining): New method. + (PositionReverseIterator::PositionReverseIterator): New constructor. + (PositionReverseIterator::next): Use _minindex as bound. + (PositionReverseIterator::remaining): New method. + * src/positions.cc (Positions::add, Positions::remove): Reset the + useall flag. + (Positions::print): Handle the useall case. + * src/options.h (ALLCHARS): Remove. + * src/options.cc (Options::~Options): Update. + (Options::parse_options): Use Positions::set_useall(). + * src/keyword.h (KeywordExt::init_selchars_tuple, + KeywordExt::init_selchars_multiset, KeywordExt::init_selchars_low): + Remove use_all_chars argument. + * src/keyword.cc (KeywordExt::init_selchars_low): Remove use_all_chars + argument. Tell the position iterator to stop at _allchars_length. + Remove special case code for -k'*'. + (KeywordExt::init_selchars_tuple, KeywordExt::init_selchars_multiset): + Remove use_all_chars argument. + * src/search.h (Search::init_selchars_tuple): Remove use_all_chars + argument. + (Search::init_selchars_multiset): Likewise. + * src/search.cc (Search::init_selchars_tuple): Remove use_all_chars + argument. + (Search::count_duplicates_tuple, Search::find_positions): Update. + (Search::compute_alpha_unify): Remove special case code for -k'*'. + (Search::init_selchars_multiset): Remove use_all_chars argument. + (Search::count_duplicates_multiset): Update. + (Search::find_alpha_inc): Remove special case code for -k'*'. + (Search::prepare): Update. + (Search::get_max_keysig_size): Update. + * src/output.cc (Output::output_hash_function): Remove special case + code for -k'*'. + * tests/chill.exp: Regenerated. + +2002-12-11 Bruno Haible + + Change the positions to be 0-based, instead of 1-based. + * src/positions.h (Positions::LASTCHAR): Set to -1. + (Positions::MAX_SIZE): New constant. + (Positions::pointer): Change return type. + (Positions::_positions): Change element type. + (PositionIterator::EOS, PositionReverseIterator::EOS): Set to -2. + * src/positions.icc (Positions::pointer): Change return type. + (Positions::sort): Update. + * src/positions.cc (Positions::contains, Positions::add, + Positions::remove): Update. + (Positions::print): Update. Fix off-by-one bug. + * src/options.cc (Options::~Options): Update. + (Options::parse_options): Set BAD_VALUE to -3. Update. + * src/keyword.cc (KeywordExt::init_selchars_low): Update. + * src/search.cc (Search::find_positions, Search::compute_alpha_unify, + Search::find_alpha_inc): Update. + * src/output.cc (Output::output_hash_function): Update. Don't emit + a 'case' statement right after 'default:'. + * tests/c-parse.exp: Regenerated. + * tests/charsets.exp: Regenerated. + * tests/cplusplus.exp: Regenerated. + * tests/java.exp: Regenerated. + * tests/languages.exp: Regenerated. + * tests/modula2.exp: Regenerated. + * tests/objc.exp: Regenerated. + +2002-12-10 Bruno Haible + + * src/options.h: Reorder enum values. + (Options::short_usage, Options::long_usage): Make static. + * src/options.cc (Options::short_usage); No longer print a monster + usage line. + (Options::print_options): Improve output of options like + --key-positions=1,2,$. + (Options::~Options): Update. + + * src/options.h (UPPERLOWER): New enum value. + * src/options.cc (Options::long_usage): Document option --ignore-case. + (Options::~Options): Update. + (long_options): Add option --ignore-case. + (Options::parse_options): Handle option --ignore-case. + * src/input.cc (Input::read_input): Recognize option %ignore-case. + * src/keyword.h (KeywordExt::init_selchars_tuple, + KeywordExt::init_selchars_multiset, KeywordExt::init_selchars_low): + Add alpha_unify argument. + * src/keyword.cc (KeywordExt::init_selchars_low): Add alpha_unify + argument. + (KeywordExt::init_selchars_tuple): Add alpha_unify argument. + (KeywordExt::init_selchars_multiset): Add alpha_unify argument. + * src/search.h (Search::compute_alpha_size, + Search::compute_alpha_unify): New declarations. + (Search::init_selchars_multiset): Add alpha_unify argument. + (Search::_alpha_unify): New field. + * src/search.cc (Search::compute_alpha_size, + Search::compute_alpha_unify): New functions. + (Search::init_selchars_tuple): Update. + (Search::find_positions): Temporarily set _alpha_unify. Perform a + case insensitive comparison if needed. + (Search::init_selchars_multiset): Add alpha_unify argument. + (Search::count_duplicates_multiset): Call compute_alpha_unify. + (Search::find_alpha_inc): Temporarily set _alpha_unify. At the end, + set _alpha_size and _alpha_unify. + (Search::prepare): Update. Don't compute _alpga_size here. + (Search::optimize): Propagate unified asso_values. + (Search::~Search) Delete _alpha_unify. + * src/output.cc (output_upperlower_strcmp, output_upperlower_strncmp, + output_upperlower_memcmp): New functions. + (Output_Compare_Strcmp::output_comparison, + Output_Compare_Strncmp::output_comparison, + Output_Compare_Memcmp::output_comparison): Use the case-insensitive + comparison function if --ignore-case was given. + (Output::output): Emit the auxiliary case-insensitive comparison + function if needed. + * tests/permutc2.gperf, tests/permutc2.exp: New files. + * tests/Makefile.in (check-test): Also check permutc2.gperf. + * tests/test-6.exp: Update. + * doc/gperf.texi (Gperf Declarations): Document %ignore-case. + (Input Details): Document option --ignore-case. + * NEWS: Update. + + * src/search.cc (Search::optimize): Fill unused asso_values[] entries + with a large value. + * src/output.h (Output::Output): Remove occurrences argument. + (Output::_occurrences): Remove field. + * src/output.cc (Output::Output): Remove occurrences argument. + (Output::output_hash_function): Ignore _occurrences. + * src/main.cc (main): Don't pass the _occurrences to Output. + + * src/search.cc (Search::preprepare): Exit if keywords contain + out-of-range characters. + + * src/search.cc (for): Define so as to avoid errors with old compilers. + + * src/options.h (SHAREDLIB): New enum value. + * src/options.cc (Options::short_usage): Mention option -P. + (Options::long_usage): Document option -P. + (long_options): Add option --pic. + (Options::parse_options): Handle option -P/--pic. + * src/output.cc (output_keyword_blank_entries): When SHAREDLIB is + specified, emit NULL pointers instead of "". + (Output::output_lookup_function_body): When SHAREDLIB is specified + and SWITCH and DUP and not specified, test the table entry against + NULL before the string comparison. + * tests/test-6.exp: Update. + * doc/gperf.texi (Output Details): Document option -P. + * NEWS: Update. + Suggested by Ulrich Drepper. + +2002-12-08 Bruno Haible + + * tests/permut2.gperf, tests/permut2.exp: New files. + * tests/permut3.gperf, tests/permut3.exp: New files. + * tests/charsets.gperf: New file, from Bruce Lilly. + * tests/charsets.exp: New file. + * tests/languages.gperf: New file, from Bruce Lilly. + * tests/languages.exp: New file. + * Makefile.in (check-test): Test them all. + + Completely new asso_values search algorithm. + * src/search.h (Search::compute_occurrence, Search::clear_determined, + Search::set_determined, Search::already_determined, Search::reorder): + Remove functions. + (Search::init_asso_values, Search::sort_by_occurrence, + Search::compute_occurrence, Search::sort_by_occurrence, + Search::has_collisions, Search::collision_prior_to): Remove functions. + (Search::compute_partition, Search::count_possible_collisions, + Search::unchanged_partition): New method declarations. + (Search::_determined): Remove field. + * src/search.cc (Search::prepare): Don't initialize _determined. + (Search::compute_occurrence, greater_by_occurrence, + Search::clear_determined, Search::set_determined, + Search::already_determined, Search::reorder): Remove functions. + (Search::init_asso_values, compute_disjoint_union, + Search::sort_by_occurrence, Search::compute_occurrence, + Search::sort_by_occurrence, Search::has_collisions, + Search::collision_prior_to): Remove functions. + (StackEntry): Remove class. + (EquivalenceClass, Step): New classes. + (equals, Search::compute_partition, delete_partition, + Search::count_possible_collisions, Search::unchanged_partition): New + functions. + (Search::find_asso_values): Completely rewritten. + (Search::find_good_asso_values): Don't call reorder(). + (Search::~Search): Don't free _determined. + * src/keyword.h (KeywordExt::_occurrence): Remove field. + * src/options.h (ORDER, FAST, OPT_CHOICE): Remove enum values. + (Options::_iterations): Remove field. + * src/options.icc (Options::get_iterations): Remove method. + * src/options.cc (Options::long_usage): Remove mention of -f and -o. + (Options::Options): Don't initialize _iterations. + (Options::~Options): Update. + (Options::parse_options): Do nothing for options -f, -o, -O. + * doc/gperf.texi: (Contributors): Update. + (Algorithmic Details): Remove options -f and -o. Update description + of option -s. + * tests/c-parse.exp, tests/chill.exp, tests/cplusplus.exp, + tests/gpc.exp, tests/java.exp, tests/modula2.exp, tests/objc.exp, + tests/test-4.exp): Regenerated, smaller than before. + * tests/test-6.exp: Update. + * NEWS: Update. + +2002-12-08 Bruno Haible + + * src/search.h (Search::_alpha_size): Change type to 'unsigned int'. + (Search::_asso_value_max): Likewise. + * src/search.cc (Search::prepare_asso_values): Update. + (Search::init_asso_values): Update. + (Search::~Search): Update. + * src/output.h (Output::Output): Change alpha_size type to + 'unsigned int'. + (Output::_alpha_size): Change type to 'unsigned int'. + * src/output.cc (Output::Output): Change alpha_size type to + 'unsigned int'. + (Output::output_hash_function): Update. + +2002-12-07 Bruno Haible + + * src/options.h (OPT_CHOICE): New enum value. + * src/options.cc (Options::~Options): Update. + (long_options): New option --optimized-collision-resolution. + (Options::parse_options): Accept option -O. + * src/search.h (Search::sort_by_occurrence): Change argument to + 'unsigned int'. + (Search::compute_occurrence, Search::sort_by_occurrence): New method + declarations. + * src/search.cc (Search::sort_by_occurrence): Change argument to + 'unsigned int'. + (Search::compute_occurrence, Search::sort_by_occurrence): New methods. + (Search::find_asso_values): Implement OPT_CHOICE. More debugging + output. + + * src/search.cc (Search::prepare_asso_values) [DEBUG]: Also print + the keyword list in order. + (Search::find_asso_values) [DEBUG]: Upon failure, print the union_set. + + * src/options.h (Options::get_size_multiple): Change return type to + float. + (Options::_size_multiple): Change type to float. + * src/options.icc (Options::get_size_multiple): Change return type to + float. + * src/options.cc (Options::long_usage): Update description of option + -s. + (Options::~Options): Update. + (Options::parse_options): For option -s, accept a fraction. + * src/search.cc (Search::prepare_asso_values): Use get_size_multiple + as it is. + * tests/test-6.exp: Update. + * doc/gperf.texi (Algorithmic Details): Update description of option + -s. + +2002-12-04 Bruno Haible + + Improve debugging output. + * src/hash-table.h (Hash_Table::dump): New method. + * src/hash-table.cc (Hash_Table::dump): New method, extracted from + destructor. + (Hash_Table::~Hash_Table): No longer print the contents. + * src/positions.h (PositionReverseIterator): New class. + * src/positions.icc (PositionReverseIterator::PositionReverseIterator, + PositionReverseIterator::next): New methods. + * src/search.cc (Search::find_positions): If debugging, print the + result. + (Search::find_alpha_inc): If debugging, print the result. + (Search::prepare): Explicitly dump the hash table's contents here. + + Portability fixes. + * src/positions.h (Positions::LASTCHAR, Positions::MAX_KEY_POS, + PositionIterator::EOS): Define as compile-time constants using enum. + * src/bool-array.cc (Bool_Array::~Bool_Array): Remove const qualifier + of pointer to be deleted. + * src/input.cc (Input::~Input): Likewise. + * src/keyword.cc (KeywordExt::delete_selchars): Likewise. + * src/main.cc (main): Likewise. + * src/hash-table.cc (Hash_Table::~Hash_Table): Limit scope of 'for' + variables. + * src/search.cc (Search::prepare_asso_values): Use a static_cast to + convert from time_t to long. This is possible because ISO C 99 says + time_t is a numeric type. + +2002-11-20 Bruno Haible + + * src/search.cc (Search::find_asso_values): Avoid gcc warnings about + uninitialized variables. + + Implement backtracking. + * src/search.h (Search::has_collisions): Renamed from + Search::less_collisions. Return a boolean. + * src/search.cc (Search::has_collisions): Renamed from + Search::less_collisions. Return a boolean. + (StackEntry): Remove field _collisions_so_far. + (Search::find_asso_values): Backtrack when encountering an unresolved + collision. Assume collisions_so_far is always zero. + (Search::optimize): Exit if there are accidental duplicates at the end. + * src/output.cc (Output::num_hash_values): Simply return the list + length. + (Output::output_keylength_table): Remove handling of accidental + duplicates. + (Output::output_keyword_table, Output::output_lookup_array): Likewise. + (output_switch_case, output_switches): Likewise. + * doc/gperf.texi (Algorithmic Details): Adjust description of options + -D, -f, -o, -r. + (Bugs): Remove note about missing backtracking. + (Projects): Likewise. + +2002-11-19 Bruno Haible + + Prepare for backtracking. + * src/search.h (Search::try_asso_value, Search::change_some_asso_value): + Remove declarations. + (Search::less_collisions, Search::collision_prior_to): New declarations. + (Search::_fewest_collisions, Search::_union_set, Search::_num_done): + Remove fields. + * src/search.cc (Search::prepare_asso_values): Don't initialize + _union_set. + (Search::try_asso_value, Search::change_some_asso_value): Remove + methods. + (Search::less_collisions, Search::collision_prior_to): New methods. + (StackEntry): New class. + (Search::find_asso_values): Reorganized to use pseudo-recursion. + (Search::~Search): Don't free _union_set. + + * src/search.h (Search::find_good_asso_values): New declaration. + * src/search.cc: Add comments about the basic structure of the + algorithm. + (Search::find_positions): Move the option[POSITIONS] test to here. + (Search::find_good_asso_values): New method, extracted from + Search::optimize. + (Search::optimize): Remove option[POSITIONS] test. Call + find_good_asso_values. + +2002-11-17 Bruno Haible + + * src/options.cc (Options::parse_options): Include copyright notice + and authors in --version output. + + Avoid artificial duplicates. + * src/keyword.h (KeywordExt::init_selchars_tuple): New declaration. + (KeywordExt::init_selchars_multiset): Renamed from + KeywordExt::init_selchars. + (KeywordExt::init_selchars_low): New declaration. + * src/keyword.cc (KeywordExt::init_selchars_low): Renamed from + KeywordExt::init_selchars. Add alpha_inc argument. Remove sorting. + (KeywordExt::init_selchars_tuple): New method. + (KeywordExt::init_selchars_multiset): New method, replaces + KeywordExt::init_selchars. + * src/search.h (Search::init_selchars_tuple): Renamed from + Search::init_selchars. + (Search::count_duplicates_tuple): Renamed from Search::count_duplicates. + (Search::init_selchars_multiset, Search::count_duplicates_multiset, + Search::find_alpha_inc): New declarations. + (Search::_alpha_inc): New field. + (Search::_alpha_size, Search::_occurrences, Search::_asso_values, + Search::_determined): Make non-const. + * src/search.cc (Search::Search): Don't initialize _key_positions, + _alpha_size, _occurrences, _asso_values, _determined here. + (Search::init_selchars_tuple): Renamed from Search::init_selchars. + (Search::count_duplicates_tuple): Renamed from Search::count_duplicates. + (Search::find_positions): Update. + (Search::init_selchars_multiset, Search::count_duplicates_multiset, + Search::find_alpha_inc): New methods. + (Search::prepare): Move preprepare, find_positions calls away. + Initialize _alpha_size, _occurrences, _asso_values, _determined here. + (Search::optimize): Call preprepare, find_positions here. Initialize + _key_positions here. + (Search::~Search): Deallocate _alpha_inc. + * src/output.cc (Output::Output): Add alpha_inc argument. + (Output::output_hash_function): Use _alpha_inc. + * src/output.h (Output::Output): Add alpha_inc argument. + (Output::_alpha_inc): New field. + * src/main.cc (main): Pass _alpha_inc from Search to Output. + * tests/chill.exp: Update. + * doc/gperf.texi (Algorithmic Details): Remove description of + artificial duplicates. + + * src/keyword.h (KeywordExt::_selchars): Change type to + 'const unsigned int *'. + * src/keyword.cc (sort_char_set): Change argument type to + 'unsigned int *'. + (KeywordExt::init_selchars): Update. + * src/search.h (Search::sort_by_occurrence): Change argument type to + 'unsigned int *'. + (Search::try_asso_value): Change argument type to 'unsigned int'. + (Search::_union_set): Change type to 'unsigned int *'. + * src/search.cc (Search::prepare, Search::compute_occurrence, + Search::set_determined, Search::already_determined, + Search::prepare_asso_values, Search::compute_hash): Update. + (compute_disjoint_union): Change argument types to 'unsigned int *'. + (Search::sort_by_occurrence): Likewise. + (Search::try_asso_value): Change argument type to 'unsigned int'. + (Search::change_some_asso_value, Search::~Search): Update. + * src/hash-table.cc (Hash_Table::~Hash_Table, Hash_Table::equal, + Hash_Table::insert): Update. + + * src/positions.h: New file, extracted from options.h. + * src/positions.icc: New file, extracted from options.icc. + * src/positions.cc: New file, extracted from options.cc. + * src/options.h: Include positions.h. Move classes Positions and + PositionsIterator away. + * src/options.icc: Move classes Positions and PositionsIterator away. + * src/options.cc: Move class Positions away. + * src/keyword.cc: Include positions.h instead of options.h. + * src/output.h: Include positions.h instead of options.h. + * src/search.h: Include positions.h instead of options.h. + * src/Makefile.in (OBJECTS): Add positions.o. + (POSITIONS_H): New variable. + (OPTIONS_H, SEARCH_H, OUTPUT_H, keyword.o): Use it. + (positions.o): New rule. + + * src/options.h (POSITIONS): New enum value. + (Positions::Positions): New copy constructor. + (Positions::operator=, Positions::contains, Position::add, + Positions::remove, Positions::print): New method declaration. + (Options::get_max_keysig_size): Remove method. + * src/options.icc (Positions::Positions): New copy constructor. + (Positions::operator=): New method. + (Options::get_max_keysig_size): Remove method. + * src/options.cc (Options::Options): Initialize _key_positions + trivially. + (Options::parse_options): Option -k sets POSITIONS. + (Positions::contains, Positions::add, Positions::remove, + Positions::print): New methods. + * src/hash-table.cc (Hash_Table::~Hash_Table): Compute the field + width explicitly, instead of using Options::get_max_keysig_size. + * src/keyword.h (KeywordExt::init_selchars): Add arguments + use_all_chars, positions. + (KeywordExt::delete_selchars): New declaration. + * src/keyword.cc (KeywordExt::init_selchars): Add arguments + use_all_chars, positions. Remove error message if there are no key + positions. + (KeywordExt::delete_selchars): New method. + * src/search.h: Include options.h. + (Search::preprepare, Search::init_selchars, Search::delete_selchars, + Search::count_duplicates, Search::find_positions): New declarations. + (Search::_key_positions): New field. + * src/search.cc (Search::Search): Initialize _key_positions. + (Search::preprepare, Search::init_selchars, Search::delete_selchars, + Search::count_duplicates, Search::find_positions): New functions. + (Search::prepare): Call preprepare and find_positions. Tweak error + message. + (Search::get_max_keysig_size): Use _key_positions instead of + option.get_key_positions(). + (Search::optimize): Tweak error message. + * src/output.h: Include options.h. + (Output::Output): Add Positions argument. + (Output::_key_positions): New field. + * src/output.cc (Output::Output): Add Positions argument. + (Output::output_hash_function): Omit the table if there are no + positions at all. Use _key_positions instead of + option.get_key_positions(). + (Output::output): Output the computed positions as a comment. + * src/main.cc (main): Pass the Positions from Searcher to Output. + * src/Makefile.in (SEARCH_H, OUTPUT_H): Include OPTIONS_H. + * tests/Makefile.in (check-test): Pass key positions explicitly. + * tests/gpc.exp: Update. + * tests/test-4.exp: Update. + * doc/gperf.texi (Algorithmic Details): Mention that -k is not needed + usually. + +2002-11-16 Bruno Haible + + * src/options.h (Options::get_slot_name): Renamed from + Options::get_key_name. + (Options::set, Options::set_language, Options::set_total_switches, + Options::set_function_name, Options::set_slot_name, + Options::set_class_name, Options::set_hash_name, + Options::set_wordlist_name, Options::set_delimiters): New method + declarations. + (Options::_language): New field. + (Options::_slot_name): Renamed from Options::_key_name. + * src/options.icc (Options::set): New method. + (Options::get_slot_name): Renamed from Options::get_key_name. + * src/options.cc (DEFAULT_FUNCTION_NAME): Renamed from DEFAULT_NAME. + (DEFAULT_SLOT_NAME): Renamed from DEFAULT_NAME. + (Options::Options): Initialize _language. Update. + (Options::~Options): Update. + (Options::set_language, Options::set_total_switches, + Options::set_function_name, Options::set_slot_name, + Options::set_class_name, Options::set_hash_name, + Options::set_wordlist_name, Options::set_delimiters): New methods. + (Options::parse_options): Call set_language. Update. + * src/input.cc (is_declaration, is_declaration_with_arg, + is_define_declaration): New functions. + (Input::read_input): Accept %DECL declarations. + * src/output.cc (Output::output_lookup_function_body): Update. + * doc/gperf.texi (Declarations): Add new subnodes. + (User-supplied Struct, Gperf Declarations, C Code Inclusion): New + nodes. + (Keywords, Output Format, Binary Strings, Options): Mention % + declarations as being equivalent to the command line options. + + * src/options.cc (Options::long_usage): Rename options -H, -N, -l, -G. + (long_options): Add --hash-function-name, --lookup-function-name, + --compare-lengths. + * doc/gperf.texi (Output Details): Rename options -H, -N, -l, -G. + * tests/test-6.exp: Update. + + * src/options.cc (DEFAULT_DELIMITERS): Remove newline. + * src/options.cc (Options::long_usage): Change default --delimiters. + * doc/gperf.texi (Input Details): Likewise. + * tests/test-6.exp: Update. + + * doc/gperf.texi: Move description of option -l from section + Algorithmic Details to section Output Details. + * src/options.cc (Options::long_usage): Likewise. + * tests/test-6.exp: Update. + +2002-11-12 Bruno Haible + + * src/options.h (Output::get_output_file_name): New method. + (Output::_output_file_name): New field. + * src/options.icc (Options::get_output_file_name): New method. + * src/options.cc (Options::long_usage): Document option --output-file. + (Options::Options): Initialize _output_file_name. + (long_options): Add --output-file. + (Options::parse_options): Handle it. + * src/main.cc (main): Open the output file if given by name. + * doc/gperf.texi (Output File): New section. + * tests/test-6.exp: Update. + +2002-11-10 Bruno Haible + + * src/input.cc (pretty_input_file_name): New function. + (read_input): Use it in all error and warning messages. + + * src/keyword.h (Keyword::_lineno): New field. + * src/input.h (Input::_struct_decl_lineno): New field. + * src/input.cc (Input::read_input): Set _struct_decl_lineno. Fill + each keyword's _lineno field. + * src/main.cc (main): Pass _struct_decl_lineno from Input to Output. + * src/output.h (Output::Output) Add struct_decl_lineno argument. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 16 22:49:11 2012 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B0021065672; Mon, 16 Jan 2012 22:49:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id B9F1C8FC13; Mon, 16 Jan 2012 22:49:09 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA26346; Tue, 17 Jan 2012 00:49:08 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RmvMR-0002SN-RQ; Tue, 17 Jan 2012 00:49:07 +0200 Message-ID: <4F14A962.3090209@FreeBSD.org> Date: Tue, 17 Jan 2012 00:49:06 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201201152052.q0FKqVT1099586@svn.freebsd.org> <4F146140.4040203@FreeBSD.org> In-Reply-To: X-Enigmail-Version: undefined Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler , svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r230159 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 22:49:11 -0000 on 16/01/2012 23:40 Bjoern A. Zeeb said the following: > > On 16. Jan 2012, at 17:41 , Andriy Gapon wrote: > >> on 15/01/2012 22:52 Eitan Adler said the following: >>> Author: eadler (ports committer) >>> Date: Sun Jan 15 20:52:31 2012 >>> New Revision: 230159 >>> URL: http://svn.freebsd.org/changeset/base/230159 >>> >>> Log: >>> MFC r228343: >>> - Fix ktrace leakage if error is set >>> >>> PR: kern/163098 >>> Approved by: sbruno >>> >>> Modified: >>> stable/8/sys/kern/kern_ktrace.c >>> Directory Properties: >>> stable/8/sys/ (props changed) >> >> Eitan, >> >> the list of the directory properties changes seems to be too short. >> Have you made a common mistake of "cleaning up" the results of svn merge or do you >> have a sparse checkout of sys? Or something else? > > I think he just uses svn 1.7.x I haven't realized that the newer svn records the mergeinfo properties differently from 1.6. Sorry for the noise, Eitan and all. And thank you for the information, Bjoern. >> >>> Modified: stable/8/sys/kern/kern_ktrace.c >>> ============================================================================== >>> --- stable/8/sys/kern/kern_ktrace.c Sun Jan 15 20:52:01 2012 (r230158) >>> +++ stable/8/sys/kern/kern_ktrace.c Sun Jan 15 20:52:31 2012 (r230159) >>> @@ -473,7 +473,7 @@ ktrsysret(code, error, retval) >>> ktp = &req->ktr_data.ktr_sysret; >>> ktp->ktr_code = code; >>> ktp->ktr_error = error; >>> - ktp->ktr_retval = retval; /* what about val2 ? */ >>> + ktp->ktr_retval = ((error == 0) ? retval: 0); /* what about val2 ? */ >>> ktr_submitrequest(curthread, req); >>> } >>> >> >> >> -- >> Andriy Gapon > -- Andriy Gapon From owner-svn-src-stable-8@FreeBSD.ORG Mon Jan 16 23:02:38 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24DA21065674; Mon, 16 Jan 2012 23:02:38 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E93F78FC0C; Mon, 16 Jan 2012 23:02: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 q0GN2bXL055926; Mon, 16 Jan 2012 23:02:37 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0GN2bjk055925; Mon, 16 Jan 2012 23:02:37 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201201162302.q0GN2bjk055925@svn.freebsd.org> From: Jim Harris Date: Mon, 16 Jan 2012 23:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230241 - stable/8 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2012 23:02:38 -0000 Author: jimharris Date: Mon Jan 16 23:02:37 2012 New Revision: 230241 URL: http://svn.freebsd.org/changeset/base/230241 Log: Revert r229671 mergeinfo property from root directory. This was mistakenly added as part of r230224 MFC commit. Reviewed by: avg Approved by: sbruno Modified: Directory Properties: stable/8/ (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 17 00:02:46 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EF041065673; Tue, 17 Jan 2012 00:02:46 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 770758FC1B; Tue, 17 Jan 2012 00:02:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0H02kFT058167; Tue, 17 Jan 2012 00:02:46 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0H02krM058164; Tue, 17 Jan 2012 00:02:46 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201201170002.q0H02krM058164@svn.freebsd.org> From: Jim Harris Date: Tue, 17 Jan 2012 00:02:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230245 - in stable/8: sbin/geom/class/raid sys/geom/raid X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 00:02:46 -0000 Author: jimharris Date: Tue Jan 17 00:02:45 2012 New Revision: 230245 URL: http://svn.freebsd.org/changeset/base/230245 Log: MFC r229886: Add support for >2TB disks in GEOM RAID for Intel metadata format. Sponsored by: Intel Approved by: sbruno Modified: stable/8/sbin/geom/class/raid/graid.8 stable/8/sys/geom/raid/md_intel.c Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/sbin/geom/class/raid/graid.8 ============================================================================== --- stable/8/sbin/geom/class/raid/graid.8 Mon Jan 16 23:22:56 2012 (r230244) +++ stable/8/sbin/geom/class/raid/graid.8 Tue Jan 17 00:02:45 2012 (r230245) @@ -251,7 +251,7 @@ complete it there. Do not run GEOM RAID class on migrating volumes under pain of possible data corruption! .Sh 2TiB BARRIERS -Intel and Promise metadata formats do not support disks above 2TiB. +Promise metadata format does not support disks above 2TiB. NVIDIA metadata format does not support volumes above 2TiB. .Sh EXIT STATUS Exit status is 0 on success, and non-zero if the command fails. Modified: stable/8/sys/geom/raid/md_intel.c ============================================================================== --- stable/8/sys/geom/raid/md_intel.c Mon Jan 16 23:22:56 2012 (r230244) +++ stable/8/sys/geom/raid/md_intel.c Tue Jan 17 00:02:45 2012 (r230245) @@ -64,7 +64,10 @@ struct intel_raid_map { uint8_t total_domains; uint8_t failed_disk_num; uint8_t ddf; - uint32_t filler_2[7]; + uint32_t offset_hi; + uint32_t disk_sectors_hi; + uint32_t stripe_count_hi; + uint32_t filler_2[4]; uint32_t disk_idx[1]; /* total_disks entries. */ #define INTEL_DI_IDX 0x00ffffff #define INTEL_DI_RBLD 0x01000000 @@ -111,7 +114,8 @@ struct intel_raid_vol { uint8_t fs_state; uint16_t verify_errors; uint16_t bad_blocks; - uint32_t filler_1[4]; + uint32_t curr_migr_unit_hi; + uint32_t filler_1[3]; struct intel_raid_map map[1]; /* 2 entries if migr_state != 0. */ } __packed; @@ -125,8 +129,9 @@ struct intel_raid_disk { #define INTEL_F_ASSIGNED 0x02 #define INTEL_F_FAILED 0x04 #define INTEL_F_ONLINE 0x08 - - uint32_t filler[5]; + uint32_t owner_cfg_num; + uint32_t sectors_hi; + uint32_t filler[3]; } __packed; struct intel_raid_conf { @@ -254,6 +259,82 @@ intel_get_volume(struct intel_raid_conf return (mvol); } +static off_t +intel_get_map_offset(struct intel_raid_map *mmap) +{ + off_t offset = (off_t)mmap->offset_hi << 32; + + offset += mmap->offset; + return (offset); +} + +static void +intel_set_map_offset(struct intel_raid_map *mmap, off_t offset) +{ + + mmap->offset = offset & 0xffffffff; + mmap->offset_hi = offset >> 32; +} + +static off_t +intel_get_map_disk_sectors(struct intel_raid_map *mmap) +{ + off_t disk_sectors = (off_t)mmap->disk_sectors_hi << 32; + + disk_sectors += mmap->disk_sectors; + return (disk_sectors); +} + +static void +intel_set_map_disk_sectors(struct intel_raid_map *mmap, off_t disk_sectors) +{ + + mmap->disk_sectors = disk_sectors & 0xffffffff; + mmap->disk_sectors_hi = disk_sectors >> 32; +} + +static void +intel_set_map_stripe_count(struct intel_raid_map *mmap, off_t stripe_count) +{ + + mmap->stripe_count = stripe_count & 0xffffffff; + mmap->stripe_count_hi = stripe_count >> 32; +} + +static off_t +intel_get_disk_sectors(struct intel_raid_disk *disk) +{ + off_t sectors = (off_t)disk->sectors_hi << 32; + + sectors += disk->sectors; + return (sectors); +} + +static void +intel_set_disk_sectors(struct intel_raid_disk *disk, off_t sectors) +{ + + disk->sectors = sectors & 0xffffffff; + disk->sectors_hi = sectors >> 32; +} + +static off_t +intel_get_vol_curr_migr_unit(struct intel_raid_vol *vol) +{ + off_t curr_migr_unit = (off_t)vol->curr_migr_unit_hi << 32; + + curr_migr_unit += vol->curr_migr_unit; + return (curr_migr_unit); +} + +static void +intel_set_vol_curr_migr_unit(struct intel_raid_vol *vol, off_t curr_migr_unit) +{ + + vol->curr_migr_unit = curr_migr_unit & 0xffffffff; + vol->curr_migr_unit_hi = curr_migr_unit >> 32; +} + static void g_raid_md_intel_print(struct intel_raid_conf *meta) { @@ -274,10 +355,11 @@ g_raid_md_intel_print(struct intel_raid_ printf("attributes 0x%08x\n", meta->attributes); printf("total_disks %u\n", meta->total_disks); printf("total_volumes %u\n", meta->total_volumes); - printf("DISK# serial disk_sectors disk_id flags\n"); + printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags\n"); for (i = 0; i < meta->total_disks; i++ ) { - printf(" %d <%.16s> %u 0x%08x 0x%08x\n", i, + printf(" %d <%.16s> %u %u 0x%08x 0x%08x\n", i, meta->disk[i].serial, meta->disk[i].sectors, + meta->disk[i].sectors_hi, meta->disk[i].id, meta->disk[i].flags); } for (i = 0; i < meta->total_volumes; i++) { @@ -288,6 +370,7 @@ g_raid_md_intel_print(struct intel_raid_ printf(" state %u\n", mvol->state); printf(" reserved %u\n", mvol->reserved); printf(" curr_migr_unit %u\n", mvol->curr_migr_unit); + printf(" curr_migr_unit_hi %u\n", mvol->curr_migr_unit_hi); printf(" checkpoint_id %u\n", mvol->checkpoint_id); printf(" migr_state %u\n", mvol->migr_state); printf(" migr_type %u\n", mvol->migr_type); @@ -297,8 +380,11 @@ g_raid_md_intel_print(struct intel_raid_ printf(" *** Map %d ***\n", j); mmap = intel_get_map(mvol, j); printf(" offset %u\n", mmap->offset); + printf(" offset_hi %u\n", mmap->offset_hi); printf(" disk_sectors %u\n", mmap->disk_sectors); + printf(" disk_sectors_hi %u\n", mmap->disk_sectors_hi); printf(" stripe_count %u\n", mmap->stripe_count); + printf(" stripe_count_hi %u\n", mmap->stripe_count_hi); printf(" strip_sectors %u\n", mmap->strip_sectors); printf(" status %u\n", mmap->status); printf(" type %u\n", mmap->type); @@ -660,12 +746,15 @@ g_raid_md_intel_start_disk(struct g_raid continue; /* Make sure this disk is big enough. */ TAILQ_FOREACH(sd, &tmpdisk->d_subdisks, sd_next) { + off_t disk_sectors = + intel_get_disk_sectors(&pd->pd_disk_meta); + if (sd->sd_offset + sd->sd_size + 4096 > - (off_t)pd->pd_disk_meta.sectors * 512) { + disk_sectors * 512) { G_RAID_DEBUG1(1, sc, "Disk too small (%llu < %llu)", - ((unsigned long long) - pd->pd_disk_meta.sectors) * 512, + (unsigned long long) + disk_sectors * 512, (unsigned long long) sd->sd_offset + sd->sd_size + 4096); break; @@ -788,7 +877,7 @@ nofit: sd->sd_rebuild_pos = 0; } else { sd->sd_rebuild_pos = - (off_t)mvol->curr_migr_unit * + intel_get_vol_curr_migr_unit(mvol) * sd->sd_volume->v_strip_size * mmap0->total_domains; } @@ -815,7 +904,7 @@ nofit: sd->sd_rebuild_pos = 0; } else { sd->sd_rebuild_pos = - (off_t)mvol->curr_migr_unit * + intel_get_vol_curr_migr_unit(mvol) * sd->sd_volume->v_strip_size * mmap0->total_domains; } @@ -967,8 +1056,8 @@ g_raid_md_intel_start(struct g_raid_soft vol->v_sectorsize = 512; //ZZZ for (j = 0; j < vol->v_disks_count; j++) { sd = &vol->v_subdisks[j]; - sd->sd_offset = (off_t)mmap->offset * 512; //ZZZ - sd->sd_size = (off_t)mmap->disk_sectors * 512; //ZZZ + sd->sd_offset = intel_get_map_offset(mmap) * 512; //ZZZ + sd->sd_size = intel_get_map_disk_sectors(mmap) * 512; //ZZZ } g_raid_start_volume(vol); } @@ -1176,9 +1265,6 @@ g_raid_md_taste_intel(struct g_raid_md_o G_RAID_DEBUG(1, "Intel vendor mismatch 0x%04x != 0x8086", vendor); - } else if (pp->mediasize / pp->sectorsize > UINT32_MAX) { - G_RAID_DEBUG(1, - "Intel disk '%s' is too big.", pp->name); } else { G_RAID_DEBUG(1, "No Intel metadata, forcing spare."); @@ -1195,10 +1281,10 @@ g_raid_md_taste_intel(struct g_raid_md_o G_RAID_DEBUG(1, "Intel serial '%s' not found", serial); goto fail1; } - if (meta->disk[disk_pos].sectors != + if (intel_get_disk_sectors(&meta->disk[disk_pos]) != (pp->mediasize / pp->sectorsize)) { G_RAID_DEBUG(1, "Intel size mismatch %ju != %ju", - (off_t)meta->disk[disk_pos].sectors, + intel_get_disk_sectors(&meta->disk[disk_pos]), (off_t)(pp->mediasize / pp->sectorsize)); goto fail1; } @@ -1266,7 +1352,8 @@ search: pd->pd_disk_pos = -1; if (spare == 2) { memcpy(&pd->pd_disk_meta.serial[0], serial, INTEL_SERIAL_LEN); - pd->pd_disk_meta.sectors = pp->mediasize / pp->sectorsize; + intel_set_disk_sectors(&pd->pd_disk_meta, + pp->mediasize / pp->sectorsize); pd->pd_disk_meta.id = 0; pd->pd_disk_meta.flags = INTEL_F_SPARE; } else { @@ -1372,7 +1459,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj const char *verb, *volname, *levelname, *diskname; char *tmp; int *nargs, *force; - off_t off, size, sectorsize, strip; + off_t off, size, sectorsize, strip, disk_sectors; intmax_t *sizearg, *striparg; int numdisks, i, len, level, qual, update; int error; @@ -1452,13 +1539,6 @@ g_raid_md_ctl_intel(struct g_raid_md_obj cp->private = disk; g_topology_unlock(); - if (pp->mediasize / pp->sectorsize > UINT32_MAX) { - gctl_error(req, - "Disk '%s' is too big.", diskname); - error = -8; - break; - } - error = g_raid_md_get_label(cp, &pd->pd_disk_meta.serial[0], INTEL_SERIAL_LEN); if (error != 0) { @@ -1479,7 +1559,8 @@ g_raid_md_ctl_intel(struct g_raid_md_obj "Dumping not supported by %s.", cp->provider->name); - pd->pd_disk_meta.sectors = pp->mediasize / pp->sectorsize; + intel_set_disk_sectors(&pd->pd_disk_meta, + pp->mediasize / pp->sectorsize); if (size > pp->mediasize) size = pp->mediasize; if (sectorsize < pp->sectorsize) @@ -1544,10 +1625,6 @@ g_raid_md_ctl_intel(struct g_raid_md_obj gctl_error(req, "Size too small."); return (-13); } - if (size > 0xffffffffllu * sectorsize) { - gctl_error(req, "Size too big."); - return (-14); - } /* We have all we need, create things: volume, ... */ mdi->mdio_started = 1; @@ -1655,8 +1732,11 @@ g_raid_md_ctl_intel(struct g_raid_md_obj disk = vol1->v_subdisks[i].sd_disk; pd = (struct g_raid_md_intel_perdisk *) disk->d_md_data; - if ((off_t)pd->pd_disk_meta.sectors * 512 < size) - size = (off_t)pd->pd_disk_meta.sectors * 512; + disk_sectors = + intel_get_disk_sectors(&pd->pd_disk_meta); + + if (disk_sectors * 512 < size) + size = disk_sectors * 512; if (disk->d_consumer != NULL && disk->d_consumer->provider != NULL && disk->d_consumer->provider->sectorsize > @@ -1950,14 +2030,6 @@ g_raid_md_ctl_intel(struct g_raid_md_obj pp = cp->provider; g_topology_unlock(); - if (pp->mediasize / pp->sectorsize > UINT32_MAX) { - gctl_error(req, - "Disk '%s' is too big.", diskname); - g_raid_kill_consumer(sc, cp); - error = -8; - break; - } - /* Read disk serial. */ error = g_raid_md_get_label(cp, &serial[0], INTEL_SERIAL_LEN); @@ -1990,7 +2062,8 @@ g_raid_md_ctl_intel(struct g_raid_md_obj memcpy(&pd->pd_disk_meta.serial[0], &serial[0], INTEL_SERIAL_LEN); - pd->pd_disk_meta.sectors = pp->mediasize / pp->sectorsize; + intel_set_disk_sectors(&pd->pd_disk_meta, + pp->mediasize / pp->sectorsize); pd->pd_disk_meta.id = 0; pd->pd_disk_meta.flags = INTEL_F_SPARE; @@ -2165,8 +2238,8 @@ g_raid_md_write_intel(struct g_raid_md_o mmap0 = intel_get_map(mvol, 0); /* Write map / common part of two maps. */ - mmap0->offset = sd->sd_offset / sectorsize; - mmap0->disk_sectors = sd->sd_size / sectorsize; + intel_set_map_offset(mmap0, sd->sd_offset / sectorsize); + intel_set_map_disk_sectors(mmap0, sd->sd_size / sectorsize); mmap0->strip_sectors = vol->v_strip_size / sectorsize; if (vol->v_state == G_RAID_VOLUME_S_BROKEN) mmap0->status = INTEL_S_FAILURE; @@ -2188,15 +2261,15 @@ g_raid_md_write_intel(struct g_raid_md_o mmap0->total_domains = 2; else mmap0->total_domains = 1; - mmap0->stripe_count = sd->sd_size / vol->v_strip_size / - mmap0->total_domains; + intel_set_map_stripe_count(mmap0, + sd->sd_size / vol->v_strip_size / mmap0->total_domains); mmap0->failed_disk_num = 0xff; mmap0->ddf = 1; /* If there are two maps - copy common and update. */ if (mvol->migr_state) { - mvol->curr_migr_unit = pos / - vol->v_strip_size / mmap0->total_domains; + intel_set_vol_curr_migr_unit(mvol, + pos / vol->v_strip_size / mmap0->total_domains); mmap1 = intel_get_map(mvol, 1); memcpy(mmap1, mmap0, sizeof(struct intel_raid_map)); mmap0->status = INTEL_S_READY; From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 17 01:28:44 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BDD3106566B; Tue, 17 Jan 2012 01:28:44 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 166CF8FC0A; Tue, 17 Jan 2012 01:28: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 q0H1Shmn061204; Tue, 17 Jan 2012 01:28:43 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0H1ShLg061202; Tue, 17 Jan 2012 01:28:43 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201201170128.q0H1ShLg061202@svn.freebsd.org> From: Xin LI Date: Tue, 17 Jan 2012 01:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230253 - in stable: 8/sys/dev/tws 9/sys/dev/tws X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 01:28:44 -0000 Author: delphij Date: Tue Jan 17 01:28:43 2012 New Revision: 230253 URL: http://svn.freebsd.org/changeset/base/230253 Log: MFC 229416 + 223200: Don't forget to release queue lock when allocation of memory failed. Submitted by: Sascha Wildner Obtained from: DragonFly Modified: stable/8/sys/dev/tws/tws.c Directory Properties: stable/8/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/tws/tws.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/8/sys/dev/tws/tws.c ============================================================================== --- stable/8/sys/dev/tws/tws.c Tue Jan 17 01:25:53 2012 (r230252) +++ stable/8/sys/dev/tws/tws.c Tue Jan 17 01:28:43 2012 (r230253) @@ -685,6 +685,7 @@ tws_init_reqs(struct tws_softc *sc, u_in { if (bus_dmamap_create(sc->data_tag, 0, &sc->reqs[i].dma_map)) { /* log a ENOMEM failure msg here */ + mtx_unlock(&sc->q_lock); return(FAILURE); } sc->reqs[i].cmd_pkt = &cmd_buf[i]; From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 17 06:54:29 2012 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B1B6106564A; Tue, 17 Jan 2012 06:54:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx10.syd.optusnet.com.au (fallbackmx10.syd.optusnet.com.au [211.29.132.251]) by mx1.freebsd.org (Postfix) with ESMTP id C52B38FC12; Tue, 17 Jan 2012 06:54:28 +0000 (UTC) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by fallbackmx10.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0H5C24L029340; Tue, 17 Jan 2012 16:12:02 +1100 Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0H5Bve1030887 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 Jan 2012 16:11:58 +1100 Date: Tue, 17 Jan 2012 16:11:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andriy Gapon In-Reply-To: <4F143843.9020505@FreeBSD.org> Message-ID: <20120117150710.W1086@besplex.bde.org> References: <201201161440.q0GEeNYI038439@svn.freebsd.org> <4F143843.9020505@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Kevin Lo , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org, svn-src-stable@FreeBSD.org Subject: Re: svn commit: r230217 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 06:54:29 -0000 On Mon, 16 Jan 2012, Andriy Gapon wrote: > on 16/01/2012 16:40 Kevin Lo said the following: >> Log: >> Fix build breakage by adding missing mb_put_padbyte() >> >> Modified: >> stable/8/sys/kern/subr_mchain.c >> >> Modified: stable/8/sys/kern/subr_mchain.c >> ============================================================================== >> --- stable/8/sys/kern/subr_mchain.c Mon Jan 16 14:31:01 2012 (r230216) >> +++ stable/8/sys/kern/subr_mchain.c Mon Jan 16 14:40:22 2012 (r230217) >> @@ -125,6 +125,21 @@ mb_reserve(struct mbchain *mbp, int size >> } >> >> int >> +mb_put_padbyte(struct mbchain *mbp) >> +{ >> + caddr_t dst; >> + char x = 0; >> + >> + dst = mtod(mbp->mb_cur, caddr_t) + mbp->mb_cur->m_len; >> + >> + /* only add padding if address is odd */ >> + if ((unsigned long)dst & 1) >> + return mb_put_mem(mbp, (caddr_t)&x, 1, MB_MSYSTEM); >> + else >> + return 0; > > Broken style above? No. Broken style in almost all of the above. Also a technical bug which give brokenness on some as yet unsupported arches: 1. Use of caddr_t for dst. caddr_t was endemic in mbuf code, but has been mostly eradicated there, except in a couple of APIs where it may be needed for backwards compatibility, and in all of subr_mchain.c. So here it is bug for bug compatible with nearby code. Here and probably mostly elsewhere, caddr_t is used mainly to do pointer arithmetic on it. It is assumed that caddr_t is precisely `char *', so that the pointer arithmetic increases it by 1 per increment. For that use, `char *' should be used directly. 2. Initialization in declaration for x. 3. Meaningless variable name for x. This bug is endemic in subr_mchain.c. This at first confused me into thinking that x was a dummy not-really used variable. It actually holds the padding byte. Generally in subr_mchain.c, for calls to mb_put_mem(), it holds the source data in a uintN_t variable. Here we should also use uint8_t for the variable and spell the size of the variable as sizeof(x), so that we look like other calls. mb_put_mem() has many style bugs too. It takes a caddr_t source address, but should take a `void *' source address. Its case statement has misindented labels... I had to look at it to see what x does. 4. Non-capitalized comment. 5. Non-terminated comment. The last 2 bugs are not endemic in subr_mchain.c, partly because subr_mchain.c has very few comments and even fewer comments for individual statements (only 8, including 1 for the copyright; no others are for individual statements; 1 is banal; all except the copyright have style bugs). 6. `unsigned long' is not abbreviated as u_long. 7. `unsigned long' is a logically and possibly physically wrong type to use here. We really want dst to be an integer so that we can mask it. But mtod() starts with a pointer and produces a pointer. We should have used it to produce a `char *', but we actually used it to produce a caddr_t. We already assumed that caddr_t is precisely `char *'. Now we only need to assume that it is a pointer. We want to convert it to an integer. For that, we should cast it to uintptr_t. Instead, we cast it to `unsigned long'. This assumes that either uintptr_t is unsigned long (as happens on all supported 64-bit arches) or that uintptr_t has the same size as unsigned long and the compiler doesn't warn about this type mismatch (as happens on all supported 32-bit arches). Perhaps we should actually use an alignment macro to do this, but I don't know of any suitable one. _ALIGN() is the main one, and it only rounds up. And its implementation has lots of style bugs (*). 8. Missing parentheses around return value of mb_put_mem(). This bug was never common in mbuf code, but it is endemic in subr_mchain.c 9. Missing parentheses around return value of 0. 10. Missing indentation of return of value of 0. These bugs were all copied from -current. The last one has been fixed, at least in -current. It is the smallest one with the smallest closure. Another 1000 commits to all branches should be enough to fix them all. Bruce From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 17 18:05:14 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29A60106564A; Tue, 17 Jan 2012 18:05:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 179698FC13; Tue, 17 Jan 2012 18:05: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 q0HI5DTh001260; Tue, 17 Jan 2012 18:05:13 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HI5DRS001258; Tue, 17 Jan 2012 18:05:13 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201171805.q0HI5DRS001258@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 17 Jan 2012 18:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230271 - stable/8/sys/netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 18:05:14 -0000 Author: glebius Date: Tue Jan 17 18:05:13 2012 New Revision: 230271 URL: http://svn.freebsd.org/changeset/base/230271 Log: MFhead r226367: Never switch directly from INIT to MASTER, since this produces nasty status flaps. PR: kern/161123 Submitted by: Damien Fleuriot OpenBSD: ip_carp.c, rev. 1.115 Modified: stable/8/sys/netinet/ip_carp.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/ip_carp.c ============================================================================== --- stable/8/sys/netinet/ip_carp.c Tue Jan 17 17:07:13 2012 (r230270) +++ stable/8/sys/netinet/ip_carp.c Tue Jan 17 18:05:13 2012 (r230271) @@ -1391,22 +1391,10 @@ carp_setrun(struct carp_softc *sc, sa_fa switch (sc->sc_state) { case INIT: - if (carp_opts[CARPCTL_PREEMPT] && !carp_suppress_preempt) { - carp_send_ad_locked(sc); - carp_send_arp(sc); -#ifdef INET6 - carp_send_na(sc); -#endif /* INET6 */ - CARP_LOG("%s: INIT -> MASTER (preempting)\n", - SC2IFP(sc)->if_xname); - carp_set_state(sc, MASTER); - carp_setroute(sc, RTM_ADD); - } else { - CARP_LOG("%s: INIT -> BACKUP\n", SC2IFP(sc)->if_xname); - carp_set_state(sc, BACKUP); - carp_setroute(sc, RTM_DELETE); - carp_setrun(sc, 0); - } + CARP_LOG("%s: INIT -> BACKUP\n", SC2IFP(sc)->if_xname); + carp_set_state(sc, BACKUP); + carp_setroute(sc, RTM_DELETE); + carp_setrun(sc, 0); break; case BACKUP: callout_stop(&sc->sc_ad_tmo); From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 17 18:54:50 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5D9F106564A; Tue, 17 Jan 2012 18:54:50 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C410F8FC14; Tue, 17 Jan 2012 18:54: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 q0HIsoXk003252; Tue, 17 Jan 2012 18:54:50 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HIso8c003250; Tue, 17 Jan 2012 18:54:50 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201171854.q0HIso8c003250@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 17 Jan 2012 18:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230274 - stable/8/lib/libc/posix1e X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 18:54:50 -0000 Author: pluknet Date: Tue Jan 17 18:54:50 2012 New Revision: 230274 URL: http://svn.freebsd.org/changeset/base/230274 Log: MFC r201402 (by ed): Don't forget to clean up the file copied from the kernel sources. Modified: stable/8/lib/libc/posix1e/Makefile.inc Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/posix1e/Makefile.inc ============================================================================== --- stable/8/lib/libc/posix1e/Makefile.inc Tue Jan 17 18:20:34 2012 (r230273) +++ stable/8/lib/libc/posix1e/Makefile.inc Tue Jan 17 18:54:50 2012 (r230274) @@ -119,3 +119,5 @@ MLINKS+=acl_create_entry.3 acl_create_en mac_set.3 mac_set_proc.3 \ mac_text.3 mac_from_text.3 \ mac_text.3 mac_to_text.3 + +CLEANFILES+= subr_acl_nfs4.c From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 17 22:02:11 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8FF51065677; Tue, 17 Jan 2012 22:02:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C63F18FC17; Tue, 17 Jan 2012 22:02: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 q0HM2BZ6009304; Tue, 17 Jan 2012 22:02:11 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HM2Bo5009300; Tue, 17 Jan 2012 22:02:11 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201201172202.q0HM2Bo5009300@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 17 Jan 2012 22:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230282 - in stable/8/sys: amd64/amd64 i386/i386 pc98/pc98 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 22:02:12 -0000 Author: bz Date: Tue Jan 17 22:02:11 2012 New Revision: 230282 URL: http://svn.freebsd.org/changeset/base/230282 Log: MFC r224516: Introduce a tunable to disable the time consuming parts of bootup memtesting, which can easily save seconds to minutes of boot time. The tunable name is kept general to allow reusing the code in alternate frameworks. Modified: stable/8/sys/amd64/amd64/machdep.c stable/8/sys/i386/i386/machdep.c stable/8/sys/pc98/pc98/machdep.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Tue Jan 17 21:55:20 2012 (r230281) +++ stable/8/sys/amd64/amd64/machdep.c Tue Jan 17 22:02:11 2012 (r230282) @@ -1288,7 +1288,7 @@ getmemsize(caddr_t kmdp, u_int64_t first { int i, physmap_idx, pa_indx, da_indx; vm_paddr_t pa, physmap[PHYSMAP_SIZE]; - u_long physmem_tunable; + u_long physmem_tunable, memtest, tmpul; pt_entry_t *pte; struct bios_smap *smapbase, *smap, *smapend; u_int32_t smapsize; @@ -1351,6 +1351,14 @@ getmemsize(caddr_t kmdp, u_int64_t first Maxmem = atop(physmem_tunable); /* + * By default keep the memtest enabled. Use a general name so that + * one could eventually do more with the code than just disable it. + */ + memtest = 1; + if (TUNABLE_ULONG_FETCH("hw.memtest.tests", &tmpul)) + memtest = tmpul; + + /* * Don't allow MAXMEM or hw.physmem to extend the amount of memory * in the system. */ @@ -1412,6 +1420,8 @@ getmemsize(caddr_t kmdp, u_int64_t first goto do_dump_avail; page_bad = FALSE; + if (memtest == 0) + goto skip_memtest; /* * map page into kernel: valid, read/write,non-cacheable @@ -1449,6 +1459,7 @@ getmemsize(caddr_t kmdp, u_int64_t first */ *(int *)ptr = tmp; +skip_memtest: /* * Adjust array of valid/good pages. */ Modified: stable/8/sys/i386/i386/machdep.c ============================================================================== --- stable/8/sys/i386/i386/machdep.c Tue Jan 17 21:55:20 2012 (r230281) +++ stable/8/sys/i386/i386/machdep.c Tue Jan 17 22:02:11 2012 (r230282) @@ -2094,7 +2094,7 @@ static void getmemsize(int first) { int has_smap, off, physmap_idx, pa_indx, da_indx; - u_long physmem_tunable; + u_long physmem_tunable, memtest, tmpul; vm_paddr_t physmap[PHYSMAP_SIZE]; pt_entry_t *pte; quad_t dcons_addr, dcons_size; @@ -2301,6 +2301,14 @@ physmap_done: if (has_smap && Maxmem > atop(physmap[physmap_idx + 1])) Maxmem = atop(physmap[physmap_idx + 1]); + /* + * By default keep the memtest enabled. Use a general name so that + * one could eventually do more with the code than just disable it. + */ + memtest = 1; + if (TUNABLE_ULONG_FETCH("hw.memtest.tests", &tmpul)) + memtest = tmpul; + if (atop(physmap[physmap_idx + 1]) != Maxmem && (boothowto & RB_VERBOSE)) printf("Physical memory use set to %ldK\n", Maxmem * 4); @@ -2364,6 +2372,8 @@ physmap_done: goto do_dump_avail; page_bad = FALSE; + if (memtest == 0) + goto skip_memtest; /* * map page into kernel: valid, read/write,non-cacheable @@ -2401,6 +2411,7 @@ physmap_done: */ *(int *)ptr = tmp; +skip_memtest: /* * Adjust array of valid/good pages. */ Modified: stable/8/sys/pc98/pc98/machdep.c ============================================================================== --- stable/8/sys/pc98/pc98/machdep.c Tue Jan 17 21:55:20 2012 (r230281) +++ stable/8/sys/pc98/pc98/machdep.c Tue Jan 17 22:02:11 2012 (r230282) @@ -1823,7 +1823,7 @@ static void getmemsize(int first) { int off, physmap_idx, pa_indx, da_indx; - u_long physmem_tunable; + u_long physmem_tunable, memtest, tmpul; vm_paddr_t physmap[PHYSMAP_SIZE]; pt_entry_t *pte; quad_t dcons_addr, dcons_size; @@ -1883,6 +1883,14 @@ getmemsize(int first) if (TUNABLE_ULONG_FETCH("hw.physmem", &physmem_tunable)) Maxmem = atop(physmem_tunable); + /* + * By default keep the memtest enabled. Use a general name so that + * one could eventually do more with the code than just disable it. + */ + memtest = 1; + if (TUNABLE_ULONG_FETCH("hw.memtest.tests", &tmpul)) + memtest = tmpul; + if (atop(physmap[physmap_idx + 1]) != Maxmem && (boothowto & RB_VERBOSE)) printf("Physical memory use set to %ldK\n", Maxmem * 4); @@ -1959,6 +1967,8 @@ getmemsize(int first) goto do_dump_avail; page_bad = FALSE; + if (memtest == 0) + goto skip_memtest; /* * map page into kernel: valid, read/write,non-cacheable @@ -1996,6 +2006,7 @@ getmemsize(int first) */ *(int *)ptr = tmp; +skip_memtest: /* * Adjust array of valid/good pages. */ From owner-svn-src-stable-8@FreeBSD.ORG Tue Jan 17 22:08:58 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A79671065713; Tue, 17 Jan 2012 22:08:58 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B0D18FC0A; Tue, 17 Jan 2012 22:08:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0HM8wbY009604; Tue, 17 Jan 2012 22:08:58 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0HM8wnm009600; Tue, 17 Jan 2012 22:08:58 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201201172208.q0HM8wnm009600@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 17 Jan 2012 22:08:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230284 - in stable/8/sys: amd64/amd64 i386/i386 pc98/pc98 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jan 2012 22:08:58 -0000 Author: bz Date: Tue Jan 17 22:08:58 2012 New Revision: 230284 URL: http://svn.freebsd.org/changeset/base/230284 Log: MFC r225048: In this branch when doing no further checkes there is no reason use the temporary variable and check with if as TUNABLE_*_FETCH do not alter values unless successfully found the tunable. Modified: stable/8/sys/amd64/amd64/machdep.c stable/8/sys/i386/i386/machdep.c stable/8/sys/pc98/pc98/machdep.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Tue Jan 17 22:02:30 2012 (r230283) +++ stable/8/sys/amd64/amd64/machdep.c Tue Jan 17 22:08:58 2012 (r230284) @@ -1288,7 +1288,7 @@ getmemsize(caddr_t kmdp, u_int64_t first { int i, physmap_idx, pa_indx, da_indx; vm_paddr_t pa, physmap[PHYSMAP_SIZE]; - u_long physmem_tunable, memtest, tmpul; + u_long physmem_tunable, memtest; pt_entry_t *pte; struct bios_smap *smapbase, *smap, *smapend; u_int32_t smapsize; @@ -1355,8 +1355,7 @@ getmemsize(caddr_t kmdp, u_int64_t first * one could eventually do more with the code than just disable it. */ memtest = 1; - if (TUNABLE_ULONG_FETCH("hw.memtest.tests", &tmpul)) - memtest = tmpul; + TUNABLE_ULONG_FETCH("hw.memtest.tests", &memtest); /* * Don't allow MAXMEM or hw.physmem to extend the amount of memory Modified: stable/8/sys/i386/i386/machdep.c ============================================================================== --- stable/8/sys/i386/i386/machdep.c Tue Jan 17 22:02:30 2012 (r230283) +++ stable/8/sys/i386/i386/machdep.c Tue Jan 17 22:08:58 2012 (r230284) @@ -2094,7 +2094,7 @@ static void getmemsize(int first) { int has_smap, off, physmap_idx, pa_indx, da_indx; - u_long physmem_tunable, memtest, tmpul; + u_long physmem_tunable, memtest; vm_paddr_t physmap[PHYSMAP_SIZE]; pt_entry_t *pte; quad_t dcons_addr, dcons_size; @@ -2306,8 +2306,7 @@ physmap_done: * one could eventually do more with the code than just disable it. */ memtest = 1; - if (TUNABLE_ULONG_FETCH("hw.memtest.tests", &tmpul)) - memtest = tmpul; + TUNABLE_ULONG_FETCH("hw.memtest.tests", &memtest); if (atop(physmap[physmap_idx + 1]) != Maxmem && (boothowto & RB_VERBOSE)) Modified: stable/8/sys/pc98/pc98/machdep.c ============================================================================== --- stable/8/sys/pc98/pc98/machdep.c Tue Jan 17 22:02:30 2012 (r230283) +++ stable/8/sys/pc98/pc98/machdep.c Tue Jan 17 22:08:58 2012 (r230284) @@ -1823,7 +1823,7 @@ static void getmemsize(int first) { int off, physmap_idx, pa_indx, da_indx; - u_long physmem_tunable, memtest, tmpul; + u_long physmem_tunable, memtest; vm_paddr_t physmap[PHYSMAP_SIZE]; pt_entry_t *pte; quad_t dcons_addr, dcons_size; @@ -1888,8 +1888,7 @@ getmemsize(int first) * one could eventually do more with the code than just disable it. */ memtest = 1; - if (TUNABLE_ULONG_FETCH("hw.memtest.tests", &tmpul)) - memtest = tmpul; + TUNABLE_ULONG_FETCH("hw.memtest.tests", &memtest); if (atop(physmap[physmap_idx + 1]) != Maxmem && (boothowto & RB_VERBOSE)) From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 18 05:38:44 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DD08106564A; Wed, 18 Jan 2012 05:38:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17FC08FC15; Wed, 18 Jan 2012 05:38: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 q0I5chcT024567; Wed, 18 Jan 2012 05:38:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0I5chTb024565; Wed, 18 Jan 2012 05:38:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201180538.q0I5chTb024565@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 18 Jan 2012 05:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230300 - stable/8/sys/dev/uart X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 05:38:44 -0000 Author: kib Date: Wed Jan 18 05:38:43 2012 New Revision: 230300 URL: http://svn.freebsd.org/changeset/base/230300 Log: MFC r229971: Add PCI Id for the AMT SOL UART on 5 series Intel chipsets. Modified: stable/8/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/8/sys/dev/uart/uart_bus_pci.c Wed Jan 18 04:37:35 2012 (r230299) +++ stable/8/sys/dev/uart/uart_bus_pci.c Wed Jan 18 05:38:43 2012 (r230300) @@ -112,6 +112,8 @@ static struct pci_id pci_ns8250_ids[] = 0x10, 16384000 }, { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, { 0x8086, 0x1c3d, 0xffff, 0, "Intel AMT - KT Controller", 0x10 }, +{ 0x8086, 0x3b67, 0xffff, 0, "5 Series/3400 Series Chipset KT Controller", + 0x10 }, { 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 }, { 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 }, { 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 }, From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 18 07:56:13 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3963106566C; Wed, 18 Jan 2012 07:56:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB8C18FC17; Wed, 18 Jan 2012 07:56: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 q0I7uDrE029110; Wed, 18 Jan 2012 07:56:13 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0I7uDiF029103; Wed, 18 Jan 2012 07:56:13 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201201180756.q0I7uDiF029103@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 18 Jan 2012 07:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230301 - in stable/8/sys/dev/usb: . controller X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 07:56:14 -0000 Author: hselasky Date: Wed Jan 18 07:56:13 2012 New Revision: 230301 URL: http://svn.freebsd.org/changeset/base/230301 Log: MFC r230032, r230050, r230090, r230091 and r228493. - Various XHCI and USB 3.0 related issues. - USB 3.0 HUBs should work after this change. Modified: stable/8/sys/dev/usb/controller/xhci.c stable/8/sys/dev/usb/controller/xhcireg.h stable/8/sys/dev/usb/usb.h stable/8/sys/dev/usb/usb_hub.c stable/8/sys/dev/usb/usb_request.c stable/8/sys/dev/usb/usb_request.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci.c Wed Jan 18 05:38:43 2012 (r230300) +++ stable/8/sys/dev/usb/controller/xhci.c Wed Jan 18 07:56:13 2012 (r230301) @@ -2211,9 +2211,10 @@ xhci_configure_device(struct usb_device struct usb_device *hubdev; uint32_t temp; uint32_t route; + uint32_t rh_port; uint8_t is_hub; uint8_t index; - uint8_t rh_port; + uint8_t depth; index = udev->controller_slot_id; @@ -2235,6 +2236,8 @@ xhci_configure_device(struct usb_device if (hubdev->parent_hub == NULL) break; + depth = hubdev->parent_hub->depth; + /* * NOTE: HS/FS/LS devices and the SS root HUB can have * more than 15 ports @@ -2242,17 +2245,18 @@ xhci_configure_device(struct usb_device rh_port = hubdev->port_no; - if (hubdev->parent_hub->parent_hub == NULL) + if (depth == 0) break; - route *= 16; - if (rh_port > 15) - route |= 15; - else - route |= rh_port; + rh_port = 15; + + if (depth < 6) + route |= rh_port << (4 * (depth - 1)); } + DPRINTF("Route=0x%08x\n", route); + temp = XHCI_SCTX_0_ROUTE_SET(route); switch (sc->sc_hw.devs[index].state) { @@ -2260,7 +2264,7 @@ xhci_configure_device(struct usb_device temp |= XHCI_SCTX_0_CTX_NUM_SET(XHCI_MAX_ENDPOINTS - 1); break; default: - temp = XHCI_SCTX_0_CTX_NUM_SET(1); + temp |= XHCI_SCTX_0_CTX_NUM_SET(1); break; } @@ -3063,6 +3067,7 @@ xhci_roothub_exec(struct usb_device *ude case UHF_C_PORT_CONFIG_ERROR: XWRITE4(sc, oper, port, v | XHCI_PS_CEC); break; + case UHF_C_PORT_SUSPEND: case UHF_C_PORT_LINK_STATE: XWRITE4(sc, oper, port, v | XHCI_PS_PLC); break; @@ -3189,8 +3194,13 @@ xhci_roothub_exec(struct usb_device *ude i |= UPS_OVERCURRENT_INDICATOR; if (v & XHCI_PS_PR) i |= UPS_RESET; - if (v & XHCI_PS_PP) + if (v & XHCI_PS_PP) { + /* + * The USB 3.0 RH is using the + * USB 2.0's power bit + */ i |= UPS_PORT_POWER; + } USETW(sc->sc_hub_desc.ps.wPortStatus, i); i = 0; Modified: stable/8/sys/dev/usb/controller/xhcireg.h ============================================================================== --- stable/8/sys/dev/usb/controller/xhcireg.h Wed Jan 18 05:38:43 2012 (r230300) +++ stable/8/sys/dev/usb/controller/xhcireg.h Wed Jan 18 07:56:13 2012 (r230301) @@ -115,7 +115,7 @@ #define XHCI_PS_PR 0x00000010 /* RW - port reset */ #define XHCI_PS_PLS_GET(x) (((x) >> 5) & 0xF) /* RW - port link state */ #define XHCI_PS_PLS_SET(x) (((x) & 0xF) << 5) /* RW - port link state */ -#define XHCI_PS_PP 0x00000100 /* RW - port power */ +#define XHCI_PS_PP 0x00000200 /* RW - port power */ #define XHCI_PS_SPEED_GET(x) (((x) >> 10) & 0xF) /* RO - port speed */ #define XHCI_PS_PIC_GET(x) (((x) >> 14) & 0x3) /* RW - port indicator */ #define XHCI_PS_PIC_SET(x) (((x) & 0x3) << 14) /* RW - port indicator */ Modified: stable/8/sys/dev/usb/usb.h ============================================================================== --- stable/8/sys/dev/usb/usb.h Wed Jan 18 05:38:43 2012 (r230300) +++ stable/8/sys/dev/usb/usb.h Wed Jan 18 07:56:13 2012 (r230301) @@ -688,6 +688,7 @@ struct usb_port_status { #define UPS_PORT_LS_LOOPBACK 0x0B #define UPS_PORT_LS_RESUME 0x0F #define UPS_PORT_POWER 0x0100 +#define UPS_PORT_POWER_SS 0x0200 /* super-speed only */ #define UPS_LOW_SPEED 0x0200 #define UPS_HIGH_SPEED 0x0400 #define UPS_OTHER_SPEED 0x0600 /* currently FreeBSD specific */ Modified: stable/8/sys/dev/usb/usb_hub.c ============================================================================== --- stable/8/sys/dev/usb/usb_hub.c Wed Jan 18 05:38:43 2012 (r230300) +++ stable/8/sys/dev/usb/usb_hub.c Wed Jan 18 07:56:13 2012 (r230301) @@ -327,6 +327,7 @@ uhub_reattach_port(struct uhub_softc *sc enum usb_dev_speed speed; enum usb_hc_mode mode; usb_error_t err; + uint16_t power_mask; uint8_t timeout; DPRINTF("reattaching port %d\n", portno); @@ -369,10 +370,27 @@ repeat: } /* check if there is no power on the port and print a warning */ - if (!(sc->sc_st.port_status & UPS_PORT_POWER)) { + switch (udev->speed) { + case USB_SPEED_HIGH: + case USB_SPEED_FULL: + case USB_SPEED_LOW: + power_mask = UPS_PORT_POWER; + break; + case USB_SPEED_SUPER: + if (udev->parent_hub == NULL) + power_mask = UPS_PORT_POWER; + else + power_mask = UPS_PORT_POWER_SS; + break; + default: + power_mask = 0; + break; + } + if (!(sc->sc_st.port_status & power_mask)) { DPRINTF("WARNING: strange, connected port %d " "has no power\n", portno); } + /* check if the device is in Host Mode */ if (!(sc->sc_st.port_status & UPS_PORT_MODE_DEVICE)) { @@ -609,13 +627,15 @@ uhub_suspend_resume_port(struct uhub_sof } } else { switch (UPS_PORT_LINK_STATE_GET(sc->sc_st.port_status)) { - case UPS_PORT_LS_U0: - case UPS_PORT_LS_U1: - case UPS_PORT_LS_RESUME: + case UPS_PORT_LS_U3: + is_suspend = 1; + break; + case UPS_PORT_LS_SS_INA: + usbd_req_warm_reset_port(udev, NULL, portno); is_suspend = 0; break; default: - is_suspend = 1; + is_suspend = 0; break; } } @@ -632,8 +652,7 @@ uhub_suspend_resume_port(struct uhub_sof */ if (is_suspend == 0) usb_dev_resume_peer(child); - else if ((child->flags.usb_mode == USB_MODE_DEVICE) || - (usb_device_20_compatible(child) == 0)) + else if (child->flags.usb_mode == USB_MODE_DEVICE) usb_dev_suspend_peer(child); } done: @@ -775,7 +794,8 @@ uhub_explore(struct usb_device *udev) break; } } - if (sc->sc_st.port_change & (UPS_C_SUSPEND | UPS_C_PORT_LINK_STATE)) { + if (sc->sc_st.port_change & (UPS_C_SUSPEND | + UPS_C_PORT_LINK_STATE)) { err = uhub_suspend_resume_port(sc, portno); if (err) { /* most likely the HUB is gone */ @@ -2064,7 +2084,6 @@ usb_peer_should_wakeup(struct usb_device (udev->pwr_save.write_refs != 0) || ((udev->pwr_save.read_refs != 0) && (udev->flags.usb_mode == USB_MODE_HOST) && - (usb_device_20_compatible(udev) != 0) && (usb_peer_can_wakeup(udev) == 0))); } @@ -2244,6 +2263,14 @@ usb_dev_resume_peer(struct usb_device *u DPRINTFN(0, "Resuming port failed\n"); return; } + } else { + /* resume current port (Valid in Host and Device Mode) */ + err = usbd_req_set_port_link_state(udev->parent_hub, + NULL, udev->port_no, UPS_PORT_LS_U0); + if (err) { + DPRINTFN(0, "Resuming port failed\n"); + return; + } } /* resume settle time */ @@ -2285,8 +2312,7 @@ usb_dev_resume_peer(struct usb_device *u usbd_sr_unlock(udev); /* check if peer has wakeup capability */ - if (usb_peer_can_wakeup(udev) && - usb_device_20_compatible(udev)) { + if (usb_peer_can_wakeup(udev)) { /* clear remote wakeup */ err = usbd_req_clear_device_feature(udev, NULL, UF_DEVICE_REMOTE_WAKEUP); @@ -2347,8 +2373,7 @@ repeat: } } - if (usb_peer_can_wakeup(udev) && - usb_device_20_compatible(udev)) { + if (usb_peer_can_wakeup(udev)) { /* * This request needs to be done before we set * "udev->flags.self_suspended": @@ -2380,8 +2405,7 @@ repeat: USB_BUS_UNLOCK(udev->bus); if (err != 0) { - if (usb_peer_can_wakeup(udev) && - usb_device_20_compatible(udev)) { + if (usb_peer_can_wakeup(udev)) { /* allow device to do remote wakeup */ err = usbd_req_clear_device_feature(udev, NULL, UF_DEVICE_REMOTE_WAKEUP); @@ -2437,6 +2461,14 @@ repeat: DPRINTFN(0, "Suspending port failed\n"); return; } + } else { + /* suspend current port */ + err = usbd_req_set_port_link_state(udev->parent_hub, + NULL, udev->port_no, UPS_PORT_LS_U3); + if (err) { + DPRINTFN(0, "Suspending port failed\n"); + return; + } } udev = udev->parent_hub; Modified: stable/8/sys/dev/usb/usb_request.c ============================================================================== --- stable/8/sys/dev/usb/usb_request.c Wed Jan 18 05:38:43 2012 (r230300) +++ stable/8/sys/dev/usb/usb_request.c Wed Jan 18 07:56:13 2012 (r230301) @@ -785,12 +785,17 @@ usbd_req_reset_port(struct usb_device *u struct usb_port_status ps; usb_error_t err; uint16_t n; + uint16_t status; + uint16_t change; #ifdef USB_DEBUG uint16_t pr_poll_delay; uint16_t pr_recovery_delay; #endif + + DPRINTF("\n"); + /* clear any leftover port reset changes first */ usbd_req_clear_port_feature( udev, mtx, port, UHF_C_PORT_RESET); @@ -817,9 +822,6 @@ usbd_req_reset_port(struct usb_device *u #endif n = 0; while (1) { - uint16_t status; - uint16_t change; - #ifdef USB_DEBUG /* wait for the device to recover from reset */ usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_poll_delay)); @@ -830,9 +832,9 @@ usbd_req_reset_port(struct usb_device *u n += USB_PORT_RESET_DELAY; #endif err = usbd_req_get_port_status(udev, mtx, &ps, port); - if (err) { + if (err) goto done; - } + status = UGETW(ps.wPortStatus); change = UGETW(ps.wPortChange); @@ -862,9 +864,9 @@ usbd_req_reset_port(struct usb_device *u /* clear port reset first */ err = usbd_req_clear_port_feature( udev, mtx, port, UHF_C_PORT_RESET); - if (err) { + if (err) goto done; - } + /* check for timeout */ if (n == 0) { err = USB_ERR_TIMEOUT; @@ -898,21 +900,50 @@ done: * disabled. *------------------------------------------------------------------------*/ usb_error_t -usbd_req_warm_reset_port(struct usb_device *udev, struct mtx *mtx, uint8_t port) +usbd_req_warm_reset_port(struct usb_device *udev, struct mtx *mtx, + uint8_t port) { struct usb_port_status ps; usb_error_t err; uint16_t n; + uint16_t status; + uint16_t change; #ifdef USB_DEBUG uint16_t pr_poll_delay; uint16_t pr_recovery_delay; #endif - err = usbd_req_set_port_feature(udev, mtx, port, UHF_BH_PORT_RESET); - if (err) { + + DPRINTF("\n"); + + err = usbd_req_get_port_status(udev, mtx, &ps, port); + if (err) goto done; + + status = UGETW(ps.wPortStatus); + + switch (UPS_PORT_LINK_STATE_GET(status)) { + case UPS_PORT_LS_U3: + case UPS_PORT_LS_COMP_MODE: + case UPS_PORT_LS_LOOPBACK: + case UPS_PORT_LS_SS_INA: + break; + default: + DPRINTF("Wrong state for warm reset\n"); + return (0); } + + /* clear any leftover warm port reset changes first */ + usbd_req_clear_port_feature(udev, mtx, + port, UHF_C_BH_PORT_RESET); + + /* set warm port reset */ + err = usbd_req_set_port_feature(udev, mtx, + port, UHF_BH_PORT_RESET); + if (err) + goto done; + #ifdef USB_DEBUG /* range check input parameters */ pr_poll_delay = usb_pr_poll_delay; @@ -938,17 +969,20 @@ usbd_req_warm_reset_port(struct usb_devi n += USB_PORT_RESET_DELAY; #endif err = usbd_req_get_port_status(udev, mtx, &ps, port); - if (err) { + if (err) goto done; - } + + status = UGETW(ps.wPortStatus); + change = UGETW(ps.wPortChange); + /* if the device disappeared, just give up */ - if (!(UGETW(ps.wPortStatus) & UPS_CURRENT_CONNECT_STATUS)) { + if (!(status & UPS_CURRENT_CONNECT_STATUS)) goto done; - } + /* check if reset is complete */ - if (UGETW(ps.wPortChange) & UPS_C_BH_PORT_RESET) { + if (change & UPS_C_BH_PORT_RESET) break; - } + /* check for timeout */ if (n > 1000) { n = 0; @@ -959,9 +993,9 @@ usbd_req_warm_reset_port(struct usb_devi /* clear port reset first */ err = usbd_req_clear_port_feature( udev, mtx, port, UHF_C_BH_PORT_RESET); - if (err) { + if (err) goto done; - } + /* check for timeout */ if (n == 0) { err = USB_ERR_TIMEOUT; @@ -2004,6 +2038,10 @@ retry: } } + /* Try to warm reset first */ + if (parent_hub->speed == USB_SPEED_SUPER) + usbd_req_warm_reset_port(parent_hub, mtx, udev->port_no); + /* Try to reset the parent HUB port. */ err = usbd_req_reset_port(parent_hub, mtx, udev->port_no); if (err) { @@ -2164,3 +2202,27 @@ usbd_req_clear_tt_buffer(struct usb_devi USETW(req.wLength, 0); return (usbd_do_request(udev, mtx, &req, 0)); } + +/*------------------------------------------------------------------------* + * usbd_req_set_port_link_state + * + * USB 3.0 specific request + * + * Returns: + * 0: Success + * Else: Failure + *------------------------------------------------------------------------*/ +usb_error_t +usbd_req_set_port_link_state(struct usb_device *udev, struct mtx *mtx, + uint8_t port, uint8_t link_state) +{ + struct usb_device_request req; + + req.bmRequestType = UT_WRITE_CLASS_OTHER; + req.bRequest = UR_SET_FEATURE; + USETW(req.wValue, UHF_PORT_LINK_STATE); + req.wIndex[0] = port; + req.wIndex[1] = link_state; + USETW(req.wLength, 0); + return (usbd_do_request(udev, mtx, &req, 0)); +} Modified: stable/8/sys/dev/usb/usb_request.h ============================================================================== --- stable/8/sys/dev/usb/usb_request.h Wed Jan 18 05:38:43 2012 (r230300) +++ stable/8/sys/dev/usb/usb_request.h Wed Jan 18 07:56:13 2012 (r230301) @@ -89,5 +89,7 @@ usb_error_t usbd_req_reset_tt(struct usb uint8_t port); usb_error_t usbd_req_clear_tt_buffer(struct usb_device *udev, struct mtx *mtx, uint8_t port, uint8_t addr, uint8_t type, uint8_t endpoint); +usb_error_t usbd_req_set_port_link_state(struct usb_device *udev, + struct mtx *mtx, uint8_t port, uint8_t link_state); #endif /* _USB_REQUEST_H_ */ From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 18 18:22:26 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 305931065676; Wed, 18 Jan 2012 18:22:26 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E5AC8FC16; Wed, 18 Jan 2012 18:22: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 q0IIMQ4R051657; Wed, 18 Jan 2012 18:22:26 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0IIMQ4C051655; Wed, 18 Jan 2012 18:22:26 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <201201181822.q0IIMQ4C051655@svn.freebsd.org> From: Stefan Farfeleder Date: Wed, 18 Jan 2012 18:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230310 - stable/8/contrib/gcc/config/i386 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 18:22:26 -0000 Author: stefanf Date: Wed Jan 18 18:22:25 2012 New Revision: 230310 URL: http://svn.freebsd.org/changeset/base/230310 Log: MFC r226430: Adjust posix_memalign() prototype to match what we define in stdlib.h for C++ compilation. Modified: stable/8/contrib/gcc/config/i386/pmm_malloc.h Directory Properties: stable/8/contrib/gcc/ (props changed) Modified: stable/8/contrib/gcc/config/i386/pmm_malloc.h ============================================================================== --- stable/8/contrib/gcc/config/i386/pmm_malloc.h Wed Jan 18 15:59:23 2012 (r230309) +++ stable/8/contrib/gcc/config/i386/pmm_malloc.h Wed Jan 18 18:22:25 2012 (r230310) @@ -34,7 +34,7 @@ #ifndef __cplusplus extern int posix_memalign (void **, size_t, size_t); #else -extern "C" int posix_memalign (void **, size_t, size_t) throw (); +extern "C" int posix_memalign (void **, size_t, size_t); #endif static __inline void * From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 18 21:51:00 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23002106566C; Wed, 18 Jan 2012 21:51:00 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 10FFD8FC14; Wed, 18 Jan 2012 21:51:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0ILoxK7058430; Wed, 18 Jan 2012 21:50:59 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ILoxqQ058428; Wed, 18 Jan 2012 21:50:59 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201201182150.q0ILoxqQ058428@svn.freebsd.org> From: Don Lewis Date: Wed, 18 Jan 2012 21:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230318 - stable/8/sys/dev/pst X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 21:51:00 -0000 Author: truckman Date: Wed Jan 18 21:50:59 2012 New Revision: 230318 URL: http://svn.freebsd.org/changeset/base/230318 Log: MFC: r229984 Pass the arguments to mtx_init() in the correct order. There should be no change to the binary because the value of MTX_DEF is zero and there is a visible function prototype. Modified: stable/8/sys/dev/pst/pst-pci.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/pst/pst-pci.c ============================================================================== --- stable/8/sys/dev/pst/pst-pci.c Wed Jan 18 21:49:37 2012 (r230317) +++ stable/8/sys/dev/pst/pst-pci.c Wed Jan 18 21:50:59 2012 (r230318) @@ -95,7 +95,7 @@ iop_pci_attach(device_t dev) sc->ibase = rman_get_virtual(sc->r_mem); sc->reg = (struct i2o_registers *)sc->ibase; sc->dev = dev; - mtx_init(&sc->mtx, "pst lock", MTX_DEF, 0); + mtx_init(&sc->mtx, "pst lock", NULL, MTX_DEF); if (!iop_init(sc)) return 0; From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 18 22:08:26 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0A7C106567B; Wed, 18 Jan 2012 22:08:26 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B30F68FC16; Wed, 18 Jan 2012 22:08: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 q0IM8QWf059181; Wed, 18 Jan 2012 22:08:26 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0IM8QJ9059178; Wed, 18 Jan 2012 22:08:26 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201201182208.q0IM8QJ9059178@svn.freebsd.org> From: Christian Brueffer Date: Wed, 18 Jan 2012 22:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230322 - in stable/8/release: doc/en_US.ISO8859-1/hardware doc/share/misc picobsd/floppy.tree/sbin X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Jan 2012 22:08:27 -0000 Author: brueffer Date: Wed Jan 18 22:08:26 2012 New Revision: 230322 URL: http://svn.freebsd.org/changeset/base/230322 Log: MFC: r229977 Add hpt27xx to the hardware notes, While here, add the 2012 copyright. Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml stable/8/release/doc/share/misc/dev.archlist.txt Directory Properties: stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) stable/8/release/picobsd/tinyware/login/ (props changed) stable/8/release/powerpc/ (props changed) Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Wed Jan 18 21:59:32 2012 (r230321) +++ stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Wed Jan 18 22:08:26 2012 (r230322) @@ -32,6 +32,7 @@ 2009 2010 2011 + 2012 The &os; Documentation Project @@ -722,6 +723,8 @@ &hwlist.esp; + &hwlist.hpt27xx; + &hwlist.hptiop; &hwlist.hptmv; Modified: stable/8/release/doc/share/misc/dev.archlist.txt ============================================================================== --- stable/8/release/doc/share/misc/dev.archlist.txt Wed Jan 18 21:59:32 2012 (r230321) +++ stable/8/release/doc/share/misc/dev.archlist.txt Wed Jan 18 22:08:26 2012 (r230322) @@ -72,6 +72,7 @@ ex i386,amd64 fe i386,pc98,amd64 fwohci i386,sparc64,ia64,amd64,powerpc hifn i386,pc98,amd64 +hpt27xx i386,amd64 hptiop i386,amd64 hptmv i386,amd64 hptrr i386,amd64 From owner-svn-src-stable-8@FreeBSD.ORG Thu Jan 19 19:39:41 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB4CF106566B; Thu, 19 Jan 2012 19:39:41 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEE848FC14; Thu, 19 Jan 2012 19:39:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0JJdfIs004092; Thu, 19 Jan 2012 19:39:41 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0JJdfIB004090; Thu, 19 Jan 2012 19:39:41 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201201191939.q0JJdfIB004090@svn.freebsd.org> From: "George V. Neville-Neil" Date: Thu, 19 Jan 2012 19:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230335 - stable/8/sys/dev/null X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 19:39:42 -0000 Author: gnn Date: Thu Jan 19 19:39:41 2012 New Revision: 230335 URL: http://svn.freebsd.org/changeset/base/230335 Log: MFC: 229965 Fix for PR 138526. Add the ability for /dev/null and /dev/zero to accept being set into non blocking mode via fcntl(). This brings the code into compliance with IEEE Std 1003.1-2001 as referenced in another PR, 94729. Reviewed by: jhb Modified: stable/8/sys/dev/null/null.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/null/null.c ============================================================================== --- stable/8/sys/dev/null/null.c Thu Jan 19 18:42:03 2012 (r230334) +++ stable/8/sys/dev/null/null.c Thu Jan 19 19:39:41 2012 (r230335) @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + #include /* For use with destroy_dev(9). */ @@ -47,6 +49,7 @@ static struct cdev *zero_dev; static d_write_t null_write; static d_ioctl_t null_ioctl; +static d_ioctl_t zero_ioctl; static d_read_t zero_read; static struct cdevsw null_cdevsw = { @@ -61,6 +64,7 @@ static struct cdevsw zero_cdevsw = { .d_version = D_VERSION, .d_read = zero_read, .d_write = null_write, + .d_ioctl = zero_ioctl, .d_name = "zero", .d_flags = D_MMAP_ANON, }; @@ -82,15 +86,48 @@ null_ioctl(struct cdev *dev __unused, u_ int flags __unused, struct thread *td) { int error; + error = 0; + + switch (cmd) { + case DIOCSKERNELDUMP: + error = priv_check(td, PRIV_SETDUMPER); + if (error == 0) + error = set_dumper(NULL); + break; + case FIONBIO: + break; + case FIOASYNC: + if (*(int *)data != 0) + error = EINVAL; + break; + default: + error = ENOIOCTL; + } + return (error); +} + +/* ARGSUSED */ +static int +zero_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t data __unused, + int flags __unused, struct thread *td) +{ + int error; + error = 0; - if (cmd != DIOCSKERNELDUMP) - return (ENOIOCTL); - error = priv_check(td, PRIV_SETDUMPER); - if (error) - return (error); - return (set_dumper(NULL)); + switch (cmd) { + case FIONBIO: + break; + case FIOASYNC: + if (*(int *)data != 0) + error = EINVAL; + break; + default: + error = ENOIOCTL; + } + return (error); } + /* ARGSUSED */ static int zero_read(struct cdev *dev __unused, struct uio *uio, int flags __unused) From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 20 00:20:01 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86195106566B; Fri, 20 Jan 2012 00:20:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F4F98FC08; Fri, 20 Jan 2012 00:20: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 q0K0K1GV013984; Fri, 20 Jan 2012 00:20:01 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0K0K1SY013982; Fri, 20 Jan 2012 00:20:01 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201201200020.q0K0K1SY013982@svn.freebsd.org> From: Ed Maste Date: Fri, 20 Jan 2012 00:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230343 - stable/8/sys/geom/part X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 00:20:01 -0000 Author: emaste Date: Fri Jan 20 00:20:00 2012 New Revision: 230343 URL: http://svn.freebsd.org/changeset/base/230343 Log: MFC r216269: Don't warn if a partition appears not to be aligned on a track boundary. Modern disks use LBA and create a fake CHS geometry that doesn't have any relation to the on-disk layout of data. Modified: stable/8/sys/geom/part/g_part_mbr.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/part/g_part_mbr.c ============================================================================== --- stable/8/sys/geom/part/g_part_mbr.c Thu Jan 19 23:16:23 2012 (r230342) +++ stable/8/sys/geom/part/g_part_mbr.c Fri Jan 20 00:20:00 2012 (r230343) @@ -461,12 +461,6 @@ g_part_mbr_read(struct g_part_table *bas basetable->gpt_heads = heads; } } - if ((ent.dp_start % basetable->gpt_sectors) != 0) - printf("GEOM: %s: partition %d does not start on a " - "track boundary.\n", pp->name, index + 1); - if ((ent.dp_size % basetable->gpt_sectors) != 0) - printf("GEOM: %s: partition %d does not end on a " - "track boundary.\n", pp->name, index + 1); entry = (struct g_part_mbr_entry *)g_part_new_entry(basetable, index + 1, ent.dp_start, ent.dp_start + ent.dp_size - 1); From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 20 15:44:39 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE71B106566B; Fri, 20 Jan 2012 15:44:39 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7DBC8FC13; Fri, 20 Jan 2012 15:44:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0KFidmc047971; Fri, 20 Jan 2012 15:44:39 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KFid0m047969; Fri, 20 Jan 2012 15:44:39 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201201544.q0KFid0m047969@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 20 Jan 2012 15:44:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230382 - stable/8/usr.bin/xlint/xlint X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 15:44:39 -0000 Author: jilles Date: Fri Jan 20 15:44:39 2012 New Revision: 230382 URL: http://svn.freebsd.org/changeset/base/230382 Log: MFC r227123: lint: Fix lseek() argument order. Because SEEK_SET is 0, this seems to have no effect on the generated code. PR: bin/160806 Submitted by: Henning Petersen Obtained from: NetBSD Modified: stable/8/usr.bin/xlint/xlint/xlint.c Directory Properties: stable/8/usr.bin/xlint/ (props changed) Modified: stable/8/usr.bin/xlint/xlint/xlint.c ============================================================================== --- stable/8/usr.bin/xlint/xlint/xlint.c Fri Jan 20 15:43:08 2012 (r230381) +++ stable/8/usr.bin/xlint/xlint/xlint.c Fri Jan 20 15:44:39 2012 (r230382) @@ -655,7 +655,7 @@ fname(const char *name) appcstrg(&args, name); /* we reuse the same tmp file for cpp output, so rewind and truncate */ - if (lseek(cppoutfd, SEEK_SET, (off_t)0) != 0) { + if (lseek(cppoutfd, (off_t)0, SEEK_SET) != 0) { warn("lseek"); terminate(-1); } From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 20 16:31:44 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B7FD1065672; Fri, 20 Jan 2012 16:31:44 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 549B28FC19; Fri, 20 Jan 2012 16:31: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 q0KGVioC049632; Fri, 20 Jan 2012 16:31:44 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0KGVioi049630; Fri, 20 Jan 2012 16:31:44 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201201631.q0KGVioi049630@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 20 Jan 2012 16:31:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230385 - stable/8/tools/regression/fifo/fifo_misc X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2012 16:31:44 -0000 Author: jilles Date: Fri Jan 20 16:31:44 2012 New Revision: 230385 URL: http://svn.freebsd.org/changeset/base/230385 Log: MFC r227124: fifo_misc test: Fix swapped lseek arguments. It worked regardless because SEEK_CUR happens to be 1. PR: misc/160866 Modified: stable/8/tools/regression/fifo/fifo_misc/fifo_misc.c Directory Properties: stable/8/tools/regression/fifo/ (props changed) Modified: stable/8/tools/regression/fifo/fifo_misc/fifo_misc.c ============================================================================== --- stable/8/tools/regression/fifo/fifo_misc/fifo_misc.c Fri Jan 20 16:29:17 2012 (r230384) +++ stable/8/tools/regression/fifo/fifo_misc/fifo_misc.c Fri Jan 20 16:31:44 2012 (r230385) @@ -115,7 +115,7 @@ test_lseek(void) exit(-1); } - if (lseek(reader_fd, SEEK_CUR, 1) >= 0) { + if (lseek(reader_fd, 1, SEEK_CUR) >= 0) { warnx("%s: lseek succeeded instead of returning ESPIPE", __func__); cleanfifo("testfifo", reader_fd, writer_fd); From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 21 03:44:52 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F2181065674; Sat, 21 Jan 2012 03:44:52 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E80508FC13; Sat, 21 Jan 2012 03:44: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 q0L3iphV072379; Sat, 21 Jan 2012 03:44:51 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0L3ipGS072369; Sat, 21 Jan 2012 03:44:51 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201201210344.q0L3ipGS072369@svn.freebsd.org> From: Lawrence Stewart Date: Sat, 21 Jan 2012 03:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230413 - in stable/8: contrib/openbsm/libbsm lib/libc/gen share/man/man4 share/man/man9 tools/tools/ether_reflect usr.sbin/bsnmpd/modules/snmp_bridge usr.sbin/bsnmpd/modules/snmp_hostres X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 03:44:52 -0000 Author: lstewart Date: Sat Jan 21 03:44:51 2012 New Revision: 230413 URL: http://svn.freebsd.org/changeset/base/230413 Log: MFC r222286 (originally committed by ru): [mdoc] Fixed .Dt call. Modified: stable/8/contrib/openbsm/libbsm/audit_submit.3 stable/8/lib/libc/gen/feature_present.3 stable/8/share/man/man4/h_ertt.4 stable/8/share/man/man9/devfs_set_cdevpriv.9 stable/8/share/man/man9/hhook.9 stable/8/share/man/man9/khelp.9 stable/8/tools/tools/ether_reflect/ether_reflect.1 stable/8/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 stable/8/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3 Directory Properties: stable/8/contrib/openbsm/ (props changed) stable/8/lib/libc/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/tools/tools/ether_reflect/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) Modified: stable/8/contrib/openbsm/libbsm/audit_submit.3 ============================================================================== --- stable/8/contrib/openbsm/libbsm/audit_submit.3 Sat Jan 21 03:16:32 2012 (r230412) +++ stable/8/contrib/openbsm/libbsm/audit_submit.3 Sat Jan 21 03:44:51 2012 (r230413) @@ -30,7 +30,7 @@ .\" $P4: //depot/projects/trustedbsd/openbsm/libbsm/audit_submit.3#17 $ .\" .Dd January 18, 2008 -.Dt audit_submit 3 +.Dt AUDIT_SUBMIT 3 .Os .Sh NAME .Nm audit_submit Modified: stable/8/lib/libc/gen/feature_present.3 ============================================================================== --- stable/8/lib/libc/gen/feature_present.3 Sat Jan 21 03:16:32 2012 (r230412) +++ stable/8/lib/libc/gen/feature_present.3 Sat Jan 21 03:44:51 2012 (r230413) @@ -29,7 +29,7 @@ .\" $FreeBSD$ .\" .Dd January 8, 2008 -.Dt feature_present 3 +.Dt FEATURE_PRESENT 3 .Os .Sh NAME .Nm feature_present Modified: stable/8/share/man/man4/h_ertt.4 ============================================================================== --- stable/8/share/man/man4/h_ertt.4 Sat Jan 21 03:16:32 2012 (r230412) +++ stable/8/share/man/man4/h_ertt.4 Sat Jan 21 03:44:51 2012 (r230413) @@ -30,7 +30,7 @@ .\" $FreeBSD$ .\" .Dd February 15, 2011 -.Dt h_ertt 9 +.Dt H_ERTT 9 .Os .Sh NAME .Nm h_ertt Modified: stable/8/share/man/man9/devfs_set_cdevpriv.9 ============================================================================== --- stable/8/share/man/man9/devfs_set_cdevpriv.9 Sat Jan 21 03:16:32 2012 (r230412) +++ stable/8/share/man/man9/devfs_set_cdevpriv.9 Sat Jan 21 03:44:51 2012 (r230413) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd September 8, 2008 -.Dt DEVFS_CDEVPRIV +.Dt DEVFS_CDEVPRIV 9 .Os .Sh NAME .Nm devfs_set_cdevpriv , Modified: stable/8/share/man/man9/hhook.9 ============================================================================== --- stable/8/share/man/man9/hhook.9 Sat Jan 21 03:16:32 2012 (r230412) +++ stable/8/share/man/man9/hhook.9 Sat Jan 21 03:44:51 2012 (r230413) @@ -31,7 +31,7 @@ .\" $FreeBSD$ .\" .Dd February 15, 2011 -.Dt hhook 9 +.Dt HHOOK 9 .Os .Sh NAME .Nm hhook , Modified: stable/8/share/man/man9/khelp.9 ============================================================================== --- stable/8/share/man/man9/khelp.9 Sat Jan 21 03:16:32 2012 (r230412) +++ stable/8/share/man/man9/khelp.9 Sat Jan 21 03:44:51 2012 (r230413) @@ -31,7 +31,7 @@ .\" $FreeBSD$ .\" .Dd February 15, 2011 -.Dt khelp 9 +.Dt KHELP 9 .Os .Sh NAME .Nm khelp , Modified: stable/8/tools/tools/ether_reflect/ether_reflect.1 ============================================================================== --- stable/8/tools/tools/ether_reflect/ether_reflect.1 Sat Jan 21 03:16:32 2012 (r230412) +++ stable/8/tools/tools/ether_reflect/ether_reflect.1 Sat Jan 21 03:44:51 2012 (r230413) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd December 23, 2008 -.Dt ether_reflect 1 +.Dt ETHER_REFLECT 1 .Os .Sh NAME .Nm ether_reflect Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 ============================================================================== --- stable/8/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 Sat Jan 21 03:16:32 2012 (r230412) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 Sat Jan 21 03:44:51 2012 (r230413) @@ -26,7 +26,7 @@ .\" $FreeBSD$ .\" .Dd August 6, 2007 -.Dt snmp_bridge 3 +.Dt SNMP_BRIDGE 3 .Os .Sh NAME .Nm snmp_bridge Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3 ============================================================================== --- stable/8/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3 Sat Jan 21 03:16:32 2012 (r230412) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3 Sat Jan 21 03:44:51 2012 (r230413) @@ -29,7 +29,7 @@ .\" $FreeBSD$ .\" .Dd January 3, 2006 -.Dt snmp_hostres 3 +.Dt SNMP_HOSTRES 3 .Os .Sh NAME .Nm snmp_hostres From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 21 03:46:59 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 818901065673; Sat, 21 Jan 2012 03:46:59 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FA588FC16; Sat, 21 Jan 2012 03:46: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 q0L3kxvt072500; Sat, 21 Jan 2012 03:46:59 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0L3kxBZ072498; Sat, 21 Jan 2012 03:46:59 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201201210346.q0L3kxBZ072498@svn.freebsd.org> From: Lawrence Stewart Date: Sat, 21 Jan 2012 03:46:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230414 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 03:46:59 -0000 Author: lstewart Date: Sat Jan 21 03:46:58 2012 New Revision: 230414 URL: http://svn.freebsd.org/changeset/base/230414 Log: MFC r230294: Specify the correct section (4 instead of 9) in the h_ertt man page's title and bump the document date. Modified: stable/8/share/man/man4/h_ertt.4 Directory Properties: stable/8/share/man/ (props changed) stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/h_ertt.4 ============================================================================== --- stable/8/share/man/man4/h_ertt.4 Sat Jan 21 03:44:51 2012 (r230413) +++ stable/8/share/man/man4/h_ertt.4 Sat Jan 21 03:46:58 2012 (r230414) @@ -29,8 +29,8 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2011 -.Dt H_ERTT 9 +.Dd January 18, 2012 +.Dt H_ERTT 4 .Os .Sh NAME .Nm h_ertt From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 21 04:22:20 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79F701065677; Sat, 21 Jan 2012 04:22:20 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D95E8FC12; Sat, 21 Jan 2012 04:22:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0L4MKM5073738; Sat, 21 Jan 2012 04:22:20 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0L4MKhV073736; Sat, 21 Jan 2012 04:22:20 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201201210422.q0L4MKhV073736@svn.freebsd.org> From: Lawrence Stewart Date: Sat, 21 Jan 2012 04:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230416 - stable/8/sys/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 04:22:20 -0000 Author: lstewart Date: Sat Jan 21 04:22:19 2012 New Revision: 230416 URL: http://svn.freebsd.org/changeset/base/230416 Log: MFC r229898: Consumers of bpfdetach() expect it to remove all bpf_if structs from the bpf_iflist list which reference the specified ifnet. The existing implementation only removes the first matching bpf_if found in the list, effectively leaking list entries if an ifnet has been bpfattach()ed multiple times with different DLTs. Fix the leak by performing the detach logic in a loop, stopping when all bpf_if structs referencing the specified ifnet have been detached and removed from the bpf_iflist list. Whilst here, also: - Remove the unnecessary "bp->bif_ifp == NULL" check, as a bpf_if should never exist in the list with a NULL ifnet pointer. - Except when INVARIANTS is in the kernel config, silently ignore the case where no bpf_if referencing the specified ifnet is found, as it is harmless and does not require user attention. Reviewed by: csjp Modified: stable/8/sys/net/bpf.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/net/bpf.c ============================================================================== --- stable/8/sys/net/bpf.c Sat Jan 21 03:59:31 2012 (r230415) +++ stable/8/sys/net/bpf.c Sat Jan 21 04:22:19 2012 (r230416) @@ -2103,33 +2103,42 @@ bpfdetach(struct ifnet *ifp) { struct bpf_if *bp; struct bpf_d *d; +#ifdef INVARIANTS + int ndetached; - /* Locate BPF interface information */ - mtx_lock(&bpf_mtx); - LIST_FOREACH(bp, &bpf_iflist, bif_next) { - if (ifp == bp->bif_ifp) - break; - } + ndetached = 0; +#endif - /* Interface wasn't attached */ - if ((bp == NULL) || (bp->bif_ifp == NULL)) { + /* Find all bpf_if struct's which reference ifp and detach them. */ + do { + mtx_lock(&bpf_mtx); + LIST_FOREACH(bp, &bpf_iflist, bif_next) { + if (ifp == bp->bif_ifp) + break; + } + if (bp != NULL) + LIST_REMOVE(bp, bif_next); mtx_unlock(&bpf_mtx); - printf("bpfdetach: %s was not attached\n", ifp->if_xname); - return; - } - - LIST_REMOVE(bp, bif_next); - mtx_unlock(&bpf_mtx); - while ((d = LIST_FIRST(&bp->bif_dlist)) != NULL) { - bpf_detachd(d); - BPFD_LOCK(d); - bpf_wakeup(d); - BPFD_UNLOCK(d); - } + if (bp != NULL) { +#ifdef INVARIANTS + ndetached++; +#endif + while ((d = LIST_FIRST(&bp->bif_dlist)) != NULL) { + bpf_detachd(d); + BPFD_LOCK(d); + bpf_wakeup(d); + BPFD_UNLOCK(d); + } + mtx_destroy(&bp->bif_mtx); + free(bp, M_BPF); + } + } while (bp != NULL); - mtx_destroy(&bp->bif_mtx); - free(bp, M_BPF); +#ifdef INVARIANTS + if (ndetached == 0) + printf("bpfdetach: %s was not attached\n", ifp->if_xname); +#endif } /* From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 21 07:21:45 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DD83106564A; Sat, 21 Jan 2012 07:21:45 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C1C58FC08; Sat, 21 Jan 2012 07:21: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 q0L7Ljtx079792; Sat, 21 Jan 2012 07:21:45 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0L7LjJr079790; Sat, 21 Jan 2012 07:21:45 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201201210721.q0L7LjJr079790@svn.freebsd.org> From: Alan Cox Date: Sat, 21 Jan 2012 07:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230419 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 07:21:45 -0000 Author: alc Date: Sat Jan 21 07:21:44 2012 New Revision: 230419 URL: http://svn.freebsd.org/changeset/base/230419 Log: MFC r226163, r228317, and r228324 Fix the handling of an empty kmem map by sysctl_kmem_map_free(). Eliminate the possibility of 32-bit arithmetic overflow in the calculation of vm_kmem_size that may occur if the system administrator has specified a vm.vm_kmem_size tunable value that exceeds the hard cap. Eliminate stale numbers from a comment. PR: 162741 Modified: stable/8/sys/kern/kern_malloc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_malloc.c ============================================================================== --- stable/8/sys/kern/kern_malloc.c Sat Jan 21 05:03:10 2012 (r230418) +++ stable/8/sys/kern/kern_malloc.c Sat Jan 21 07:21:44 2012 (r230419) @@ -258,8 +258,8 @@ sysctl_kmem_map_free(SYSCTL_HANDLER_ARGS u_long size; vm_map_lock_read(kmem_map); - size = kmem_map->root != NULL ? - kmem_map->root->max_free : kmem_map->size; + size = kmem_map->root != NULL ? kmem_map->root->max_free : + kmem_map->max_offset - kmem_map->min_offset; vm_map_unlock_read(kmem_map); return (sysctl_handle_long(oidp, &size, 0, req)); } @@ -595,12 +595,9 @@ kmeminit(void *dummy) /* * Try to auto-tune the kernel memory size, so that it is - * more applicable for a wider range of machine sizes. - * On an X86, a VM_KMEM_SIZE_SCALE value of 4 is good, while - * a VM_KMEM_SIZE of 12MB is a fair compromise. The + * more applicable for a wider range of machine sizes. The * VM_KMEM_SIZE_MAX is dependent on the maximum KVA space - * available, and on an X86 with a total KVA space of 256MB, - * try to keep VM_KMEM_SIZE_MAX at 80MB or below. + * available. * * Note that the kmem_map is also used by the zone allocator, * so make sure that there is enough space. @@ -637,11 +634,11 @@ kmeminit(void *dummy) /* * Limit kmem virtual size to twice the physical memory. * This allows for kmem map sparseness, but limits the size - * to something sane. Be careful to not overflow the 32bit - * ints while doing the check. + * to something sane. Be careful to not overflow the 32bit + * ints while doing the check or the adjustment. */ - if (((vm_kmem_size / 2) / PAGE_SIZE) > cnt.v_page_count) - vm_kmem_size = 2 * cnt.v_page_count * PAGE_SIZE; + if (vm_kmem_size / 2 / PAGE_SIZE > mem_size) + vm_kmem_size = 2 * mem_size * PAGE_SIZE; /* * Tune settings based on the kmem map's size at this time. From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 21 18:21:44 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E96FC106564A; Sat, 21 Jan 2012 18:21:44 +0000 (UTC) (envelope-from rmh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA5888FC12; Sat, 21 Jan 2012 18:21: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 q0LILidW003957; Sat, 21 Jan 2012 18:21:44 GMT (envelope-from rmh@svn.freebsd.org) Received: (from rmh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0LILiCk003955; Sat, 21 Jan 2012 18:21:44 GMT (envelope-from rmh@svn.freebsd.org) Message-Id: <201201211821.q0LILiCk003955@svn.freebsd.org> From: Robert Millan Date: Sat, 21 Jan 2012 18:21:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230432 - stable/8/sys/sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 18:21:45 -0000 Author: rmh Date: Sat Jan 21 18:21:44 2012 New Revision: 230432 URL: http://svn.freebsd.org/changeset/base/230432 Log: MFC r227827 Define __FreeBSD_kernel__ macro in sys/param.h. __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, which by definition is always true on FreeBSD. This macro is also defined on other systems that use the kernel of FreeBSD, such as GNU/kFreeBSD. It is tempting to use this macro in userland code when we want to enable kernel-specific routines, and in fact it's fine to do this in code that is part of FreeBSD itself. However, be aware that as presence of this macro is still not widespread (e.g. older FreeBSD versions, 3rd party compilers, etc), it is STRONGLY DISCOURAGED to check for this macro in external applications without also checking for __FreeBSD__ as an alternative. Approved by: kib (mentor) Modified: stable/8/sys/sys/param.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sys/param.h ============================================================================== --- stable/8/sys/sys/param.h Sat Jan 21 18:11:12 2012 (r230431) +++ stable/8/sys/sys/param.h Sat Jan 21 18:21:44 2012 (r230432) @@ -60,6 +60,22 @@ #undef __FreeBSD_version #define __FreeBSD_version 802516 /* Master, propagated to newvers */ +/* + * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, + * which by definition is always true on FreeBSD. This macro is also defined + * on other systems that use the kernel of FreeBSD, such as GNU/kFreeBSD. + * + * It is tempting to use this macro in userland code when we want to enable + * kernel-specific routines, and in fact it's fine to do this in code that + * is part of FreeBSD itself. However, be aware that as presence of this + * macro is still not widespread (e.g. older FreeBSD versions, 3rd party + * compilers, etc), it is STRONGLY DISCOURAGED to check for this macro in + * external applications without also checking for __FreeBSD__ as an + * alternative. + */ +#undef __FreeBSD_kernel__ +#define __FreeBSD_kernel__ + #ifdef _KERNEL #define P_OSREL_SIGWAIT 700000 #define P_OSREL_SIGSEGV 700004 From owner-svn-src-stable-8@FreeBSD.ORG Sat Jan 21 18:38:58 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E84BE106566C; Sat, 21 Jan 2012 18:38:57 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C86528FC0C; Sat, 21 Jan 2012 18:38: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 q0LIcvmu004609; Sat, 21 Jan 2012 18:38:57 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0LIcvMG004607; Sat, 21 Jan 2012 18:38:57 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201201211838.q0LIcvMG004607@svn.freebsd.org> From: Alan Cox Date: Sat, 21 Jan 2012 18:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230433 - stable/8/sys/i386/xen X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jan 2012 18:38:58 -0000 Author: alc Date: Sat Jan 21 18:38:57 2012 New Revision: 230433 URL: http://svn.freebsd.org/changeset/base/230433 Log: MFC r228746 The Xen pmap doesn't support superpages. So, there is no point in it initializing structures, like the pv table, that are only used to implement superpages. In fact, some of the unnecessary code in pmap_init() was actually doing harm. It was preventing the kernel from booting on virtual machines with more than 768 MB of memory. Note: The change to pmap_page_is_mapped() differs slightly from r228746 because of differences in how the page queues lock is used in FreeBSD 8.x. Modified: stable/8/sys/i386/xen/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/i386/xen/pmap.c ============================================================================== --- stable/8/sys/i386/xen/pmap.c Sat Jan 21 18:21:44 2012 (r230432) +++ stable/8/sys/i386/xen/pmap.c Sat Jan 21 18:38:57 2012 (r230433) @@ -184,9 +184,6 @@ __FBSDID("$FreeBSD$"); #define PV_STAT(x) do { } while (0) #endif -#define pa_index(pa) ((pa) >> PDRSHIFT) -#define pa_to_pvh(pa) (&pv_table[pa_index(pa)]) - /* * Get PDEs and PTEs for user/kernel address space */ @@ -233,7 +230,6 @@ static int pat_works; /* Is page attri * Data for the pv entry allocation mechanism */ static int pv_entry_count = 0, pv_entry_max = 0, pv_entry_high_water = 0; -static struct md_page *pv_table; static int shpgperproc = PMAP_SHPGPERPROC; struct pv_chunk *pv_chunkbase; /* KVA block for pv_chunks */ @@ -282,9 +278,6 @@ SYSCTL_INT(_debug, OID_AUTO, PMAP1unchan static struct mtx PMAP2mutex; SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); -static int pg_ps_enabled; -SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN, &pg_ps_enabled, 0, - "Are large page mappings enabled?"); SYSCTL_INT(_vm_pmap, OID_AUTO, pv_entry_max, CTLFLAG_RD, &pv_entry_max, 0, "Max number of PV entries"); @@ -687,24 +680,8 @@ pmap_ptelist_init(vm_offset_t *head, voi void pmap_init(void) { - vm_page_t mpte; - vm_size_t s; - int i, pv_npg; /* - * Initialize the vm page array entries for the kernel pmap's - * page table pages. - */ - for (i = 0; i < nkpt; i++) { - mpte = PHYS_TO_VM_PAGE(xpmap_mtop(PTD[i + KPTDI] & PG_FRAME)); - KASSERT(mpte >= vm_page_array && - mpte < &vm_page_array[vm_page_array_size], - ("pmap_init: page table page is out of range")); - mpte->pindex = i + KPTDI; - mpte->phys_addr = xpmap_mtop(PTD[i + KPTDI] & PG_FRAME); - } - - /* * Initialize the address space (zone) for the pv entries. Set a * high water mark so that the system can recover from excessive * numbers of pv entries. @@ -715,26 +692,6 @@ pmap_init(void) pv_entry_max = roundup(pv_entry_max, _NPCPV); pv_entry_high_water = 9 * (pv_entry_max / 10); - /* - * Are large page mappings enabled? - */ - TUNABLE_INT_FETCH("vm.pmap.pg_ps_enabled", &pg_ps_enabled); - - /* - * Calculate the size of the pv head table for superpages. - */ - for (i = 0; phys_avail[i + 1]; i += 2); - pv_npg = round_4mpage(phys_avail[(i - 2) + 1]) / NBPDR; - - /* - * Allocate memory for the pv head table for superpages. - */ - s = (vm_size_t)(pv_npg * sizeof(struct md_page)); - s = round_page(s); - pv_table = (struct md_page *)kmem_alloc(kernel_map, s); - for (i = 0; i < pv_npg; i++) - TAILQ_INIT(&pv_table[i].pv_list); - pv_maxchunks = MAX(pv_entry_max / _NPCPV, maxproc); pv_chunkbase = (struct pv_chunk *)kmem_alloc_nofault(kernel_map, PAGE_SIZE * pv_maxchunks); @@ -3537,22 +3494,16 @@ pmap_page_wired_mappings(vm_page_t m) } /* - * Returns TRUE if the given page is mapped individually or as part of - * a 4mpage. Otherwise, returns FALSE. + * Returns TRUE if the given page is mapped. Otherwise, returns FALSE. */ boolean_t pmap_page_is_mapped(vm_page_t m) { - struct md_page *pvh; if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0) return (FALSE); mtx_assert(&vm_page_queue_mtx, MA_OWNED); - if (TAILQ_EMPTY(&m->md.pv_list)) { - pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m)); - return (!TAILQ_EMPTY(&pvh->pv_list)); - } else - return (TRUE); + return (!TAILQ_EMPTY(&m->md.pv_list)); } /*