From owner-svn-src-all@FreeBSD.ORG Sun Oct 10 07:05:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 049CB106566C; Sun, 10 Oct 2010 07:05:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E55568FC0A; Sun, 10 Oct 2010 07:05:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9A75la7073561; Sun, 10 Oct 2010 07:05:47 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9A75lrf073546; Sun, 10 Oct 2010 07:05:47 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010100705.o9A75lrf073546@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 10 Oct 2010 07:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213664 - in head/sys: fs/cd9660 fs/hpfs fs/msdosfs fs/ntfs gnu/fs/reiserfs kern sys ufs/ffs ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 07:05:48 -0000 Author: kib Date: Sun Oct 10 07:05:47 2010 New Revision: 213664 URL: http://svn.freebsd.org/changeset/base/213664 Log: The r184588 changed the layout of struct export_args, causing an ABI breakage for old mount(2) syscall, since most struct _args embed export_args. The mount(2) is supposed to provide ABI compatibility for pre-nmount mount(8) binaries, so restore ABI to pre-r184588. Requested and reviewed by: bde MFC after: 2 weeks Modified: head/sys/fs/cd9660/cd9660_mount.h head/sys/fs/cd9660/cd9660_vfsops.c head/sys/fs/hpfs/hpfs_vfsops.c head/sys/fs/hpfs/hpfsmount.h head/sys/fs/msdosfs/msdosfs_vfsops.c head/sys/fs/msdosfs/msdosfsmount.h head/sys/fs/ntfs/ntfs_vfsops.c head/sys/fs/ntfs/ntfsmount.h head/sys/gnu/fs/reiserfs/reiserfs_mount.h head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c head/sys/kern/vfs_mount.c head/sys/sys/mount.h head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ufs/ufsmount.h Modified: head/sys/fs/cd9660/cd9660_mount.h ============================================================================== --- head/sys/fs/cd9660/cd9660_mount.h Sat Oct 9 20:52:36 2010 (r213663) +++ head/sys/fs/cd9660/cd9660_mount.h Sun Oct 10 07:05:47 2010 (r213664) @@ -40,7 +40,7 @@ */ struct iso_args { char *fspec; /* block special device to mount */ - struct export_args export; /* network export info */ + struct oexport_args export; /* network export info */ int flags; /* mounting flags, see below */ int ssector; /* starting sector, 0 for 1st session */ char *cs_disk; /* disk charset for Joliet cs conversion */ Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Sat Oct 9 20:52:36 2010 (r213663) +++ head/sys/fs/cd9660/cd9660_vfsops.c Sun Oct 10 07:05:47 2010 (r213664) @@ -98,14 +98,16 @@ static int cd9660_cmount(struct mntarg *ma, void *data, int flags) { struct iso_args args; + struct export_args exp; int error; error = copyin(data, &args, sizeof args); if (error) return (error); + vfs_oexport_conv(&args.export, &exp); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); - ma = mount_arg(ma, "export", &args.export, sizeof args.export); + ma = mount_arg(ma, "export", &exp, sizeof(exp)); ma = mount_argsu(ma, "cs_disk", args.cs_disk, 64); ma = mount_argsu(ma, "cs_local", args.cs_local, 64); ma = mount_argf(ma, "ssector", "%u", args.ssector); Modified: head/sys/fs/hpfs/hpfs_vfsops.c ============================================================================== --- head/sys/fs/hpfs/hpfs_vfsops.c Sat Oct 9 20:52:36 2010 (r213663) +++ head/sys/fs/hpfs/hpfs_vfsops.c Sun Oct 10 07:05:47 2010 (r213664) @@ -76,14 +76,16 @@ hpfs_cmount ( int flags) { struct hpfs_args args; + struct export_args exp; int error; error = copyin(data, (caddr_t)&args, sizeof (struct hpfs_args)); if (error) return (error); + vfs_oexport_conv(&args.export, &exp); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); - ma = mount_arg(ma, "export", &args.export, sizeof args.export); + ma = mount_arg(ma, "export", &exp, sizeof(exp)); ma = mount_argf(ma, "uid", "%d", args.uid); ma = mount_argf(ma, "gid", "%d", args.gid); ma = mount_argf(ma, "mode", "%d", args.mode); Modified: head/sys/fs/hpfs/hpfsmount.h ============================================================================== --- head/sys/fs/hpfs/hpfsmount.h Sat Oct 9 20:52:36 2010 (r213663) +++ head/sys/fs/hpfs/hpfsmount.h Sun Oct 10 07:05:47 2010 (r213664) @@ -29,7 +29,7 @@ #define HPFSMNT_TABLES 0x0001 struct hpfs_args { char *fspec; /* block special device to mount */ - struct export_args export; /* network export information */ + struct oexport_args export; /* network export information */ uid_t uid; /* uid that owns hpfs files */ gid_t gid; /* gid that owns hpfs files */ mode_t mode; /* mask to be applied for hpfs perms */ Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Sat Oct 9 20:52:36 2010 (r213663) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Sun Oct 10 07:05:47 2010 (r213664) @@ -200,6 +200,7 @@ static int msdosfs_cmount(struct mntarg *ma, void *data, int flags) { struct msdosfs_args args; + struct export_args exp; int error; if (data == NULL) @@ -207,9 +208,10 @@ msdosfs_cmount(struct mntarg *ma, void * error = copyin(data, &args, sizeof args); if (error) return (error); + vfs_oexport_conv(&args.export, &exp); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); - ma = mount_arg(ma, "export", &args.export, sizeof args.export); + ma = mount_arg(ma, "export", &exp, sizeof(exp)); ma = mount_argf(ma, "uid", "%d", args.uid); ma = mount_argf(ma, "gid", "%d", args.gid); ma = mount_argf(ma, "mask", "%d", args.mask); Modified: head/sys/fs/msdosfs/msdosfsmount.h ============================================================================== --- head/sys/fs/msdosfs/msdosfsmount.h Sat Oct 9 20:52:36 2010 (r213663) +++ head/sys/fs/msdosfs/msdosfsmount.h Sun Oct 10 07:05:47 2010 (r213664) @@ -234,7 +234,7 @@ uint32_t msdosfs_fileno_map(struct mount */ struct msdosfs_args { char *fspec; /* blocks special holding the fs to mount */ - struct export_args export; /* network export information */ + struct oexport_args export; /* network export information */ uid_t uid; /* uid that owns msdosfs files */ gid_t gid; /* gid that owns msdosfs files */ mode_t mask; /* file mask to be applied for msdosfs perms */ Modified: head/sys/fs/ntfs/ntfs_vfsops.c ============================================================================== --- head/sys/fs/ntfs/ntfs_vfsops.c Sat Oct 9 20:52:36 2010 (r213663) +++ head/sys/fs/ntfs/ntfs_vfsops.c Sun Oct 10 07:05:47 2010 (r213664) @@ -119,14 +119,16 @@ ntfs_cmount ( void *data, int flags) { - int error; struct ntfs_args args; + struct export_args exp; + int error; - error = copyin(data, (caddr_t)&args, sizeof args); + error = copyin(data, &args, sizeof(args)); if (error) return (error); + vfs_oexport_conv(&args.export, &exp); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); - ma = mount_arg(ma, "export", &args.export, sizeof args.export); + ma = mount_arg(ma, "export", &exp, sizeof(exp)); ma = mount_argf(ma, "uid", "%d", args.uid); ma = mount_argf(ma, "gid", "%d", args.gid); ma = mount_argf(ma, "mode", "%d", args.mode); Modified: head/sys/fs/ntfs/ntfsmount.h ============================================================================== --- head/sys/fs/ntfs/ntfsmount.h Sat Oct 9 20:52:36 2010 (r213663) +++ head/sys/fs/ntfs/ntfsmount.h Sun Oct 10 07:05:47 2010 (r213664) @@ -34,7 +34,7 @@ struct ntfs_args { char *fspec; /* block special device to mount */ - struct export_args export; /* network export information */ + struct oexport_args export; /* network export information */ uid_t uid; /* uid that owns ntfs files */ gid_t gid; /* gid that owns ntfs files */ mode_t mode; /* mask to be applied for ntfs perms */ Modified: head/sys/gnu/fs/reiserfs/reiserfs_mount.h ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_mount.h Sat Oct 9 20:52:36 2010 (r213663) +++ head/sys/gnu/fs/reiserfs/reiserfs_mount.h Sun Oct 10 07:05:47 2010 (r213664) @@ -39,7 +39,7 @@ struct reiserfs_mount { /* Arguments to mount ReiserFS filesystems. */ struct reiserfs_args { char *fspec; /* blocks special holding the fs to mount */ - struct export_args export; /* network export information */ + struct oexport_args export; /* network export information */ }; #endif /* !defined _GNU_REISERFS_REISERFS_MOUNT_H */ Modified: head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c ============================================================================== --- head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Sat Oct 9 20:52:36 2010 (r213663) +++ head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Sun Oct 10 07:05:47 2010 (r213664) @@ -52,14 +52,16 @@ static int reiserfs_cmount(struct mntarg *ma, void *data, int flags) { struct reiserfs_args args; + struct export_args exp; int error; error = copyin(data, &args, sizeof(args)); if (error) return (error); + vfs_oexport_conv(&args.export, &exp); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); - ma = mount_arg(ma, "export", &args.export, sizeof args.export); + ma = mount_arg(ma, "export", &exp, sizeof(exp)); error = kernel_mount(ma, flags); Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sat Oct 9 20:52:36 2010 (r213663) +++ head/sys/kern/vfs_mount.c Sun Oct 10 07:05:47 2010 (r213664) @@ -1960,3 +1960,11 @@ kernel_vmount(int flags, ...) error = kernel_mount(ma, flags); return (error); } + +void +vfs_oexport_conv(const struct oexport_args *oexp, struct export_args *exp) +{ + + bcopy(oexp, exp, sizeof(*oexp)); + exp->ex_numsecflavors = 0; +} Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sat Oct 9 20:52:36 2010 (r213663) +++ head/sys/sys/mount.h Sun Oct 10 07:05:47 2010 (r213664) @@ -741,6 +741,8 @@ int vfs_modevent(module_t, int, void *); void vfs_mount_error(struct mount *, const char *, ...); void vfs_mountroot(void); /* mount our root filesystem */ void vfs_mountedfrom(struct mount *, const char *from); +void vfs_oexport_conv(const struct oexport_args *oexp, + struct export_args *exp); void vfs_ref(struct mount *); void vfs_rel(struct mount *); struct mount *vfs_mount_alloc(struct vnode *, struct vfsconf *, const char *, Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sat Oct 9 20:52:36 2010 (r213663) +++ head/sys/ufs/ffs/ffs_vfsops.c Sun Oct 10 07:05:47 2010 (r213664) @@ -463,6 +463,7 @@ static int ffs_cmount(struct mntarg *ma, void *data, int flags) { struct ufs_args args; + struct export_args exp; int error; if (data == NULL) @@ -470,9 +471,10 @@ ffs_cmount(struct mntarg *ma, void *data error = copyin(data, &args, sizeof args); if (error) return (error); + vfs_oexport_conv(&args.export, &exp); ma = mount_argsu(ma, "from", args.fspec, MAXPATHLEN); - ma = mount_arg(ma, "export", &args.export, sizeof args.export); + ma = mount_arg(ma, "export", &exp, sizeof(exp)); error = kernel_mount(ma, flags); return (error); Modified: head/sys/ufs/ufs/ufsmount.h ============================================================================== --- head/sys/ufs/ufs/ufsmount.h Sat Oct 9 20:52:36 2010 (r213663) +++ head/sys/ufs/ufs/ufsmount.h Sun Oct 10 07:05:47 2010 (r213664) @@ -40,7 +40,7 @@ */ struct ufs_args { char *fspec; /* block special device to mount */ - struct export_args export; /* network export information */ + struct oexport_args export; /* network export information */ }; #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Sun Oct 10 07:07:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA0EB106564A; Sun, 10 Oct 2010 07:07:21 +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 98C928FC0C; Sun, 10 Oct 2010 07:07:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9A77LlN073626; Sun, 10 Oct 2010 07:07:21 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9A77LpV073624; Sun, 10 Oct 2010 07:07:21 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010100707.o9A77LpV073624@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 10 Oct 2010 07:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213665 - stable/8/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 07:07:21 -0000 Author: kib Date: Sun Oct 10 07:07:21 2010 New Revision: 213665 URL: http://svn.freebsd.org/changeset/base/213665 Log: MFC r213382: In makectx(), always use the tf_rsp from trap frame. %rsp is pushed unconditionally by hardware on the trap. PR: amd64/151167 Modified: stable/8/sys/amd64/amd64/machdep.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Sun Oct 10 07:05:47 2010 (r213664) +++ stable/8/sys/amd64/amd64/machdep.c Sun Oct 10 07:07:21 2010 (r213665) @@ -1795,7 +1795,7 @@ makectx(struct trapframe *tf, struct pcb pcb->pcb_rbp = tf->tf_rbp; pcb->pcb_rbx = tf->tf_rbx; pcb->pcb_rip = tf->tf_rip; - pcb->pcb_rsp = (ISPL(tf->tf_cs)) ? tf->tf_rsp : (long)(tf + 1) - 8; + pcb->pcb_rsp = tf->tf_rsp; } int From owner-svn-src-all@FreeBSD.ORG Sun Oct 10 07:28:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D54D7106566B; Sun, 10 Oct 2010 07:28:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3F8E8FC14; Sun, 10 Oct 2010 07:28:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9A7SuPZ074099; Sun, 10 Oct 2010 07:28:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9A7Sur4074097; Sun, 10 Oct 2010 07:28:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010100728.o9A7Sur4074097@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 10 Oct 2010 07:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213666 - stable/7/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 07:28:57 -0000 Author: kib Date: Sun Oct 10 07:28:56 2010 New Revision: 213666 URL: http://svn.freebsd.org/changeset/base/213666 Log: MFC r213382: In makectx(), always use the tf_rsp from trap frame. %rsp is pushed unconditionally by hardware on the trap. PR: amd64/151167 Modified: stable/7/sys/amd64/amd64/machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/machdep.c ============================================================================== --- stable/7/sys/amd64/amd64/machdep.c Sun Oct 10 07:07:21 2010 (r213665) +++ stable/7/sys/amd64/amd64/machdep.c Sun Oct 10 07:28:56 2010 (r213666) @@ -1443,7 +1443,7 @@ makectx(struct trapframe *tf, struct pcb pcb->pcb_rbp = tf->tf_rbp; pcb->pcb_rbx = tf->tf_rbx; pcb->pcb_rip = tf->tf_rip; - pcb->pcb_rsp = (ISPL(tf->tf_cs)) ? tf->tf_rsp : (long)(tf + 1) - 8; + pcb->pcb_rsp = tf->tf_rsp; } int From owner-svn-src-all@FreeBSD.ORG Sun Oct 10 08:19:38 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B74FC106564A; Sun, 10 Oct 2010 08:19:38 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp3.one.com (csmtp3.one.com [91.198.169.23]) by mx1.freebsd.org (Postfix) with ESMTP id 323F78FC16; Sun, 10 Oct 2010 08:19:37 +0000 (UTC) Received: from [192.168.10.202] (0x573b9942.cpe.ge-1-2-0-1101.ronqu1.customer.tele.dk [87.59.153.66]) by csmtp3.one.com (Postfix) with ESMTP id 0405D24639E0; Sun, 10 Oct 2010 08:19:36 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: multipart/signed; boundary=Apple-Mail-2031--846068754; protocol="application/pkcs7-signature"; micalg=sha1 From: Erik Cederstrand In-Reply-To: <20101010083725.S3587@besplex.bde.org> Date: Sun, 10 Oct 2010 10:19:36 +0200 Message-Id: <2A26ECE8-7713-49C4-8706-5AA5B232BE29@cederstrand.dk> References: <201010090531.o995V8n3026865@svn.freebsd.org> <8C667EA1-3012-4499-BCCE-58263165663B@cederstrand.dk> <20101010083725.S3587@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1081) X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Tim Kientzle , Ben Kaduk , src-committers@FreeBSD.org Subject: Re: svn commit: r213643 - head/usr.bin/ar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 08:19:38 -0000 --Apple-Mail-2031--846068754 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Den 10/10/2010 kl. 00.11 skrev Bruce Evans: > On Sat, 9 Oct 2010, Erik Cederstrand wrote: >>>=20 >>> Thanks! Has anyone looked at the feasibility of setting AR?=3Dar -D = in >>> sys.mk? I will probably try this when I get my scratch box up = again. >=20 > I hope not. The default behaviour should not be changed by default. The reason I came up with this patch was that I wanted to do binary = diffs on FreeBSD distributions to, among other reasons, record witch = files are actually affected between commits. Except for a few edge-cases = like recording a build timestamp, it seems wrong in my view for FreeBSD = to not produce deterministic distributions on identical source code. >> I'm looking into this now, as I needed the patch to do binary diffs = on builds. One problem is that ARFLAGS is overridden a lot of places in = contrib/ code: >>=20 >> contrib/cvs/lib/Makefile.in:67:ARFLAGS=3Dcru >> contrib/cvs/diff/Makefile.in:45:ARFLAGS=3Dcru >> contrib/ntp/libntp/Makefile.in:55:ARFLAGS=3Dcru >> contrib/ntp/libparse/Makefile.in:55:ARFLAGS=3Dcru >> contrib/ntp/arlib/Makefile.in:54:ARFLAGS=3Dcru >> contrib/ntp/ntpd/Makefile.in:61:ARFLAGS=3Dcru >> contrib/tcp_wrappers/Makefile:95:ARFLAGS=3Drv >> contrib/tcp_wrappers/Makefile:101:ARFLAGS=3Drv >> [...] >> contrib/tcp_wrappers/Makefile:404:ARFLAGS=3Drv >> contrib/bind9/configure.in:73:ARFLAGS=3Dcruv >> contrib/gcclibs/libcpp/Makefile.in:30:ARFLAGS=3Dcru >> contrib/gcclibs/libdecnumber/Makefile.in:30:ARFLAGS=3Dcru >> contrib/dtc/Makefile:49:ARFLAGS=3Drc >> crypto/heimdal/appl/ftp/common/Makefile.in:93:ARFLAGS=3Dcru >> crypto/heimdal/appl/telnet/libtelnet/Makefile.in:93:ARFLAGS=3Dcru >> crypto/heimdal/lib/45/Makefile.in:101:ARFLAGS=3Dcru >> crypto/openssl/Makefile.org:66:ARFLAGS=3D >> crypto/openssl/Makefile:68:ARFLAGS=3D >=20 > Something like this seems to be needed, since the default flags in = sys.mk > of: >=20 >> share/mk/sys.mk:36:ARFLAGS?=3D-rv >> share/mk/sys.mk:38:ARFLAGS?=3Drl >> usr.bin/make/PSD.doc/tutorial.ms:2968:ARFLAGS?=3Dcrl >=20 > are almost as bad as -D there. -rv is for the %POSIX case. The -v > in it makes it wrong for most uses, especially when make output is > supposed to be quieted by -s. At least it uses the newfangled option > syntax (starting with a '-'). rl is for the usual case. The `l' flag > is bogus since it was documented as accepted but not used. Now it > seems to be undocumented, but still accepted but not used. The `r' > flag is normally wanted, but most places also want 'c' and possibly > 'u'. >=20 > Having anything in the default ARFLAGS is bad since (except in the > %POSIX case) its contents is undocumented so it is hard to tell what > precautions should be taken to avoid bad things in it. There seems > to be no way to cancel bad things in it by adding to it, so makefiles > wanting to use the default would have to use something like > substitutions in it. E.g.: >=20 > %%% > ARFLAGS:=3D ${ARFLAGS:S/l//} # remove nonsense flag 'l' > ARFLAGS:=3D ${ARFLAGS:S/D//} # remove unwanted flag 'v' > foo: > echo ${ARFLAGS} > %%% >=20 > But it is easier to blow away the garbage using ARFLAGS=3Dcru. There = were > few or no flags like -D that could reasonably set outside of sys.mk, > according to user or system preferences, so that no Makefile should = touch > them. Perhaps -v is another one -- setting this wouldn't change the > created archives, but might be useful for debugging. >=20 > The primary user of ${AR} for FreeBSD builds, namely bsd.lib.mk, = doesn't > even use ${ARFLAGS}, so it is missing from the above list. It uses = the > literal `cq' whenever it uses the non-literal ${AR}. Perhaps ar is = often > spelled `ar' too. I'm a real beginner here. As I read the manuals (GNU ar and BSD ar), the = only flags that really control archive contents on archive creation is = 'q' and 'r'. The 'l' is ignored, 'c' and 'v' control verbosity, and 'u' = and 's' are for performance purposes that are largely irrelevant today = (extracting every single *.a file and recreating it wit ar -rD takes = less than 10 secs on my slow machine). Is there any negative impact at = runtime from having all archives created with either -rD or -qD = (ignoring verbosity at build time for now)? Thanks, Erik= --Apple-Mail-2031--846068754-- From owner-svn-src-all@FreeBSD.ORG Sun Oct 10 08:41:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A184910656C2; Sun, 10 Oct 2010 08:41:08 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85EF68FC1C; Sun, 10 Oct 2010 08:41:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9A8f87v075583; Sun, 10 Oct 2010 08:41:08 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9A8f8ZN075579; Sun, 10 Oct 2010 08:41:08 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201010100841.o9A8f8ZN075579@svn.freebsd.org> From: Martin Matuska Date: Sun, 10 Oct 2010 08:41:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213667 - in stable/8: lib/libarchive usr.bin/ar usr.bin/tar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 08:41:08 -0000 Author: mm Date: Sun Oct 10 08:41:08 2010 New Revision: 213667 URL: http://svn.freebsd.org/changeset/base/213667 Log: - Add liblzma support to libarchive and usr.bin/tar - Do not link usr.bin/ar to liblzma if building bootstrap-tools and the local system doesn't include liblzma (fixes world build on FreeBSD 7.x) This is a direct commit. Approved by: delphij (mentor) Modified: stable/8/lib/libarchive/Makefile stable/8/usr.bin/ar/Makefile stable/8/usr.bin/tar/Makefile Modified: stable/8/lib/libarchive/Makefile ============================================================================== --- stable/8/lib/libarchive/Makefile Sun Oct 10 07:28:56 2010 (r213666) +++ stable/8/lib/libarchive/Makefile Sun Oct 10 08:41:08 2010 (r213667) @@ -2,8 +2,16 @@ .include LIB= archive -DPADD= ${LIBBZ2} ${LIBZ} ${LIBMD} -LDADD= -lbz2 -lz -lmd +DPADD= ${LIBZ} ${LIBMD} +LDADD= -lz -lmd + +DPADD+= ${LIBBZ2} +LDADD+= -lbz2 +CFLAGS+= -DHAVE_BZLIB_H=1 + +DPADD+= ${LIBLZMA} +LDADD+= -llzma +CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 # FreeBSD SHLIB_MAJOR value is managed as part of the FreeBSD system. # It has no real relation to the libarchive version number. @@ -11,10 +19,6 @@ SHLIB_MAJOR= 5 CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" CFLAGS+= -I${.OBJDIR} -#Uncomment to build with full lzma/xz support via liblzma -#liblzma is not (yet?) part of the FreeBSD base system -#CFLAGS+= -I/usr/local/include -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 -#LDADD+= -L/usr/local/lib -llzma .if ${MK_OPENSSL} != "no" CFLAGS+= -DWITH_OPENSSL Modified: stable/8/usr.bin/ar/Makefile ============================================================================== --- stable/8/usr.bin/ar/Makefile Sun Oct 10 07:28:56 2010 (r213666) +++ stable/8/usr.bin/ar/Makefile Sun Oct 10 08:41:08 2010 (r213667) @@ -8,6 +8,13 @@ WARNS?= 5 DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBELF} LDADD= -larchive -lbz2 -lz -lelf +# Do not depend on liblzma if we are building the bootstrap-tools and +# the local system doesn't include liblzma +.if !defined(BOOTSTRAPPING) || ${BOOTSTRAPPING} >= 800505 +DPADD+= ${LIBLZMA} +LDADD+= -llzma +.endif + CFLAGS+=-I. -I${.CURDIR} NO_SHARED?= yes Modified: stable/8/usr.bin/tar/Makefile ============================================================================== --- stable/8/usr.bin/tar/Makefile Sun Oct 10 07:28:56 2010 (r213666) +++ stable/8/usr.bin/tar/Makefile Sun Oct 10 08:41:08 2010 (r213667) @@ -5,13 +5,14 @@ PROG= bsdtar BSDTAR_VERSION_STRING=2.7.0 SRCS= bsdtar.c cmdline.c getdate.c matching.c read.c siginfo.c subst.c tree.c util.c write.c WARNS?= 5 -DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} -LDADD= -larchive -lbz2 -lz -lmd +DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBLZMA} +LDADD= -larchive -lbz2 -lz -lmd -llzma .if ${MK_OPENSSL} != "no" LDADD+= -lcrypto .endif CFLAGS+= -DBSDTAR_VERSION_STRING=\"${BSDTAR_VERSION_STRING}\" CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" +CFLAGS+= -DHAVE_LIBLZMA CFLAGS+= -I${.CURDIR} SYMLINKS= bsdtar ${BINDIR}/tar MLINKS= bsdtar.1 tar.1 From owner-svn-src-all@FreeBSD.ORG Sun Oct 10 08:55:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D09DD1065670; Sun, 10 Oct 2010 08:55:20 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 367ED8FC16; Sun, 10 Oct 2010 08:55:19 +0000 (UTC) Received: by qwe4 with SMTP id 4so934938qwe.13 for ; Sun, 10 Oct 2010 01:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=1juHwl7JvdUcGTCCDWxVXdHsYH9qvQ6LDyJFISLT+yA=; b=EiQpTySXFTCiA5e+LTwOgJlUuIu/KdoENK8KhfMJHpzyqQVJKzIFgdoQvsZVLYziwZ 8GVTDlCJGooaif33Cy70pPDmtccZP4vdNy8MI/8SBmBqcBnNg285JuUdIinx9p5PGe4a YfnFySZfh9IWeaNwMFbNBR0/swiUD0NZWRuVo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=apkPnYfs/OQWiXbcbIjCayMwx/2OvkLf+1fI5yTXpZau1eKo7VDe1LjxjHKQ5ItyRz MgrEL3OT4fyOzI3/LkgW+Ev2gwFQWxMgwRR1wha1OoEf9SflOe7cuXHU7D9rLkZJ1Gl4 xp8QHzU2nEl+MhVLFL/+rXdV3pu40D6tj9KBo= Received: by 10.229.89.75 with SMTP id d11mr3944821qcm.32.1286700918758; Sun, 10 Oct 2010 01:55:18 -0700 (PDT) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.229.234.81 with HTTP; Sun, 10 Oct 2010 01:54:37 -0700 (PDT) In-Reply-To: <201010092020.o99KKSYW051470@svn.freebsd.org> References: <201010092020.o99KKSYW051470@svn.freebsd.org> From: Ivan Voras Date: Sun, 10 Oct 2010 10:54:37 +0200 X-Google-Sender-Auth: hYnKx8ESwepYZ3GRfhB5z7KJSTc Message-ID: To: "Andrey V. Elsukov" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213662 - in head: sbin/geom/class/concat sbin/geom/class/eli sbin/geom/class/journal sbin/geom/class/mirror sbin/geom/class/part sbin/geom/class/raid3 sbin/geom/class/shsec sbin/geom/c... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 08:55:20 -0000 On 9 October 2010 22:20, Andrey V. Elsukov wrote: > Author: ae > Date: Sat Oct =C2=A09 20:20:27 2010 > New Revision: 213662 > URL: http://svn.freebsd.org/changeset/base/213662 > > Log: > =C2=A0Replace strlen(_PATH_DEV) with sizeof(_PATH_DEV) - 1. Um, this looks like a pointless change and for the worse; Even at -O1 the compiler will reduce strlen(constant) to just its result and for code like printf("%d\n", sizeof("1234567")) produce code like: movl $7, %esi movl $.LC0, %edi movl $0, %eax call printf And (though tastes differ) I think the sizeof() variant is less readable. The strlen(_PATH_something) idiom is common in other parts of the kernel outside GEOM. In short - why was this done? From owner-svn-src-all@FreeBSD.ORG Sun Oct 10 09:24:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A7C41065672; Sun, 10 Oct 2010 09:24:19 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6967E8FC12; Sun, 10 Oct 2010 09:24:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9A9OJqI076511; Sun, 10 Oct 2010 09:24:19 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9A9OJ6K076509; Sun, 10 Oct 2010 09:24:19 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201010100924.o9A9OJ6K076509@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 10 Oct 2010 09:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213668 - head/sbin/mksnap_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 09:24:19 -0000 Author: jh Date: Sun Oct 10 09:24:19 2010 New Revision: 213668 URL: http://svn.freebsd.org/changeset/base/213668 Log: - Print the nmount(2) provided error message only when it is set. - Ensure that the error message is NUL-terminated before printing it. PR: bin/147482 MFC after: 2 weeks Modified: head/sbin/mksnap_ffs/mksnap_ffs.c Modified: head/sbin/mksnap_ffs/mksnap_ffs.c ============================================================================== --- head/sbin/mksnap_ffs/mksnap_ffs.c Sun Oct 10 08:41:08 2010 (r213667) +++ head/sbin/mksnap_ffs/mksnap_ffs.c Sun Oct 10 09:24:19 2010 (r213668) @@ -121,8 +121,12 @@ main(int argc, char **argv) build_iovec(&iov, &iovlen, "update", NULL, 0); build_iovec(&iov, &iovlen, "snapshot", NULL, 0); - if (nmount(iov, iovlen, stfsbuf.f_flags) < 0) - err(1, "Cannot create snapshot %s: %s", snapname, errmsg); + *errmsg = '\0'; + if (nmount(iov, iovlen, stfsbuf.f_flags) < 0) { + errmsg[sizeof(errmsg) - 1] = '\0'; + err(1, "Cannot create snapshot %s%s%s", snapname, + *errmsg != '\0' ? ": " : "", errmsg); + } if ((fd = open(snapname, O_RDONLY)) < 0) err(1, "Cannot open %s", snapname); if (fstat(fd, &stbuf) != 0) From owner-svn-src-all@FreeBSD.ORG Sun Oct 10 09:35:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2497C106564A; Sun, 10 Oct 2010 09:35:32 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id C5D3F8FC08; Sun, 10 Oct 2010 09:35:31 +0000 (UTC) Received: from outgoing.leidinger.net (p5B32FD81.dip.t-dialin.net [91.50.253.129]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 97CED84400C; Sun, 10 Oct 2010 11:35:28 +0200 (CEST) Received: from unknown (IO.Leidinger.net [192.168.2.110]) by outgoing.leidinger.net (Postfix) with ESMTP id 9604A1C61; Sun, 10 Oct 2010 11:35:25 +0200 (CEST) Date: Sun, 10 Oct 2010 11:35:24 +0200 From: Alexander Leidinger To: Mark Murray Message-ID: <20101010113524.00004725@unknown> In-Reply-To: <201010081742.o98HgAbO001604@svn.freebsd.org> References: <201010081742.o98HgAbO001604@svn.freebsd.org> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 97CED84400C.A6E49 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-0.923, required 6, autolearn=disabled, ALL_TRUSTED -1.00, TW_SV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1287308129.72048@deByo8jcouWD+KrPqrxNwQ X-EBL-Spam-Status: No Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213585 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 09:35:32 -0000 On Fri, 8 Oct 2010 17:42:10 +0000 (UTC) Mark Murray wrote: > Author: markm > Date: Fri Oct 8 17:42:09 2010 > New Revision: 213585 > URL: http://svn.freebsd.org/changeset/base/213585 > > Log: > Don't blow away /bin/rmail symlink if we are keeping mailwrapper. > Mailwrapper can provide a perfectly good rmail with other > mailers. Can you please point out where rmail is installed when MK_SENDMAIL=no and MK_MAILWRAPPER!=no? I can not find such a place. If not: your commit is wrong, it either 1) misses to add this functionality to build-/installworld or 2) needs to be reverted if you do not want to do 2), as the goal for delete-old is to remove files which are not not installed by installworld now, but where installed by installworld before. Bye, Alexander. From owner-svn-src-all@FreeBSD.ORG Sun Oct 10 10:25:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AACC1065670 for ; Sun, 10 Oct 2010 10:25:08 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (unknown [IPv6:2001:ba8:0:1d5:216:d4ff:fe0d:d845]) by mx1.freebsd.org (Postfix) with ESMTP id 1F26E8FC1D for ; Sun, 10 Oct 2010 10:25:08 +0000 (UTC) Received: from uucp by gromit.grondar.org with UUCP (Exim 4.72) (envelope-from ) id 1P4t5W-0005Or-NI for svn-src-all@freebsd.org; Sun, 10 Oct 2010 11:25:06 +0100 Received: from localhost ([127.0.0.1] helo=groundzero.grondar.org) by groundzero.grondar.org with esmtp (Exim 4.72 (FreeBSD)) (envelope-from ) id 1P4t0x-0000h4-WA; Sun, 10 Oct 2010 11:20:23 +0100 Message-Id: To: Alexander Leidinger In-reply-to: <20101010113524.00004725@unknown> References: <201010081742.o98HgAbO001604@svn.freebsd.org> <20101010113524.00004725@unknown> From: Mark Murray Date: Sun, 10 Oct 2010 11:20:23 +0100 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213585 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 10:25:08 -0000 Alexander Leidinger writes: > Can you please point out where rmail is installed when MK_SENDMAIL=no > and MK_MAILWRAPPER!=no? I can not find such a place. src/usr.sbin/mailwrapper/Makefile M -- Mark R V Murray Cert APS(Open) Dip Phys(Open) BSc Open(Open) BSc(Hons)(Open) Pi: 132511160 From owner-svn-src-all@FreeBSD.ORG Sun Oct 10 12:18:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F4461065674; Sun, 10 Oct 2010 12:18:53 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DE928FC1A; Sun, 10 Oct 2010 12:18:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ACIrNZ082301; Sun, 10 Oct 2010 12:18:53 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ACIrl7082298; Sun, 10 Oct 2010 12:18:53 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201010101218.o9ACIrl7082298@svn.freebsd.org> From: Martin Matuska Date: Sun, 10 Oct 2010 12:18: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: r213669 - stable/8/usr.bin/tar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 12:18:53 -0000 Author: mm Date: Sun Oct 10 12:18:53 2010 New Revision: 213669 URL: http://svn.freebsd.org/changeset/base/213669 Log: Move HAVE_LIBLZMA from Makefile to config_freebsd.h Approved by: delphij (mentor) Modified: stable/8/usr.bin/tar/Makefile stable/8/usr.bin/tar/config_freebsd.h Modified: stable/8/usr.bin/tar/Makefile ============================================================================== --- stable/8/usr.bin/tar/Makefile Sun Oct 10 09:24:19 2010 (r213668) +++ stable/8/usr.bin/tar/Makefile Sun Oct 10 12:18:53 2010 (r213669) @@ -12,7 +12,6 @@ LDADD+= -lcrypto .endif CFLAGS+= -DBSDTAR_VERSION_STRING=\"${BSDTAR_VERSION_STRING}\" CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" -CFLAGS+= -DHAVE_LIBLZMA CFLAGS+= -I${.CURDIR} SYMLINKS= bsdtar ${BINDIR}/tar MLINKS= bsdtar.1 tar.1 Modified: stable/8/usr.bin/tar/config_freebsd.h ============================================================================== --- stable/8/usr.bin/tar/config_freebsd.h Sun Oct 10 09:24:19 2010 (r213668) +++ stable/8/usr.bin/tar/config_freebsd.h Sun Oct 10 12:18:53 2010 (r213669) @@ -61,6 +61,9 @@ #define HAVE_LIBARCHIVE 1 #define HAVE_LIBBZ2 1 #define HAVE_LIBZ 1 +#if __FreeBSD_version >= 800505 /* liblzma introduced */ +#define HAVE_LIBLZMA 1 +#endif #define HAVE_LIMITS_H 1 #undef HAVE_LINUX_EXT2_FS_H #undef HAVE_LINUX_FS_H From owner-svn-src-all@FreeBSD.ORG Sun Oct 10 12:20:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3611E10656BC; Sun, 10 Oct 2010 12:20:05 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A8208FC18; Sun, 10 Oct 2010 12:20:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ACK4LB082373; Sun, 10 Oct 2010 12:20:05 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ACK4xg082371; Sun, 10 Oct 2010 12:20:04 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201010101220.o9ACK4xg082371@svn.freebsd.org> From: Kai Wang Date: Sun, 10 Oct 2010 12:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213670 - stable/8/lib/libelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 12:20:05 -0000 Author: kaiw Date: Sun Oct 10 12:20:04 2010 New Revision: 213670 URL: http://svn.freebsd.org/changeset/base/213670 Log: MFC r212373: libelf is overly strict about the type and alignment of Elf_Data objects inside one ELF section, which prevents the creation of a ELF section with mixed data types. For example, gcc LTO use libelf to create a .gnu_lto_XXX section that contains integers and a string table, which doesn't work with our libelf implementation. The changes made in this commit include: * Allow Elf_Data type to be different than section type. * Relax Elf_Data alignment check. * Align each Elf_Data by their own alignment instead of section alignment. Modified: stable/8/lib/libelf/elf_update.c Directory Properties: stable/8/lib/libelf/ (props changed) Modified: stable/8/lib/libelf/elf_update.c ============================================================================== --- stable/8/lib/libelf/elf_update.c Sun Oct 10 12:18:53 2010 (r213669) +++ stable/8/lib/libelf/elf_update.c Sun Oct 10 12:20:04 2010 (r213670) @@ -141,7 +141,7 @@ _libelf_compute_section_extents(Elf *e, /* Compute the section alignment. */ STAILQ_FOREACH(d, &s->s_data, d_next) { - if (d->d_type != elftype) { + if (d->d_type > ELF_T_LAST) { LIBELF_SET_ERROR(DATA, 0); return (0); } @@ -149,11 +149,7 @@ _libelf_compute_section_extents(Elf *e, LIBELF_SET_ERROR(VERSION, 0); return (0); } - if ((d_align = d->d_align) % sh_align) { - LIBELF_SET_ERROR(LAYOUT, 0); - return (0); - } - if (d_align == 0 || (d_align & (d_align - 1))) { + if ((d_align = d->d_align) == 0 || (d_align & (d_align - 1))) { LIBELF_SET_ERROR(DATA, 0); return (0); } @@ -168,7 +164,7 @@ _libelf_compute_section_extents(Elf *e, if ((uint64_t) d->d_off + d->d_size > scn_size) scn_size = d->d_off + d->d_size; } else { - scn_size = roundup2(scn_size, scn_alignment); + scn_size = roundup2(scn_size, d->d_align); d->d_off = scn_size; scn_size += d->d_size; } @@ -560,8 +556,6 @@ _libelf_write_scn(Elf *e, char *nf, Elf_ elftype = _libelf_xlate_shtype(sh_type); assert(elftype >= ELF_T_FIRST && elftype <= ELF_T_LAST); - msz = _libelf_msize(elftype, ec, e->e_version); - sh_off = s->s_offset; assert(sh_off % _libelf_falign(elftype, ec) == 0); @@ -608,6 +602,8 @@ _libelf_write_scn(Elf *e, char *nf, Elf_ STAILQ_FOREACH(d, &s->s_data, d_next) { + msz = _libelf_msize(d->d_type, ec, e->e_version); + if ((uint64_t) rc < sh_off + d->d_off) (void) memset(nf + rc, LIBELF_PRIVATE(fillchar), sh_off + d->d_off - rc); @@ -615,13 +611,12 @@ _libelf_write_scn(Elf *e, char *nf, Elf_ rc = sh_off + d->d_off; assert(d->d_buf != NULL); - assert(d->d_type == (Elf_Type) elftype); assert(d->d_version == e->e_version); assert(d->d_size % msz == 0); nobjects = d->d_size / msz; - fsz = _libelf_fsize(elftype, ec, e->e_version, nobjects); + fsz = _libelf_fsize(d->d_type, ec, e->e_version, nobjects); dst.d_buf = nf + rc; dst.d_size = fsz; From owner-svn-src-all@FreeBSD.ORG Sun Oct 10 12:21:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5547D1065672; Sun, 10 Oct 2010 12:21:36 +0000 (UTC) (envelope-from kaiw@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35ED28FC08; Sun, 10 Oct 2010 12:21:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ACLa7Q082449; Sun, 10 Oct 2010 12:21:36 GMT (envelope-from kaiw@svn.freebsd.org) Received: (from kaiw@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ACLaDS082447; Sun, 10 Oct 2010 12:21:36 GMT (envelope-from kaiw@svn.freebsd.org) Message-Id: <201010101221.o9ACLaDS082447@svn.freebsd.org> From: Kai Wang Date: Sun, 10 Oct 2010 12:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213671 - stable/7/lib/libelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 12:21:36 -0000 Author: kaiw Date: Sun Oct 10 12:21:35 2010 New Revision: 213671 URL: http://svn.freebsd.org/changeset/base/213671 Log: MFC r212373: libelf is overly strict about the type and alignment of Elf_Data objects inside one ELF section, which prevents the creation of a ELF section with mixed data types. For example, gcc LTO use libelf to create a .gnu_lto_XXX section that contains integers and a string table, which doesn't work with our libelf implementation. The changes made in this commit include: * Allow Elf_Data type to be different than section type. * Relax Elf_Data alignment check. * Align each Elf_Data by their own alignment instead of section alignment. Modified: stable/7/lib/libelf/elf_update.c Directory Properties: stable/7/lib/libelf/ (props changed) Modified: stable/7/lib/libelf/elf_update.c ============================================================================== --- stable/7/lib/libelf/elf_update.c Sun Oct 10 12:20:04 2010 (r213670) +++ stable/7/lib/libelf/elf_update.c Sun Oct 10 12:21:35 2010 (r213671) @@ -141,7 +141,7 @@ _libelf_compute_section_extents(Elf *e, /* Compute the section alignment. */ STAILQ_FOREACH(d, &s->s_data, d_next) { - if (d->d_type != elftype) { + if (d->d_type > ELF_T_LAST) { LIBELF_SET_ERROR(DATA, 0); return (0); } @@ -149,11 +149,7 @@ _libelf_compute_section_extents(Elf *e, LIBELF_SET_ERROR(VERSION, 0); return (0); } - if ((d_align = d->d_align) % sh_align) { - LIBELF_SET_ERROR(LAYOUT, 0); - return (0); - } - if (d_align == 0 || (d_align & (d_align - 1))) { + if ((d_align = d->d_align) == 0 || (d_align & (d_align - 1))) { LIBELF_SET_ERROR(DATA, 0); return (0); } @@ -168,7 +164,7 @@ _libelf_compute_section_extents(Elf *e, if ((uint64_t) d->d_off + d->d_size > scn_size) scn_size = d->d_off + d->d_size; } else { - scn_size = roundup2(scn_size, scn_alignment); + scn_size = roundup2(scn_size, d->d_align); d->d_off = scn_size; scn_size += d->d_size; } @@ -560,8 +556,6 @@ _libelf_write_scn(Elf *e, char *nf, Elf_ elftype = _libelf_xlate_shtype(sh_type); assert(elftype >= ELF_T_FIRST && elftype <= ELF_T_LAST); - msz = _libelf_msize(elftype, ec, e->e_version); - sh_off = s->s_offset; assert(sh_off % _libelf_falign(elftype, ec) == 0); @@ -608,6 +602,8 @@ _libelf_write_scn(Elf *e, char *nf, Elf_ STAILQ_FOREACH(d, &s->s_data, d_next) { + msz = _libelf_msize(d->d_type, ec, e->e_version); + if ((uint64_t) rc < sh_off + d->d_off) (void) memset(nf + rc, LIBELF_PRIVATE(fillchar), sh_off + d->d_off - rc); @@ -615,13 +611,12 @@ _libelf_write_scn(Elf *e, char *nf, Elf_ rc = sh_off + d->d_off; assert(d->d_buf != NULL); - assert(d->d_type == (Elf_Type) elftype); assert(d->d_version == e->e_version); assert(d->d_size % msz == 0); nobjects = d->d_size / msz; - fsz = _libelf_fsize(elftype, ec, e->e_version, nobjects); + fsz = _libelf_fsize(d->d_type, ec, e->e_version, nobjects); dst.d_buf = nf + rc; dst.d_size = fsz; From owner-svn-src-all@FreeBSD.ORG Sun Oct 10 20:37:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEA2D1065674; Sun, 10 Oct 2010 20:37:38 +0000 (UTC) (envelope-from randi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDA4E8FC0C; Sun, 10 Oct 2010 20:37:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9AKbcL8092504; Sun, 10 Oct 2010 20:37:38 GMT (envelope-from randi@svn.freebsd.org) Received: (from randi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9AKbcFG092501; Sun, 10 Oct 2010 20:37:38 GMT (envelope-from randi@svn.freebsd.org) Message-Id: <201010102037.o9AKbcFG092501@svn.freebsd.org> From: Randi Harper Date: Sun, 10 Oct 2010 20:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213672 - in head/usr.sbin: mfiutil mptutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 20:37:38 -0000 Author: randi Date: Sun Oct 10 20:37:38 2010 New Revision: 213672 URL: http://svn.freebsd.org/changeset/base/213672 Log: Report subcommand handler errors in mfiutil/mptutil so that tools that invoke the utilities can robustly report errors. Submitted by: gcooper Reviewed by: jhb Approved by: cperciva (mentor) MFC after: 1 week Modified: head/usr.sbin/mfiutil/mfiutil.c head/usr.sbin/mptutil/mptutil.c Modified: head/usr.sbin/mfiutil/mfiutil.c ============================================================================== --- head/usr.sbin/mfiutil/mfiutil.c Sun Oct 10 12:21:35 2010 (r213671) +++ head/usr.sbin/mfiutil/mfiutil.c Sun Oct 10 20:37:38 2010 (r213672) @@ -125,10 +125,12 @@ main(int ac, char **av) SET_FOREACH(cmd, MFI_DATASET(top)) { if (strcmp((*cmd)->name, av[0]) == 0) { - (*cmd)->handler(ac, av); - return (0); + if ((*cmd)->handler(ac, av)) + return (1); + else + return (0); } } warnx("Unknown command %s.", av[0]); - return (0); + return (1); } Modified: head/usr.sbin/mptutil/mptutil.c ============================================================================== --- head/usr.sbin/mptutil/mptutil.c Sun Oct 10 12:21:35 2010 (r213671) +++ head/usr.sbin/mptutil/mptutil.c Sun Oct 10 20:37:38 2010 (r213672) @@ -114,10 +114,12 @@ main(int ac, char **av) SET_FOREACH(cmd, MPT_DATASET(top)) { if (strcmp((*cmd)->name, av[0]) == 0) { - (*cmd)->handler(ac, av); - return (0); + if ((*cmd)->handler(ac, av)) + return (1); + else + return (0); } } warnx("Unknown command %s.", av[0]); - return (0); + return (1); } From owner-svn-src-all@FreeBSD.ORG Sun Oct 10 20:49:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9EA4106564A; Sun, 10 Oct 2010 20:49:33 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E6BD8FC14; Sun, 10 Oct 2010 20:49:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9AKnXKZ092777; Sun, 10 Oct 2010 20:49:33 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9AKnXZU092775; Sun, 10 Oct 2010 20:49:33 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010102049.o9AKnXZU092775@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 10 Oct 2010 20:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213673 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 20:49:33 -0000 Author: pjd Date: Sun Oct 10 20:49:33 2010 New Revision: 213673 URL: http://svn.freebsd.org/changeset/base/213673 Log: Provide internal ioflags() function that converts ioflag provided by FreeBSD's VFS to OpenSolaris-specific ioflag expected by ZFS. Use it for read and write operations. Reviewed by: mm MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Oct 10 20:37:38 2010 (r213672) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Oct 10 20:49:33 2010 (r213673) @@ -705,7 +705,7 @@ zfs_prefault_write(ssize_t n, struct uio * IN: vp - vnode of file to be written to. * uio - structure supplying write location, range info, * and data buffer. - * ioflag - IO_APPEND flag set if in append mode. + * ioflag - FAPPEND flag set if in append mode. * cr - credentials of caller. * ct - caller context (NFS/CIFS fem monitor only) * @@ -755,7 +755,7 @@ zfs_write(vnode_t *vp, uio_t *uio, int i */ pflags = zp->z_phys->zp_flags; if ((pflags & (ZFS_IMMUTABLE | ZFS_READONLY)) || - ((pflags & ZFS_APPENDONLY) && !(ioflag & IO_APPEND) && + ((pflags & ZFS_APPENDONLY) && !(ioflag & FAPPEND) && (uio->uio_loffset < zp->z_phys->zp_size))) { ZFS_EXIT(zfsvfs); return (EPERM); @@ -772,7 +772,7 @@ zfs_write(vnode_t *vp, uio_t *uio, int i /* * If in append mode, set the io offset pointer to eof. */ - if (ioflag & IO_APPEND) { + if (ioflag & FAPPEND) { /* * Range lock for a file append: * The value for the start of range will be determined by @@ -4181,6 +4181,21 @@ zfs_setsecattr(vnode_t *vp, vsecattr_t * } static int +ioflags(int ioflags) +{ + int flags = 0; + + if (ioflags & IO_APPEND) + flags |= FAPPEND; + if (ioflags & IO_NDELAY) + flags |= FNONBLOCK; + if (ioflags & IO_SYNC) + flags |= (FSYNC | FDSYNC | FRSYNC); + + return (flags); +} + +static int zfs_freebsd_open(ap) struct vop_open_args /* { struct vnode *a_vp; @@ -4238,7 +4253,8 @@ zfs_freebsd_read(ap) } */ *ap; { - return (zfs_read(ap->a_vp, ap->a_uio, ap->a_ioflag, ap->a_cred, NULL)); + return (zfs_read(ap->a_vp, ap->a_uio, ioflags(ap->a_ioflag), + ap->a_cred, NULL)); } static int @@ -4254,7 +4270,8 @@ zfs_freebsd_write(ap) if (vn_rlimit_fsize(ap->a_vp, ap->a_uio, ap->a_uio->uio_td)) return (EFBIG); - return (zfs_write(ap->a_vp, ap->a_uio, ap->a_ioflag, ap->a_cred, NULL)); + return (zfs_write(ap->a_vp, ap->a_uio, ioflags(ap->a_ioflag), + ap->a_cred, NULL)); } static int From owner-svn-src-all@FreeBSD.ORG Sun Oct 10 20:54:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C8311065673; Sun, 10 Oct 2010 20:54:01 +0000 (UTC) (envelope-from randi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BEA98FC14; Sun, 10 Oct 2010 20:54:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9AKs1n0092895; Sun, 10 Oct 2010 20:54:01 GMT (envelope-from randi@svn.freebsd.org) Received: (from randi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9AKs1hO092893; Sun, 10 Oct 2010 20:54:01 GMT (envelope-from randi@svn.freebsd.org) Message-Id: <201010102054.o9AKs1hO092893@svn.freebsd.org> From: Randi Harper Date: Sun, 10 Oct 2010 20:54:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213674 - head/usr.sbin/mfiutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2010 20:54:01 -0000 Author: randi Date: Sun Oct 10 20:54:01 2010 New Revision: 213674 URL: http://svn.freebsd.org/changeset/base/213674 Log: Fix compile with -DDEBUG by using the correct mfi_pd_ref union definition in mfireg.h. Submitted by: gcooper Reviewed by: jhb Approved by: cperciva (mentor) MFC after: 1 week Modified: head/usr.sbin/mfiutil/mfi_config.c Modified: head/usr.sbin/mfiutil/mfi_config.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_config.c Sun Oct 10 20:49:33 2010 (r213673) +++ head/usr.sbin/mfiutil/mfi_config.c Sun Oct 10 20:54:01 2010 (r213674) @@ -1024,7 +1024,7 @@ dump_config(int fd, struct mfi_config_da ar->num_drives); printf(" size = %ju\n", (uintmax_t)ar->size); for (j = 0; j < ar->num_drives; j++) { - device_id = ar->pd[j].ref.device_id; + device_id = ar->pd[j].ref.v.device_id; if (device_id == 0xffff) printf(" drive MISSING\n"); else { @@ -1080,7 +1080,7 @@ dump_config(int fd, struct mfi_config_da sp = (struct mfi_spare *)p; printf(" %s spare %u ", sp->spare_type & MFI_SPARE_DEDICATED ? "dedicated" : - "global", sp->ref.device_id); + "global", sp->ref.v.device_id); printf("%s", mfi_pdstate(MFI_PD_STATE_HOT_SPARE)); printf(" backs:\n"); for (j = 0; j < sp->array_count; j++) From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 08:10:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B6011065673; Mon, 11 Oct 2010 08:10:12 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A4438FC1C; Mon, 11 Oct 2010 08:10:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9B8ACbA006876; Mon, 11 Oct 2010 08:10:12 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9B8AC5O006874; Mon, 11 Oct 2010 08:10:12 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010110810.o9B8AC5O006874@svn.freebsd.org> From: Rui Paulo Date: Mon, 11 Oct 2010 08:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213681 - head/contrib/llvm/tools/clang/lib/Analysis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 08:10:12 -0000 Author: rpaulo Date: Mon Oct 11 08:10:12 2010 New Revision: 213681 URL: http://svn.freebsd.org/changeset/base/213681 Log: Restore the support for the 'r' and the 'y' conversion specifiers, first added on r208987. These are undocumented but are part of printf(9). Modified: head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp Modified: head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp Mon Oct 11 01:05:42 2010 (r213680) +++ head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp Mon Oct 11 08:10:12 2010 (r213681) @@ -195,6 +195,8 @@ static PrintfSpecifierResult ParsePrintf case 'm': k = ConversionSpecifier::PrintErrno; break; // FreeBSD format extensions case 'b': if (FormatExtensions) k = ConversionSpecifier::bArg; break; /* check for int and then char * */ + case 'r': if (FormatExtensions) k = ConversionSpecifier::xArg; break; + case 'y': if (FormatExtensions) k = ConversionSpecifier::iArg; break; case 'D': if (FormatExtensions) k = ConversionSpecifier::DArg; break; /* check for u_char * pointer and a char * string */ } PrintfConversionSpecifier CS(conversionPosition, k); From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 08:28:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82A1A106564A; Mon, 11 Oct 2010 08:28:14 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 333E28FC0C; Mon, 11 Oct 2010 08:28:13 +0000 (UTC) Received: from outgoing.leidinger.net (p57B3B433.dip.t-dialin.net [87.179.180.51]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id D6EFB84401F; Mon, 11 Oct 2010 10:28:09 +0200 (CEST) Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102]) by outgoing.leidinger.net (Postfix) with ESMTP id A69571D25; Mon, 11 Oct 2010 10:28:06 +0200 (CEST) Received: (from www@localhost) by webmail.leidinger.net (8.14.4/8.13.8/Submit) id o9B8S1Mk026317; Mon, 11 Oct 2010 10:28:01 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Mon, 11 Oct 2010 10:28:01 +0200 Message-ID: <20101011102801.10542rdhqicnige8@webmail.leidinger.net> Date: Mon, 11 Oct 2010 10:28:01 +0200 From: Alexander Leidinger To: Mark Murray References: <201010081742.o98HgAbO001604@svn.freebsd.org> <20101010113524.00004725@unknown> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: D6EFB84401F.A7B73 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=1.428, required 6, autolearn=disabled, RDNS_NONE 1.27, TW_SV 0.08, TW_VN 0.08) X-EBL-MailScanner-SpamScore: s X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1287390490.56085@4WAm83K8Ii5a0lgl6FFqkA X-EBL-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r213585 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 08:28:14 -0000 Quoting Mark Murray (from Sun, 10 Oct 2010 11:20:23 +0100): > Alexander Leidinger writes: >> Can you please point out where rmail is installed when MK_SENDMAIL=no >> and MK_MAILWRAPPER!=no? I can not find such a place. > > src/usr.sbin/mailwrapper/Makefile What am I doing wrong? ---snip--- % grep rmail /usr/src/usr.sbin/mailwrapper % cd /usr/src/usr.sbin/mailwrapper % svnversion 213680 ---snip--- Bye, Alexander. > M > -- > Mark R V Murray > Cert APS(Open) Dip Phys(Open) BSc Open(Open) BSc(Hons)(Open) > Pi: 132511160 > > -- Whenever people agree with me I always feel I must be wrong. -- Oscar Wilde http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 08:29:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC7541065670; Mon, 11 Oct 2010 08:29:49 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 798E78FC18; Mon, 11 Oct 2010 08:29:49 +0000 (UTC) Received: from outgoing.leidinger.net (p57B3B433.dip.t-dialin.net [87.179.180.51]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id C139384401F; Mon, 11 Oct 2010 10:29:46 +0200 (CEST) Received: from webmail.leidinger.net (unknown [IPv6:fd73:10c7:2053:1::2:102]) by outgoing.leidinger.net (Postfix) with ESMTP id F3D501D26; Mon, 11 Oct 2010 10:29:43 +0200 (CEST) Received: (from www@localhost) by webmail.leidinger.net (8.14.4/8.13.8/Submit) id o9B8Thu8026654; Mon, 11 Oct 2010 10:29:43 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by webmail.leidinger.net (Horde Framework) with HTTP; Mon, 11 Oct 2010 10:29:43 +0200 Message-ID: <20101011102943.57005on1chxhv44k@webmail.leidinger.net> Date: Mon, 11 Oct 2010 10:29:43 +0200 From: Alexander Leidinger To: Alexander Leidinger References: <201010081742.o98HgAbO001604@svn.freebsd.org> <20101010113524.00004725@unknown> <20101011102801.10542rdhqicnige8@webmail.leidinger.net> In-Reply-To: <20101011102801.10542rdhqicnige8@webmail.leidinger.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4) X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: C139384401F.A8602 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=1.428, required 6, autolearn=disabled, RDNS_NONE 1.27, TW_SV 0.08, TW_VN 0.08) X-EBL-MailScanner-SpamScore: s X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1287390587.91006@/rbwANn+xpAFdzDgRaS63w X-EBL-Spam-Status: No Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Mark Murray Subject: Re: svn commit: r213585 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 08:29:49 -0000 Quoting Alexander Leidinger (from Mon, 11 Oct 2010 10:28:01 +0200): > Quoting Mark Murray (from Sun, 10 Oct 2010 > 11:20:23 +0100): > >> Alexander Leidinger writes: >>> Can you please point out where rmail is installed when MK_SENDMAIL=no >>> and MK_MAILWRAPPER!=no? I can not find such a place. >> >> src/usr.sbin/mailwrapper/Makefile > > What am I doing wrong? I did not do a correct copy&paste... put the result is the same. > ---snip--- > % grep rmail /usr/src/usr.sbin/mailwrapper % grep rmail /usr/src/usr.sbin/mailwrapper/Makefile Bye, Alexander. > > % cd /usr/src/usr.sbin/mailwrapper > > % svnversion > 213680 > ---snip--- > > Bye, > Alexander. > >> M >> -- >> Mark R V Murray >> Cert APS(Open) Dip Phys(Open) BSc Open(Open) BSc(Hons)(Open) >> Pi: 132511160 >> >> > > > > -- > Whenever people agree with me I always feel I must be wrong. > -- Oscar Wilde > > http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 > http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 > -- How's the wife? Is she at home enjoying capitalism? http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 09:27:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8970106566C; Mon, 11 Oct 2010 09:27:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D721C8FC17; Mon, 11 Oct 2010 09:27:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9B9RbfJ008470; Mon, 11 Oct 2010 09:27:37 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9B9Rbqc008467; Mon, 11 Oct 2010 09:27:37 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010110927.o9B9Rbqc008467@svn.freebsd.org> From: Andriy Gapon Date: Mon, 11 Oct 2010 09:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213682 - head/lib/libcam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 09:27:38 -0000 Author: avg Date: Mon Oct 11 09:27:37 2010 New Revision: 213682 URL: http://svn.freebsd.org/changeset/base/213682 Log: cam_get_device, cam_open_device: make behavior simpler and more deterministic Remove or re-work support for the several features from the past: - remove incomplete support for trimming slice/partition names - remove mapping from old device names "sd" and "st" - remove whitespace trimming - remove unconditional skipping of leading 'r' in a device name - skip leading 'n' or 'e' only if the following device name matches a list of known devices that support no-rewind and eject-on-close features; currently this is only sa(4) - reflect the above changes in comments in code and in cam(3) - remove a note cautioning against use of cam_get_device and cam_open_device in cam(3) Reviewed by: mjacob Modified: head/lib/libcam/cam.3 head/lib/libcam/camlib.c Modified: head/lib/libcam/cam.3 ============================================================================== --- head/lib/libcam/cam.3 Mon Oct 11 08:10:12 2010 (r213681) +++ head/lib/libcam/cam.3 Mon Oct 11 09:27:37 2010 (r213682) @@ -190,12 +190,6 @@ into a device name and unit number. Once the device name and unit number are determined, a lookup is performed to determine the passthrough device that corresponds to the given device. -.Fn cam_open_device -is rather simple to use, but it is not really suitable for general use -because its behavior is not necessarily deterministic. -Programmers writing -new applications should make the extra effort to use one of the other open -routines documented below. .Pp .Fn cam_open_spec_device opens the @@ -354,19 +348,15 @@ respectively. can handle strings of the following forms, at least: .Pp .Bl -tag -width 1234 -compact -.It /dev/foo0a -.It /dev/foo1s2c +.It /dev/foo1 .It foo0 -.It foo0a -.It nfoo0 +.It nsa2 .El .Pp .Fn cam_get_device is provided as a convenience function for applications that need to provide functionality similar to .Fn cam_open_device . -Programmers are encouraged to use more deterministic methods of obtaining -device names and unit numbers if possible. .Sh RETURN VALUES .Fn cam_open_device , .Fn cam_open_spec_device , Modified: head/lib/libcam/camlib.c ============================================================================== --- head/lib/libcam/camlib.c Mon Oct 11 08:10:12 2010 (r213681) +++ head/lib/libcam/camlib.c Mon Oct 11 09:27:37 2010 (r213682) @@ -42,14 +42,9 @@ __FBSDID("$FreeBSD$"); #include #include "camlib.h" -struct cam_devequiv { - char *given_dev; - char *real_dev; -}; -struct cam_devequiv devmatchtable[] = { - {"sd", "da"}, - {"st", "sa"} +static const char *nonrewind_devs[] = { + "sa" }; char cam_errbuf[CAM_ERRBUF_SIZE]; @@ -103,19 +98,14 @@ cam_freeccb(union ccb *ccb) /* * Take a device name or path passed in by the user, and attempt to figure * out the device name and unit number. Some possible device name formats are: - * /dev/foo0a - * /dev/rfoo0a - * /dev/rfoos2c + * /dev/foo0 * foo0 - * foo0a - * rfoo0 - * rfoo0a - * nrfoo0 - * - * If the caller passes in an old style device name like 'sd' or 'st', - * it will be converted to the new style device name based upon devmatchtable - * above. + * nfoo0 * + * Some peripheral drivers create separate device nodes with 'n' prefix for + * non-rewind operations. Currently only sa(4) tape driver has this feature. + * We extract pure peripheral name as device name for this special case. + * * Input parameters: device name/path, length of devname string * Output: device name, unit number * Return values: returns 0 for success, -1 for failure @@ -127,7 +117,7 @@ cam_get_device(const char *path, char *d char *tmpstr, *tmpstr2; char *newpath; int unit_offset; - int i, found = 0; + int i; if (path == NULL) { @@ -142,10 +132,6 @@ cam_get_device(const char *path, char *d newpath = (char *)strdup(path); tmpstr = newpath; - /* Get rid of any leading white space */ - while (isspace(*tmpstr) && (*tmpstr != '\0')) - tmpstr++; - /* * Check to see whether we have an absolute pathname. */ @@ -166,54 +152,15 @@ cam_get_device(const char *path, char *d * Check to see whether the user has given us a nonrewound tape * device. */ - if (*tmpstr == 'n') - tmpstr++; - - if (*tmpstr == '\0') { - sprintf(cam_errbuf, "%s: no text after leading 'n'", func_name); - free(newpath); - return(-1); - } - - /* - * See if the user has given us a character device. - */ - if (*tmpstr == 'r') - tmpstr++; - - if (*tmpstr == '\0') { - sprintf(cam_errbuf, "%s: no text after leading 'r'", func_name); - free(newpath); - return(-1); - } - - /* - * Try to get rid of any trailing white space or partition letters. - */ - tmpstr2 = &tmpstr[strlen(tmpstr) - 1]; - - while ((*tmpstr2 != '\0') && (tmpstr2 > tmpstr) &&(!isdigit(*tmpstr2))){ - *tmpstr2 = '\0'; - tmpstr2--; - } - - /* - * Check to see whether we have been given a partition with a slice - * name. If so, get rid of the slice name/number. - */ - if (strlen(tmpstr) > 3) { - /* - * Basically, we're looking for a string that ends in the - * following general manner: 1s1 -- a number, the letter - * s, and then another number. This indicates that the - * user has given us a slice. We substitute nulls for the - * s and the slice number. - */ - if ((isdigit(tmpstr[strlen(tmpstr) - 1])) - && (tmpstr[strlen(tmpstr) - 2] == 's') - && (isdigit(tmpstr[strlen(tmpstr) - 3]))) { - tmpstr[strlen(tmpstr) - 1] = '\0'; - tmpstr[strlen(tmpstr) - 1] = '\0'; + if (*tmpstr == 'n' || *tmpstr == 'e') { + for (i = 0; i < sizeof(nonrewind_devs)/sizeof(char *); i++) { + int len = strlen(nonrewind_devs[i]); + if (strncmp(tmpstr + 1, nonrewind_devs[i], len) == 0) { + if (isdigit(tmpstr[len + 1])) { + tmpstr++; + break; + } + } } } @@ -281,20 +228,7 @@ cam_get_device(const char *path, char *d */ tmpstr[strlen(tmpstr) - unit_offset] = '\0'; - /* - * Look through our equivalency table and see if the device name - * the user gave us is an old style device name. If so, translate - * it to the new style device name. - */ - for (i = 0;i < (sizeof(devmatchtable)/sizeof(struct cam_devequiv));i++){ - if (strcmp(tmpstr, devmatchtable[i].given_dev) == 0) { - strlcpy(dev_name,devmatchtable[i].real_dev, devnamelen); - found = 1; - break; - } - } - if (found == 0) - strlcpy(dev_name, tmpstr, devnamelen); + strlcpy(dev_name, tmpstr, devnamelen); /* Clean up allocated memory */ free(newpath); From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 09:34:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 733B7106564A; Mon, 11 Oct 2010 09:34:46 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60D218FC1B; Mon, 11 Oct 2010 09:34:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9B9Yki2008687; Mon, 11 Oct 2010 09:34:46 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9B9YkIY008683; Mon, 11 Oct 2010 09:34:46 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201010110934.o9B9YkIY008683@svn.freebsd.org> From: Martin Matuska Date: Mon, 11 Oct 2010 09:34: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: r213683 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 09:34:46 -0000 Author: mm Date: Mon Oct 11 09:34:46 2010 New Revision: 213683 URL: http://svn.freebsd.org/changeset/base/213683 Log: MFC r210470: Import two changesets from OpenSolaris to make future updates easier. The changes do not affect FreeBSD code because zfs_znode_move(), cleanlocks() and cleanshares() are not used. OpenSolaris onnv changeset: 9788:f660bc44f2e8, 9909:aa280f585a3e Approved by: pjd, delphij (mentor) Obtained from: OpenSolaris (Bug ID 6843700, 6790232) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Oct 11 09:27:37 2010 (r213682) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Oct 11 09:34:46 2010 (r213683) @@ -955,11 +955,22 @@ zfsvfs_setup(zfsvfs_t *zfsvfs, boolean_t return (0); } +extern krwlock_t zfsvfs_lock; /* in zfs_znode.c */ + void zfsvfs_free(zfsvfs_t *zfsvfs) { int i; + /* + * This is a barrier to prevent the filesystem from going away in + * zfs_znode_move() until we can safely ensure that the filesystem is + * not unmounted. We consider the filesystem valid before the barrier + * and invalid after the barrier. + */ + rw_enter(&zfsvfs_lock, RW_READER); + rw_exit(&zfsvfs_lock); + zfs_fuid_destroy(zfsvfs); mutex_destroy(&zfsvfs->z_znodes_lock); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Oct 11 09:27:37 2010 (r213682) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Oct 11 09:34:46 2010 (r213683) @@ -200,6 +200,12 @@ zfs_close(vnode_t *vp, int flag, int cou znode_t *zp = VTOZ(vp); zfsvfs_t *zfsvfs = zp->z_zfsvfs; + /* + * Clean up any locks held by this process on the vp. + */ + cleanlocks(vp, ddi_get_pid(), 0); + cleanshares(vp, ddi_get_pid()); + ZFS_ENTER(zfsvfs); ZFS_VERIFY_ZP(zp); @@ -207,12 +213,6 @@ zfs_close(vnode_t *vp, int flag, int cou if ((flag & (FSYNC | FDSYNC)) && (count == 1)) atomic_dec_32(&zp->z_sync_cnt); - /* - * Clean up any locks held by this process on the vp. - */ - cleanlocks(vp, ddi_get_pid(), 0); - cleanshares(vp, ddi_get_pid()); - if (!zfs_has_ctldir(zp) && zp->z_zfsvfs->z_vscan && ZTOV(zp)->v_type == VREG && !(zp->z_phys->zp_flags & ZFS_AV_QUARANTINED) && Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Oct 11 09:27:37 2010 (r213682) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Oct 11 09:34:46 2010 (r213683) @@ -87,6 +87,12 @@ SYSCTL_INT(_debug_sizeof, OID_AUTO, znod * (such as VFS logic) that will not compile easily in userland. */ #ifdef _KERNEL +/* + * Needed to close a small window in zfs_znode_move() that allows the zfsvfs to + * be freed before it can be safely accessed. + */ +krwlock_t zfsvfs_lock; + static kmem_cache_t *znode_cache = NULL; /*ARGSUSED*/ @@ -200,8 +206,9 @@ zfs_znode_cache_destructor(void *buf, vo #ifdef ZNODE_STATS static struct { uint64_t zms_zfsvfs_invalid; + uint64_t zms_zfsvfs_recheck1; uint64_t zms_zfsvfs_unmounted; - uint64_t zms_zfsvfs_recheck_invalid; + uint64_t zms_zfsvfs_recheck2; uint64_t zms_obj_held; uint64_t zms_vnode_locked; uint64_t zms_not_only_dnlc; @@ -285,15 +292,32 @@ zfs_znode_move(void *buf, void *newbuf, } /* - * Ensure that the filesystem is not unmounted during the move. - * This is the equivalent to ZFS_ENTER(). + * Close a small window in which it's possible that the filesystem could + * be unmounted and freed, and zfsvfs, though valid in the previous + * statement, could point to unrelated memory by the time we try to + * prevent the filesystem from being unmounted. + */ + rw_enter(&zfsvfs_lock, RW_WRITER); + if (zfsvfs != ozp->z_zfsvfs) { + rw_exit(&zfsvfs_lock); + ZNODE_STAT_ADD(znode_move_stats.zms_zfsvfs_recheck1); + return (KMEM_CBRC_DONT_KNOW); + } + + /* + * If the znode is still valid, then so is the file system. We know that + * no valid file system can be freed while we hold zfsvfs_lock, so we + * can safely ensure that the filesystem is not and will not be + * unmounted. The next statement is equivalent to ZFS_ENTER(). */ rrw_enter(&zfsvfs->z_teardown_lock, RW_READER, FTAG); if (zfsvfs->z_unmounted) { ZFS_EXIT(zfsvfs); + rw_exit(&zfsvfs_lock); ZNODE_STAT_ADD(znode_move_stats.zms_zfsvfs_unmounted); return (KMEM_CBRC_DONT_KNOW); } + rw_exit(&zfsvfs_lock); mutex_enter(&zfsvfs->z_znodes_lock); /* @@ -303,7 +327,7 @@ zfs_znode_move(void *buf, void *newbuf, if (zfsvfs != ozp->z_zfsvfs) { mutex_exit(&zfsvfs->z_znodes_lock); ZFS_EXIT(zfsvfs); - ZNODE_STAT_ADD(znode_move_stats.zms_zfsvfs_recheck_invalid); + ZNODE_STAT_ADD(znode_move_stats.zms_zfsvfs_recheck2); return (KMEM_CBRC_DONT_KNOW); } @@ -360,6 +384,7 @@ zfs_znode_init(void) /* * Initialize zcache */ + rw_init(&zfsvfs_lock, NULL, RW_DEFAULT, NULL); ASSERT(znode_cache == NULL); znode_cache = kmem_cache_create("zfs_znode_cache", sizeof (znode_t), 0, /* zfs_znode_cache_constructor */ NULL, @@ -378,6 +403,7 @@ zfs_znode_fini(void) if (znode_cache) kmem_cache_destroy(znode_cache); znode_cache = NULL; + rw_destroy(&zfsvfs_lock); } int From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 09:39:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEFFD106566B; Mon, 11 Oct 2010 09:39:32 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC3928FC13; Mon, 11 Oct 2010 09:39:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9B9dWdc008827; Mon, 11 Oct 2010 09:39:32 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9B9dWFm008824; Mon, 11 Oct 2010 09:39:32 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201010110939.o9B9dWFm008824@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 11 Oct 2010 09:39: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: r213684 - in stable/8/sbin/geom/class: part sched X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 09:39:32 -0000 Author: ae Date: Mon Oct 11 09:39:32 2010 New Revision: 213684 URL: http://svn.freebsd.org/changeset/base/213684 Log: GPART's control interface between kernel and user space has been changed in r212614. Perform partial MFC of r213097 adapted to the stable ABI: Implement "force" (-F) option for gpart destroy verb. This option doesn't passed to kernel and handled in user-space. With -F option gpart creates new "delete" request for each partition in table. Each request has flags="X" that disables auto-commit feature. Last request is the original "destroy" request. It has own flags and can have disabled or enabled auto-commit feature. If error is occurred when deleting partitions, then new "undo" request is created and all changes will be rolled back. Approved by: kib (mentor) Modified: stable/8/sbin/geom/class/part/geom_part.c stable/8/sbin/geom/class/part/gpart.8 Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) Modified: stable/8/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/8/sbin/geom/class/part/geom_part.c Mon Oct 11 09:34:46 2010 (r213683) +++ stable/8/sbin/geom/class/part/geom_part.c Mon Oct 11 09:39:32 2010 (r213684) @@ -68,6 +68,7 @@ static char ssize[32]; static const char const bootcode_param[] = "bootcode"; static const char const index_param[] = "index"; static const char const partcode_param[] = "partcode"; +static const char const force_param[] = "force"; static struct gclass *find_class(struct gmesh *, const char *); static struct ggeom * find_geom(struct gclass *, const char *); @@ -84,6 +85,8 @@ static void gpart_show_geom(struct ggeom static int gpart_show_hasopt(struct gctl_req *, const char *, const char *); static void gpart_write_partcode(struct ggeom *, int, void *, ssize_t); static void gpart_write_partcode_vtoc8(struct ggeom *, int, void *); +static void gpart_destroy(struct gctl_req *, unsigned int); +static void gpart_print_error(const char *); struct g_command PUBSYM(class_commands)[] = { { "add", 0, gpart_issue, { @@ -118,7 +121,8 @@ struct g_command PUBSYM(class_commands)[ G_OPT_SENTINEL }, "geom", NULL }, - { "destroy", 0, gpart_issue, { + { "destroy", 0, gpart_destroy, { + { 'F', force_param, NULL, G_TYPE_BOOL }, { 'f', "flags", flags, G_TYPE_STRING }, G_OPT_SENTINEL }, "geom", NULL }, @@ -853,10 +857,101 @@ gpart_bootcode(struct gctl_req *req, uns } static void +gpart_destroy(struct gctl_req *req, unsigned int fl) +{ + struct gmesh mesh; + struct gclass *classp; + struct gctl_req *req2; + struct ggeom *gp; + struct gprovider *pp; + const char *s; + int error, val; + + if (gctl_has_param(req, force_param)) { + val = gctl_get_int(req, force_param); + error = gctl_delete_param(req, force_param); + if (error) + errc(EXIT_FAILURE, error, "internal error"); + if (val == 0) + goto done; + s = gctl_get_ascii(req, "class"); + if (s == NULL) + abort(); + error = geom_gettree(&mesh); + if (error != 0) + errc(EXIT_FAILURE, error, "Cannot get GEOM tree"); + classp = find_class(&mesh, s); + if (classp == NULL) { + geom_deletetree(&mesh); + errx(EXIT_FAILURE, "Class %s not found.", s); + } + s = gctl_get_ascii(req, "geom"); + if (s == NULL) + abort(); + gp = find_geom(classp, s); + if (gp == NULL) + errx(EXIT_FAILURE, "No such geom: %s.", s); + val = 0; + LIST_FOREACH(pp, &gp->lg_provider, lg_provider){ + s = find_provcfg(pp, "index"); + if (s == NULL) + errx(EXIT_FAILURE, "Index not found for %s.", + pp->lg_name); + req2 = gctl_get_handle(); + gctl_ro_param(req2, "class", -1, classp->lg_name); + gctl_ro_param(req2, "geom", -1, gp->lg_name); + gctl_ro_param(req2, "verb", -1, "delete"); + gctl_ro_param(req2, index_param, -1, s); + gctl_ro_param(req2, "flags", -1, "X"); + s = gctl_issue(req2); + if (s != NULL && s[0] != '\0') { + gpart_print_error(s); + gctl_free(req2); + if (val) { /* try to undo changes */ + req2 = gctl_get_handle(); + gctl_ro_param(req2, "verb", -1, + "undo"); + gctl_ro_param(req2, "class", -1, + classp->lg_name); + gctl_ro_param(req2, "geom", -1, + gp->lg_name); + gctl_issue(req2); + gctl_free(req2); + } + geom_deletetree(&mesh); + exit(EXIT_FAILURE); + } + gctl_free(req2); + val = 1; + } + geom_deletetree(&mesh); + } +done: + gpart_issue(req, fl); +} + +static void +gpart_print_error(const char *errstr) +{ + char *errmsg; + int error; + + error = strtol(errstr, &errmsg, 0); + if (errmsg != errstr) { + while (errmsg[0] == ' ') + errmsg++; + if (errmsg[0] != '\0') + warnc(error, "%s", errmsg); + else + warnc(error, NULL); + } else + warnx("%s", errmsg); +} + +static void gpart_issue(struct gctl_req *req, unsigned int fl __unused) { char buf[4096]; - char *errmsg; const char *errstr; int error, status; @@ -878,17 +973,7 @@ gpart_issue(struct gctl_req *req, unsign goto done; } - error = strtol(errstr, &errmsg, 0); - if (errmsg != errstr) { - while (errmsg[0] == ' ') - errmsg++; - if (errmsg[0] != '\0') - warnc(error, "%s", errmsg); - else - warnc(error, NULL); - } else - warnx("%s", errmsg); - + gpart_print_error(errstr); status = EXIT_FAILURE; done: Modified: stable/8/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/8/sbin/geom/class/part/gpart.8 Mon Oct 11 09:34:46 2010 (r213683) +++ stable/8/sbin/geom/class/part/gpart.8 Mon Oct 11 09:39:32 2010 (r213684) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 27, 2010 +.Dd Sep 24, 2010 .Dt GPART 8 .Os .Sh NAME @@ -118,6 +118,7 @@ utility: .\" ==== DESTROY ==== .Nm .Cm destroy +.Op Fl F .Op Fl f Ar flags .Ar geom .\" ==== MODIFY ==== @@ -317,6 +318,8 @@ Destroy the partitioning scheme as imple .Pp Additional options include: .Bl -tag -width 10n +.It Fl F +Forced destroying of the partition table even if it is not empty. .It Fl f Ar flags Additional operational flags. See the section entitled From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 09:41:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 999E91065674; Mon, 11 Oct 2010 09:41:24 +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 87B6F8FC1C; Mon, 11 Oct 2010 09:41:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9B9fOWH008900; Mon, 11 Oct 2010 09:41:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9B9fObF008898; Mon, 11 Oct 2010 09:41:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010110941.o9B9fObF008898@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 11 Oct 2010 09:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213685 - stable/8/sys/amd64/linux32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 09:41:24 -0000 Author: kib Date: Mon Oct 11 09:41:24 2010 New Revision: 213685 URL: http://svn.freebsd.org/changeset/base/213685 Log: MFC r213544: Fix typo. Modified: stable/8/sys/amd64/linux32/syscalls.master 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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/8/sys/amd64/linux32/syscalls.master Mon Oct 11 09:39:32 2010 (r213684) +++ stable/8/sys/amd64/linux32/syscalls.master Mon Oct 11 09:41:24 2010 (r213685) @@ -416,7 +416,7 @@ 245 AUE_NULL UNIMPL linux_io_setup 246 AUE_NULL UNIMPL linux_io_destroy 247 AUE_NULL UNIMPL linux_io_getevents -248 AUE_NULL UNIMPL inux_io_submit +248 AUE_NULL UNIMPL linux_io_submit 249 AUE_NULL UNIMPL linux_io_cancel 250 AUE_NULL STD { int linux_fadvise64(void); } 251 AUE_NULL UNIMPL From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 09:42:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 362CB106564A; Mon, 11 Oct 2010 09:42:31 +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 19C558FC21; Mon, 11 Oct 2010 09:42:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9B9gUwk008965; Mon, 11 Oct 2010 09:42:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9B9gUel008961; Mon, 11 Oct 2010 09:42:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010110942.o9B9gUel008961@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 11 Oct 2010 09:42:30 +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: r213686 - stable/8/sys/amd64/linux32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 09:42:31 -0000 Author: kib Date: Mon Oct 11 09:42:30 2010 New Revision: 213686 URL: http://svn.freebsd.org/changeset/base/213686 Log: Regen. Modified: stable/8/sys/amd64/linux32/linux32_proto.h stable/8/sys/amd64/linux32/linux32_syscall.h stable/8/sys/amd64/linux32/linux32_sysent.c Modified: stable/8/sys/amd64/linux32/linux32_proto.h ============================================================================== --- stable/8/sys/amd64/linux32/linux32_proto.h Mon Oct 11 09:41:24 2010 (r213685) +++ stable/8/sys/amd64/linux32/linux32_proto.h Mon Oct 11 09:42:30 2010 (r213686) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 185438 2008-11-29 14:55:24Z kib + * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 213685 2010-10-11 09:41:24Z kib */ #ifndef _LINUX_SYSPROTO_H_ @@ -1257,6 +1257,13 @@ int linux_vmsplice(struct thread *, stru #endif /* COMPAT_FREEBSD6 */ + +#ifdef COMPAT_FREEBSD7 + +#define nosys linux_nosys + +#endif /* COMPAT_FREEBSD7 */ + #define LINUX_SYS_AUE_linux_fork AUE_FORK #define LINUX_SYS_AUE_linux_open AUE_OPEN_RWTC #define LINUX_SYS_AUE_linux_waitpid AUE_WAIT4 Modified: stable/8/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- stable/8/sys/amd64/linux32/linux32_syscall.h Mon Oct 11 09:41:24 2010 (r213685) +++ stable/8/sys/amd64/linux32/linux32_syscall.h Mon Oct 11 09:42:30 2010 (r213686) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 185438 2008-11-29 14:55:24Z kib + * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 213685 2010-10-11 09:41:24Z kib */ #define LINUX_SYS_exit 1 Modified: stable/8/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- stable/8/sys/amd64/linux32/linux32_sysent.c Mon Oct 11 09:41:24 2010 (r213685) +++ stable/8/sys/amd64/linux32/linux32_sysent.c Mon Oct 11 09:42:30 2010 (r213686) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/amd64/linux32/syscalls.master 185438 2008-11-29 14:55:24Z kib + * created from FreeBSD: stable/8/sys/amd64/linux32/syscalls.master 213685 2010-10-11 09:41:24Z kib */ #include "opt_compat.h" @@ -267,7 +267,7 @@ struct sysent linux_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 245 = linux_io_setup */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 246 = linux_io_destroy */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 247 = linux_io_getevents */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 248 = inux_io_submit */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 248 = linux_io_submit */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 249 = linux_io_cancel */ { 0, (sy_call_t *)linux_fadvise64, AUE_NULL, NULL, 0, 0, 0 }, /* 250 = linux_fadvise64 */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0 }, /* 251 = */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 11:25:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF6A31065670; Mon, 11 Oct 2010 11:25:37 +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 A368C8FC15; Mon, 11 Oct 2010 11:25:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BBPbnv013634; Mon, 11 Oct 2010 11:25:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BBPbGd013631; Mon, 11 Oct 2010 11:25:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010111125.o9BBPbGd013631@svn.freebsd.org> From: Xin LI Date: Mon, 11 Oct 2010 11:25: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: r213687 - in stable: 7/sys/netinet 7/sys/netinet6 8/sys/netinet 8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 11:25:38 -0000 Author: delphij Date: Mon Oct 11 11:25:37 2010 New Revision: 213687 URL: http://svn.freebsd.org/changeset/base/213687 Log: MFC r213225: Add a bandaid for a long-standing race condition during route entry un-expiring. The previous version of code have no locking when testing rt_refcnt. The result of the lack of locking may result in a condition where a routing entry have a reference count but at the same time have RTPRF_OURS bit set and an expiration timer. These would eventually lead to a panic: panic: rtqkill route really not free When the system have ICMP redirects accepted from local gateway in a moderate frequency, for instance. Commit this workaround for now until we have some better solution. PR: kern/149804 Reviewed by: bz Tested by: Zhao Xin, Pete French Modified: stable/8/sys/netinet/in_rmx.c stable/8/sys/netinet6/in6_rmx.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) stable/8/sys/dev/xen/xenpci/ (props changed) Changes in other areas also in this revision: Modified: stable/7/sys/netinet/in_rmx.c stable/7/sys/netinet6/in6_rmx.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet/in_rmx.c ============================================================================== --- stable/8/sys/netinet/in_rmx.c Mon Oct 11 09:42:30 2010 (r213686) +++ stable/8/sys/netinet/in_rmx.c Mon Oct 11 11:25:37 2010 (r213687) @@ -121,12 +121,13 @@ in_matroute(void *v_arg, struct radix_no struct radix_node *rn = rn_match(v_arg, head); struct rtentry *rt = (struct rtentry *)rn; - /*XXX locking? */ - if (rt && rt->rt_refcnt == 0) { /* this is first reference */ + if (rt) { + RT_LOCK(rt); if (rt->rt_flags & RTPRF_OURS) { rt->rt_flags &= ~RTPRF_OURS; rt->rt_rmx.rmx_expire = 0; } + RT_UNLOCK(rt); } return rn; } Modified: stable/8/sys/netinet6/in6_rmx.c ============================================================================== --- stable/8/sys/netinet6/in6_rmx.c Mon Oct 11 09:42:30 2010 (r213686) +++ stable/8/sys/netinet6/in6_rmx.c Mon Oct 11 11:25:37 2010 (r213687) @@ -193,11 +193,13 @@ in6_matroute(void *v_arg, struct radix_n struct radix_node *rn = rn_match(v_arg, head); struct rtentry *rt = (struct rtentry *)rn; - if (rt && rt->rt_refcnt == 0) { /* this is first reference */ + if (rt) { + RT_LOCK(rt); if (rt->rt_flags & RTPRF_OURS) { rt->rt_flags &= ~RTPRF_OURS; rt->rt_rmx.rmx_expire = 0; } + RT_UNLOCK(rt); } return rn; } From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 11:25:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 078D01065672; Mon, 11 Oct 2010 11:25:38 +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 CEA238FC20; Mon, 11 Oct 2010 11:25:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BBPbVA013641; Mon, 11 Oct 2010 11:25:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BBPbG9013638; Mon, 11 Oct 2010 11:25:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010111125.o9BBPbG9013638@svn.freebsd.org> From: Xin LI Date: Mon, 11 Oct 2010 11:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213687 - in stable: 7/sys/netinet 7/sys/netinet6 8/sys/netinet 8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 11:25:38 -0000 Author: delphij Date: Mon Oct 11 11:25:37 2010 New Revision: 213687 URL: http://svn.freebsd.org/changeset/base/213687 Log: MFC r213225: Add a bandaid for a long-standing race condition during route entry un-expiring. The previous version of code have no locking when testing rt_refcnt. The result of the lack of locking may result in a condition where a routing entry have a reference count but at the same time have RTPRF_OURS bit set and an expiration timer. These would eventually lead to a panic: panic: rtqkill route really not free When the system have ICMP redirects accepted from local gateway in a moderate frequency, for instance. Commit this workaround for now until we have some better solution. PR: kern/149804 Reviewed by: bz Tested by: Zhao Xin, Pete French Modified: stable/7/sys/netinet/in_rmx.c stable/7/sys/netinet6/in6_rmx.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/netinet/in_rmx.c stable/8/sys/netinet6/in6_rmx.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/7/sys/netinet/in_rmx.c ============================================================================== --- stable/7/sys/netinet/in_rmx.c Mon Oct 11 09:42:30 2010 (r213686) +++ stable/7/sys/netinet/in_rmx.c Mon Oct 11 11:25:37 2010 (r213687) @@ -140,12 +140,13 @@ in_matroute(void *v_arg, struct radix_no struct radix_node *rn = rn_match(v_arg, head); struct rtentry *rt = (struct rtentry *)rn; - /*XXX locking? */ - if (rt && rt->rt_refcnt == 0) { /* this is first reference */ + if (rt) { + RT_LOCK(rt); if (rt->rt_flags & RTPRF_OURS) { rt->rt_flags &= ~RTPRF_OURS; rt->rt_rmx.rmx_expire = 0; } + RT_UNLOCK(rt); } return rn; } Modified: stable/7/sys/netinet6/in6_rmx.c ============================================================================== --- stable/7/sys/netinet6/in6_rmx.c Mon Oct 11 09:42:30 2010 (r213686) +++ stable/7/sys/netinet6/in6_rmx.c Mon Oct 11 11:25:37 2010 (r213687) @@ -207,11 +207,13 @@ in6_matroute(void *v_arg, struct radix_n struct radix_node *rn = rn_match(v_arg, head); struct rtentry *rt = (struct rtentry *)rn; - if (rt && rt->rt_refcnt == 0) { /* this is first reference */ + if (rt) { + RT_LOCK(rt); if (rt->rt_flags & RTPRF_OURS) { rt->rt_flags &= ~RTPRF_OURS; rt->rt_rmx.rmx_expire = 0; } + RT_UNLOCK(rt); } return rn; } From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 12:43:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D344310656A6; Mon, 11 Oct 2010 12:43:51 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD5648FC2A; Mon, 11 Oct 2010 12:43:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BChphx015475; Mon, 11 Oct 2010 12:43:51 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BChpV5015469; Mon, 11 Oct 2010 12:43:51 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201010111243.o9BChpV5015469@svn.freebsd.org> From: Martin Matuska Date: Mon, 11 Oct 2010 12:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213688 - in vendor/xz/dist: . po src/common src/liblzma/api src/liblzma/api/lzma src/liblzma/check src/liblzma/common src/liblzma/delta src/liblzma/lz src/liblzma/lzma src/liblzma/rang... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 12:43:51 -0000 Author: mm Date: Mon Oct 11 12:43:51 2010 New Revision: 213688 URL: http://svn.freebsd.org/changeset/base/213688 Log: Vendor import of xz (stripped) Git revision: d52b411716a614c202e89ba732492efb9916cd3f Approved by: delphij (mentor) Added: vendor/xz/dist/FREEBSD-Xlist (contents, props changed) vendor/xz/dist/FREEBSD-upgrade (contents, props changed) vendor/xz/dist/po/de.po (contents, props changed) vendor/xz/dist/po/it.po (contents, props changed) vendor/xz/dist/src/common/tuklib_mbstr.h (contents, props changed) vendor/xz/dist/src/common/tuklib_mbstr_fw.c (contents, props changed) vendor/xz/dist/src/common/tuklib_mbstr_width.c (contents, props changed) Deleted: vendor/xz/dist/src/liblzma/api/lzma/subblock.h vendor/xz/dist/src/liblzma/common/chunk_size.c vendor/xz/dist/src/liblzma/subblock/ Modified: vendor/xz/dist/ChangeLog (contents, props changed) vendor/xz/dist/README (contents, props changed) vendor/xz/dist/THANKS (contents, props changed) vendor/xz/dist/po/LINGUAS (contents, props changed) vendor/xz/dist/po/POTFILES.in (contents, props changed) vendor/xz/dist/po/cs.po (contents, props changed) vendor/xz/dist/src/common/sysdefs.h (contents, props changed) vendor/xz/dist/src/common/tuklib_cpucores.c (contents, props changed) vendor/xz/dist/src/common/tuklib_gettext.h (contents, props changed) vendor/xz/dist/src/common/tuklib_physmem.c (contents, props changed) vendor/xz/dist/src/liblzma/api/lzma.h (contents, props changed) vendor/xz/dist/src/liblzma/api/lzma/index.h (contents, props changed) vendor/xz/dist/src/liblzma/api/lzma/lzma.h (contents, props changed) vendor/xz/dist/src/liblzma/api/lzma/vli.h (contents, props changed) vendor/xz/dist/src/liblzma/common/block_buffer_encoder.c (contents, props changed) vendor/xz/dist/src/liblzma/common/block_util.c (contents, props changed) vendor/xz/dist/src/liblzma/common/common.c (contents, props changed) vendor/xz/dist/src/liblzma/common/common.h (contents, props changed) vendor/xz/dist/src/liblzma/common/filter_common.c (contents, props changed) vendor/xz/dist/src/liblzma/common/filter_decoder.c (contents, props changed) vendor/xz/dist/src/liblzma/common/filter_encoder.c (contents, props changed) vendor/xz/dist/src/liblzma/common/stream_buffer_encoder.c (contents, props changed) vendor/xz/dist/src/liblzma/delta/delta_encoder.c (contents, props changed) vendor/xz/dist/src/liblzma/lz/lz_decoder.c (contents, props changed) vendor/xz/dist/src/liblzma/lz/lz_decoder.h (contents, props changed) vendor/xz/dist/src/liblzma/lz/lz_encoder.c (contents, props changed) vendor/xz/dist/src/liblzma/lz/lz_encoder.h (contents, props changed) vendor/xz/dist/src/liblzma/lz/lz_encoder_mf.c (contents, props changed) vendor/xz/dist/src/liblzma/lzma/lzma2_encoder.c (contents, props changed) vendor/xz/dist/src/liblzma/lzma/lzma_encoder_optimum_fast.c (contents, props changed) vendor/xz/dist/src/liblzma/lzma/lzma_encoder_optimum_normal.c (contents, props changed) vendor/xz/dist/src/liblzma/lzma/lzma_encoder_presets.c (contents, props changed) vendor/xz/dist/src/lzmainfo/lzmainfo.1 (contents, props changed) vendor/xz/dist/src/lzmainfo/lzmainfo.c (contents, props changed) vendor/xz/dist/src/xz/args.c (contents, props changed) vendor/xz/dist/src/xz/args.h (contents, props changed) vendor/xz/dist/src/xz/coder.c (contents, props changed) vendor/xz/dist/src/xz/coder.h (contents, props changed) vendor/xz/dist/src/xz/file_io.c (contents, props changed) vendor/xz/dist/src/xz/hardware.c (contents, props changed) vendor/xz/dist/src/xz/hardware.h (contents, props changed) vendor/xz/dist/src/xz/list.c (contents, props changed) vendor/xz/dist/src/xz/main.c (contents, props changed) vendor/xz/dist/src/xz/message.c (contents, props changed) vendor/xz/dist/src/xz/message.h (contents, props changed) vendor/xz/dist/src/xz/options.c (contents, props changed) vendor/xz/dist/src/xz/options.h (contents, props changed) vendor/xz/dist/src/xz/private.h (contents, props changed) vendor/xz/dist/src/xz/signals.c (contents, props changed) vendor/xz/dist/src/xz/signals.h (contents, props changed) vendor/xz/dist/src/xz/util.c (contents, props changed) vendor/xz/dist/src/xz/util.h (contents, props changed) vendor/xz/dist/src/xz/xz.1 (contents, props changed) vendor/xz/dist/src/xzdec/xzdec.1 (contents, props changed) vendor/xz/dist/src/xzdec/xzdec.c (contents, props changed) Directory Properties: vendor/xz/dist/AUTHORS (props changed) vendor/xz/dist/COPYING (props changed) vendor/xz/dist/TODO (props changed) vendor/xz/dist/po/Makevars (props changed) vendor/xz/dist/src/common/mythread.h (props changed) vendor/xz/dist/src/common/tuklib_common.h (props changed) vendor/xz/dist/src/common/tuklib_config.h (props changed) vendor/xz/dist/src/common/tuklib_cpucores.h (props changed) vendor/xz/dist/src/common/tuklib_exit.c (props changed) vendor/xz/dist/src/common/tuklib_exit.h (props changed) vendor/xz/dist/src/common/tuklib_integer.h (props changed) vendor/xz/dist/src/common/tuklib_open_stdxxx.c (props changed) vendor/xz/dist/src/common/tuklib_open_stdxxx.h (props changed) vendor/xz/dist/src/common/tuklib_physmem.h (props changed) vendor/xz/dist/src/common/tuklib_progname.c (props changed) vendor/xz/dist/src/common/tuklib_progname.h (props changed) vendor/xz/dist/src/liblzma/api/lzma/base.h (props changed) vendor/xz/dist/src/liblzma/api/lzma/bcj.h (props changed) vendor/xz/dist/src/liblzma/api/lzma/block.h (props changed) vendor/xz/dist/src/liblzma/api/lzma/check.h (props changed) vendor/xz/dist/src/liblzma/api/lzma/container.h (props changed) vendor/xz/dist/src/liblzma/api/lzma/delta.h (props changed) vendor/xz/dist/src/liblzma/api/lzma/filter.h (props changed) vendor/xz/dist/src/liblzma/api/lzma/hardware.h (props changed) vendor/xz/dist/src/liblzma/api/lzma/index_hash.h (props changed) vendor/xz/dist/src/liblzma/api/lzma/stream_flags.h (props changed) vendor/xz/dist/src/liblzma/api/lzma/version.h (props changed) vendor/xz/dist/src/liblzma/check/check.c (props changed) vendor/xz/dist/src/liblzma/check/check.h (props changed) vendor/xz/dist/src/liblzma/check/crc32_fast.c (props changed) vendor/xz/dist/src/liblzma/check/crc32_small.c (props changed) vendor/xz/dist/src/liblzma/check/crc32_table.c (props changed) vendor/xz/dist/src/liblzma/check/crc32_table_be.h (props changed) vendor/xz/dist/src/liblzma/check/crc32_table_le.h (props changed) vendor/xz/dist/src/liblzma/check/crc32_tablegen.c (props changed) vendor/xz/dist/src/liblzma/check/crc32_x86.S (props changed) vendor/xz/dist/src/liblzma/check/crc64_fast.c (props changed) vendor/xz/dist/src/liblzma/check/crc64_small.c (props changed) vendor/xz/dist/src/liblzma/check/crc64_table.c (props changed) vendor/xz/dist/src/liblzma/check/crc64_table_be.h (props changed) vendor/xz/dist/src/liblzma/check/crc64_table_le.h (props changed) vendor/xz/dist/src/liblzma/check/crc64_tablegen.c (props changed) vendor/xz/dist/src/liblzma/check/crc64_x86.S (props changed) vendor/xz/dist/src/liblzma/check/crc_macros.h (props changed) vendor/xz/dist/src/liblzma/check/sha256.c (props changed) vendor/xz/dist/src/liblzma/common/alone_decoder.c (props changed) vendor/xz/dist/src/liblzma/common/alone_decoder.h (props changed) vendor/xz/dist/src/liblzma/common/alone_encoder.c (props changed) vendor/xz/dist/src/liblzma/common/auto_decoder.c (props changed) vendor/xz/dist/src/liblzma/common/block_buffer_decoder.c (props changed) vendor/xz/dist/src/liblzma/common/block_decoder.c (props changed) vendor/xz/dist/src/liblzma/common/block_decoder.h (props changed) vendor/xz/dist/src/liblzma/common/block_encoder.c (props changed) vendor/xz/dist/src/liblzma/common/block_encoder.h (props changed) vendor/xz/dist/src/liblzma/common/block_header_decoder.c (props changed) vendor/xz/dist/src/liblzma/common/block_header_encoder.c (props changed) vendor/xz/dist/src/liblzma/common/easy_buffer_encoder.c (props changed) vendor/xz/dist/src/liblzma/common/easy_decoder_memusage.c (props changed) vendor/xz/dist/src/liblzma/common/easy_encoder.c (props changed) vendor/xz/dist/src/liblzma/common/easy_encoder_memusage.c (props changed) vendor/xz/dist/src/liblzma/common/easy_preset.c (props changed) vendor/xz/dist/src/liblzma/common/easy_preset.h (props changed) vendor/xz/dist/src/liblzma/common/filter_buffer_decoder.c (props changed) vendor/xz/dist/src/liblzma/common/filter_buffer_encoder.c (props changed) vendor/xz/dist/src/liblzma/common/filter_common.h (props changed) vendor/xz/dist/src/liblzma/common/filter_decoder.h (props changed) vendor/xz/dist/src/liblzma/common/filter_encoder.h (props changed) vendor/xz/dist/src/liblzma/common/filter_flags_decoder.c (props changed) vendor/xz/dist/src/liblzma/common/filter_flags_encoder.c (props changed) vendor/xz/dist/src/liblzma/common/hardware_physmem.c (props changed) vendor/xz/dist/src/liblzma/common/index.c (props changed) vendor/xz/dist/src/liblzma/common/index.h (props changed) vendor/xz/dist/src/liblzma/common/index_decoder.c (props changed) vendor/xz/dist/src/liblzma/common/index_encoder.c (props changed) vendor/xz/dist/src/liblzma/common/index_encoder.h (props changed) vendor/xz/dist/src/liblzma/common/index_hash.c (props changed) vendor/xz/dist/src/liblzma/common/stream_buffer_decoder.c (props changed) vendor/xz/dist/src/liblzma/common/stream_decoder.c (props changed) vendor/xz/dist/src/liblzma/common/stream_decoder.h (props changed) vendor/xz/dist/src/liblzma/common/stream_encoder.c (props changed) vendor/xz/dist/src/liblzma/common/stream_encoder.h (props changed) vendor/xz/dist/src/liblzma/common/stream_flags_common.c (props changed) vendor/xz/dist/src/liblzma/common/stream_flags_common.h (props changed) vendor/xz/dist/src/liblzma/common/stream_flags_decoder.c (props changed) vendor/xz/dist/src/liblzma/common/stream_flags_encoder.c (props changed) vendor/xz/dist/src/liblzma/common/vli_decoder.c (props changed) vendor/xz/dist/src/liblzma/common/vli_encoder.c (props changed) vendor/xz/dist/src/liblzma/common/vli_size.c (props changed) vendor/xz/dist/src/liblzma/delta/delta_common.c (props changed) vendor/xz/dist/src/liblzma/delta/delta_common.h (props changed) vendor/xz/dist/src/liblzma/delta/delta_decoder.c (props changed) vendor/xz/dist/src/liblzma/delta/delta_decoder.h (props changed) vendor/xz/dist/src/liblzma/delta/delta_encoder.h (props changed) vendor/xz/dist/src/liblzma/delta/delta_private.h (props changed) vendor/xz/dist/src/liblzma/lz/lz_encoder_hash.h (props changed) vendor/xz/dist/src/liblzma/lz/lz_encoder_hash_table.h (props changed) vendor/xz/dist/src/liblzma/lzma/fastpos.h (props changed) vendor/xz/dist/src/liblzma/lzma/fastpos_table.c (props changed) vendor/xz/dist/src/liblzma/lzma/fastpos_tablegen.c (props changed) vendor/xz/dist/src/liblzma/lzma/lzma2_decoder.c (props changed) vendor/xz/dist/src/liblzma/lzma/lzma2_decoder.h (props changed) vendor/xz/dist/src/liblzma/lzma/lzma2_encoder.h (props changed) vendor/xz/dist/src/liblzma/lzma/lzma_common.h (props changed) vendor/xz/dist/src/liblzma/lzma/lzma_decoder.c (props changed) vendor/xz/dist/src/liblzma/lzma/lzma_decoder.h (props changed) vendor/xz/dist/src/liblzma/lzma/lzma_encoder.c (props changed) vendor/xz/dist/src/liblzma/lzma/lzma_encoder.h (props changed) vendor/xz/dist/src/liblzma/lzma/lzma_encoder_private.h (props changed) vendor/xz/dist/src/liblzma/rangecoder/price.h (props changed) vendor/xz/dist/src/liblzma/rangecoder/price_table.c (props changed) vendor/xz/dist/src/liblzma/rangecoder/price_tablegen.c (props changed) vendor/xz/dist/src/liblzma/rangecoder/range_common.h (props changed) vendor/xz/dist/src/liblzma/rangecoder/range_decoder.h (props changed) vendor/xz/dist/src/liblzma/rangecoder/range_encoder.h (props changed) vendor/xz/dist/src/liblzma/simple/arm.c (props changed) vendor/xz/dist/src/liblzma/simple/armthumb.c (props changed) vendor/xz/dist/src/liblzma/simple/ia64.c (props changed) vendor/xz/dist/src/liblzma/simple/powerpc.c (props changed) vendor/xz/dist/src/liblzma/simple/simple_coder.c (props changed) vendor/xz/dist/src/liblzma/simple/simple_coder.h (props changed) vendor/xz/dist/src/liblzma/simple/simple_decoder.c (props changed) vendor/xz/dist/src/liblzma/simple/simple_decoder.h (props changed) vendor/xz/dist/src/liblzma/simple/simple_encoder.c (props changed) vendor/xz/dist/src/liblzma/simple/simple_encoder.h (props changed) vendor/xz/dist/src/liblzma/simple/simple_private.h (props changed) vendor/xz/dist/src/liblzma/simple/sparc.c (props changed) vendor/xz/dist/src/liblzma/simple/x86.c (props changed) vendor/xz/dist/src/xz/file_io.h (props changed) vendor/xz/dist/src/xz/list.h (props changed) vendor/xz/dist/src/xz/main.h (props changed) vendor/xz/dist/src/xz/suffix.c (props changed) vendor/xz/dist/src/xz/suffix.h (props changed) Modified: vendor/xz/dist/ChangeLog ============================================================================== --- vendor/xz/dist/ChangeLog Mon Oct 11 11:25:37 2010 (r213687) +++ vendor/xz/dist/ChangeLog Mon Oct 11 12:43:51 2010 (r213688) @@ -1,3 +1,817 @@ +commit d52b411716a614c202e89ba732492efb9916cd3f +Author: Lasse Collin +Date: Sun Oct 10 17:58:58 2010 +0300 + + xz: Use "%"PRIu32 instead of "%d" in a format string. + +commit ae74d1bdeb075c3beefe76e1136c5741804e7e91 +Author: Lasse Collin +Date: Sun Oct 10 17:43:26 2010 +0300 + + test_files.sh: Fix the first line. + + For some reason this prevented running the test only + on OS/2 and even on that it broke only recently. + + Thanks to Elbert Pol. + +commit d492b80ddd6f9a13419de6d102df7374d8f448e8 +Author: Lasse Collin +Date: Sun Oct 10 16:49:01 2010 +0300 + + lzmainfo: Use "%"PRIu32 instead of "%u" for uint32_t. + +commit 825e859a9054bd91202e5723c41a17e72f63040a +Author: Lasse Collin +Date: Sun Oct 10 16:47:01 2010 +0300 + + lzmainfo: Use fileno(stdin) instead of STDIN_FILENO. + +commit acbc4cdecbeec2a4dfaac04f185ece49b2ff17c8 +Author: Lasse Collin +Date: Sat Oct 9 23:20:51 2010 +0300 + + lzmainfo: Use setmode() on DOS-like systems. + +commit ef364d3abc5647111c5424ea0d83a567e184a23b +Author: Lasse Collin +Date: Sat Oct 9 21:51:03 2010 +0300 + + OS/2 and DOS: Be less verbose on signals. + + Calling raise() to kill xz when user has pressed C-c + is a bit verbose on OS/2 and DOS/DJGPP. Instead of + calling raise(), set only the exit status to 1. + +commit 5629c4be07b6c67e79842b2569da1cedc9c0d69a +Author: Lasse Collin +Date: Sat Oct 9 19:28:49 2010 +0300 + + DOS: Update the Makefile, config.h and README. + + This is now simpler and builds only xz.exe. + +commit f25a77e6b9bc48a243ddfbbd755b7960eec7e0ac +Author: Lasse Collin +Date: Sat Oct 9 18:57:55 2010 +0300 + + Windows: Put some license info into README-Windows.txt. + +commit e75100f549f85d231df25c07aa94d63e78e2d668 +Author: Lasse Collin +Date: Sat Oct 9 18:57:04 2010 +0300 + + Windows: Fix a diagnostics bug in build.bash. + +commit efeb998a2b1025df1c1d202cc7d21d866cd1c336 +Author: Lasse Collin +Date: Sat Oct 9 13:02:15 2010 +0300 + + lzmainfo: Add Windows resource file. + +commit 389d418445f1623593dfdbba55d52fbb6d1205f5 +Author: Lasse Collin +Date: Sat Oct 9 12:57:25 2010 +0300 + + Add missing public domain notice to lzmadec_w32res.rc. + +commit 6389c773a4912dd9f111256d74ba1605230a7957 +Author: Lasse Collin +Date: Sat Oct 9 12:52:12 2010 +0300 + + Windows: Update common_w32res.rc. + +commit 71275457ca24c9b01721f5cfc3638cf094daf454 +Author: Lasse Collin +Date: Sat Oct 9 12:27:08 2010 +0300 + + Windows: Make build.bash prefer MinGW-w32 over MinGW. + + This is simply for licensing reasons. The 64-bit version + will be built with MinGW-w64 anyway (at least for now), + so using it also for 32-bit build allows using the same + copyright notice about the MinGW-w64/w32 runtime. + + Note that using MinGW would require a copyright notice too, + because its runtime is not in the public domain either even + though MinGW's home page claims that it is public domain. + See . + +commit 3ac35719d8433af937af6491383d4a50e343099b +Author: Lasse Collin +Date: Sat Oct 9 11:33:21 2010 +0300 + + Windows: Copy COPYING-Windows.txt (if it exists) to the package. + + Also, put README-Windows.txt to the doc directory like + the other documentation files. + +commit 7b5db576fd7a4a67813b8437a9ccd4dbc94bbaae +Author: Lasse Collin +Date: Fri Oct 8 21:42:37 2010 +0300 + + Windows: Fix build.bash again. + + 630a8beda34af0ac153c8051b1bf01230558e422 wasn't good. + +commit d3cd7abe85ec7c2f46cf198b15c00d5d119df3dd +Author: Lasse Collin +Date: Fri Oct 8 16:53:20 2010 +0300 + + Use LZMA_VERSION_STRING instead of PACKAGE_VERSION. + + Those are the same thing, and the former makes it a bit + easier to build the code with other build systems, because + one doesn't need to update the version number into custom + config.h. + + This change affects only lzmainfo. Other tools were already + using LZMA_VERSION_STRING. + +commit 084c60d318f2dbaef4078d9b100b4a373d0c3a7f +Author: Lasse Collin +Date: Fri Oct 8 15:59:25 2010 +0300 + + configure.ac: Remove two unused defines. + +commit 11f51b6714357cb67ec7e56ed9575c199b5581fe +Author: Lasse Collin +Date: Fri Oct 8 15:32:29 2010 +0300 + + Make tests accommodate missing xz or xzdec. + +commit b1c7368f95e93ccdefdd0748e04398c26766f47f +Author: Lasse Collin +Date: Fri Oct 8 15:25:45 2010 +0300 + + Build: Add options to disable individual command line tools. + +commit 630a8beda34af0ac153c8051b1bf01230558e422 +Author: Lasse Collin +Date: Thu Oct 7 00:44:53 2010 +0300 + + Windows: Make build.bash work without --enable-dynamic=no. + +commit f9907503f882a745dce9d84c2968f6c175ba966a +Author: Lasse Collin +Date: Tue Oct 5 14:13:16 2010 +0300 + + Build: Remove the static/dynamic tricks. + + Most distros want xz linked against shared liblzma, so + it doesn't help much to require --enable-dynamic for that. + Those who want to avoid PIC on x86-32 to get better + performance, can still do it e.g. by using --disable-shared + to compile xz and then another pass to compile shared liblzma. + + Part of these static/dynamic tricks were needed for Windows + in the past. Nowadays we rely on GCC and binutils to do the + right thing with auto-import. If the Autotooled build system + needs to support some other toolchain on Windows in the future, + this may need some rethinking. + +commit fda4724d8114fccfa31c1839c15479f350c2fb4c +Author: Lasse Collin +Date: Tue Oct 5 12:18:58 2010 +0300 + + configure.ac: Silence a warning from Autoconf 2.68. + +commit 80b5675fa62c87426fe86f8fcd20feeabc4361b9 +Author: Lasse Collin +Date: Mon Oct 4 19:43:01 2010 +0300 + + A few more languages files to the xz man page. + + Thanks to Jonathan Nieder. + +commit f9722dbeca4dc4c43cfd15d122dafaac50b0a0bb +Author: Lasse Collin +Date: Sat Oct 2 12:07:33 2010 +0300 + + Update the FAQ. + +commit 61ae593661e8dc402394e84d567ca2044a51572b +Author: Lasse Collin +Date: Sat Oct 2 11:38:20 2010 +0300 + + liblzma: Small fixes to comments in the API headers. + +commit 9166682dc601fd42c1b9510572e3f917d18de504 +Author: Lasse Collin +Date: Tue Sep 28 11:40:12 2010 +0300 + + Create the PDF versions of the man pages better. + +commit 17d3c61edd35de8fa884944fc70d1db86daa5dd8 +Author: Lasse Collin +Date: Tue Sep 28 10:59:53 2010 +0300 + + Move version.sh to build-aux. + +commit 84af9d8770451339a692e9b70f96cf56156a6069 +Author: Lasse Collin +Date: Tue Sep 28 10:53:02 2010 +0300 + + Update .gitignore. + +commit 31575a449ac64c523da3bab8d0c0b522cdc7c780 +Author: Lasse Collin +Date: Tue Sep 28 01:17:14 2010 +0300 + + Fix accomodate -> accommodate on the xz man page. + +commit cec0ddc8ec4ce81685a51998b978e22167e461f9 +Author: Lasse Collin +Date: Mon Sep 27 23:29:34 2010 +0300 + + Major man page updates. + + Lots of content was updated on the xz man page. + + Technical improvements: + - Start a new sentence on a new line. + - Use fairly short lines. + - Use constant-width font for examples (where supported). + - Some minor cleanups. + + Thanks to Jonathan Nieder for some language fixes. + +commit 075257ab0416a0603be930082e31a5703e4ba345 +Author: Lasse Collin +Date: Sun Sep 26 18:10:31 2010 +0300 + + Fix the preset -3e. + + depth=0 was missing. + +commit 2577da9ebdba13fbe99ae5ee8bde35f7ed60f6d1 +Author: Lasse Collin +Date: Thu Sep 23 14:03:10 2010 +0300 + + Add translations.bash and translation notes to README. + + translations.bash prints some messages from xz, which + hopefully makes it a bit easier to test translations. + +commit a3c5997c57e5b1a20aae6d1071b584b4f17d0b23 +Author: Lasse Collin +Date: Fri Sep 17 22:14:30 2010 +0300 + + xz: Update the Czech translation. + + Thanks to Marek Černocký. + +commit a1766af582dc23fddd9da1eeb4b9d61e3eb4c2e6 +Author: Lasse Collin +Date: Thu Sep 16 23:40:41 2010 +0300 + + xz: Add Italian translation. + + Thanks to Milo Casagrande and Lorenzo De Liso. + +commit 21088018554e2b0e02914205377ceb6e34a090bd +Author: Lasse Collin +Date: Wed Sep 15 00:34:13 2010 +0300 + + xz: Edit a translators comment. + +commit be16e28ece1b492b8f93382b7fa1cc4da23c6ff6 +Author: Lasse Collin +Date: Tue Sep 14 22:47:14 2010 +0300 + + xz: Add German translation. + + Thanks to Andre Noll. + +commit e23ea74f3240e6b69683f9e69d1716e0f9e9092b +Author: Lasse Collin +Date: Fri Sep 10 14:30:25 2010 +0300 + + Updated README. + +commit 8dad2fd69336985adb9f774fa96dc9c0efcb5a71 +Author: Lasse Collin +Date: Fri Sep 10 14:30:07 2010 +0300 + + Updated INSTALL. + +commit 0b5f07fe3728c27cce416ddc40f7e4803ae96ac2 +Author: Lasse Collin +Date: Fri Sep 10 14:26:20 2010 +0300 + + Updated the git repository address in ChangeLog. + +commit a8760203f93a69bc39fd14520a6e9e7b7d70be06 +Author: Lasse Collin +Date: Fri Sep 10 14:09:33 2010 +0300 + + xz: Add a comment to translators about "literal context bits". + +commit bb0b1004f83cdc4d309e1471c2ecaf9f95ce60c5 +Author: Lasse Collin +Date: Fri Sep 10 10:30:33 2010 +0300 + + xz: Multiple fixes. + + The code assumed that printing numbers with thousand separators + and decimal points would always produce only US-ASCII characters. + This was used for buffer sizes (with snprintf(), no overflows) + and aligning columns of the progress indicator and --list. That + assumption was wrong (e.g. LC_ALL=fi_FI.UTF-8 with glibc), so + multibyte character support was added in this commit. The old + way is used if the operating system doesn't have enough multibyte + support (e.g. lacks wcwidth()). + + The sizes of buffers were increased to accomodate multibyte + characters. I don't know how big they should be exactly, but + they aren't used for anything critical, so it's not too bad. + If they still aren't big enough, I hopefully get a bug report. + snprintf() takes care of avoiding buffer overflows. + + Some static buffers were replaced with buffers allocated on + stack. double_to_str() was removed. uint64_to_str() and + uint64_to_nicestr() now share the static buffer and test + for thousand separator support. + + Integrity check names "None" and "Unknown-N" (2 <= N <= 15) + were marked to be translated. I had forgot these, plus they + wouldn't have worked correctly anyway before this commit, + because printing tables with multibyte strings didn't work. + + Thanks to Marek Černocký for reporting the bug about + misaligned table columns in --list output. + +commit 639f8e2af33cf8a184d59ba56b6df7c098679d61 +Author: Lasse Collin +Date: Wed Sep 8 08:49:22 2010 +0300 + + Update the Czech translation. + + Thanks to Marek Černocký. + +commit 41bc9956ebfd7c86777d33676acf34c45e7ca7c7 +Author: Lasse Collin +Date: Tue Sep 7 12:31:40 2010 +0300 + + xz: Add a note to translators. + +commit 77a7746616e555fc08028e883a56d06bf0088b81 +Author: Lasse Collin +Date: Tue Sep 7 10:42:13 2010 +0300 + + Fix use of N_() and ngettext(). + + I had somehow thought that N_() is usually used + as shorthand for ngettext(). + + This also fixes a missing \n from a call to ngettext(). + +commit e6ad39335842343e622ab51207d1d3cb9caad801 +Author: Lasse Collin +Date: Mon Sep 6 19:43:12 2010 +0300 + + Add missing files to POTFILES.in. + +commit 58f55131820d2e08a1a6beb9ec0ee2378044eb30 +Author: Lasse Collin +Date: Mon Sep 6 10:16:24 2010 +0300 + + xz: Improve a comment. + +commit bcb1b898341f7073f51660d7052d7ed6c5461a66 +Author: Lasse Collin +Date: Sun Sep 5 21:34:29 2010 +0300 + + xz: Update the comment about NetBSD in file_io.c. + + Thanks to Joerg Sonnenberger. + +commit da014d55972f5addbf6b4360d3d8ed2ef4282170 +Author: Lasse Collin +Date: Sun Sep 5 21:11:33 2010 +0300 + + xz: Use an array instead of pointer for stdin_filename. + + Thanks Joerg Sonnenberger. + +commit 8c7d3d1a0781c296c6b6e2465becaffd2132f7ee +Author: Lasse Collin +Date: Sun Sep 5 12:16:17 2010 +0300 + + xz: Hopefully ease translating the messages in list.c. + +commit ef840950ad99cf2955c754875af0e01acf125079 +Author: Lasse Collin +Date: Sat Sep 4 23:14:44 2010 +0300 + + xz: Fix grammar. + +commit c46afd6edc04ea140db6c59e8486f5707c810c13 +Author: Lasse Collin +Date: Sat Sep 4 23:12:20 2010 +0300 + + xz: Use lzma_lzma_preset() to initialize the options structure. + +commit 8fd3ac046d0b1416a2094fecc456d9e0f4d5d065 +Author: Lasse Collin +Date: Sat Sep 4 22:16:28 2010 +0300 + + Don't set lc=4 with --extreme. + + This should reduce the cases where --extreme makes + compression worse. On the other hand, some other + files may now benefit slightly less from --extreme. + +commit 474bac0c33e94aeaca8ada17ab19972b1424bc2b +Author: Lasse Collin +Date: Sat Sep 4 22:10:32 2010 +0300 + + xz: Minor improvements to --help and --long-help. + +commit 373ee26f955617295c5c537b04a153a1969140d2 +Author: Jonathan Nieder +Date: Fri Sep 3 16:49:15 2010 -0500 + + Adjust memory limits in test_compress.sh + + Testing compression at level -4 now requires 48 MiB of free store at + compression time and 5 MiB at decompression time. + + Signed-off-by: Jonathan Nieder + +commit 2fce9312f36727ea82f3430cc5d3a7d243c5f087 +Author: Lasse Collin +Date: Fri Sep 3 15:54:40 2010 +0300 + + xz: Make -vv show also decompressor memory usage. + +commit b4b1cbcb53624ab832f8b3189c74450dc7ea29b6 +Author: Lasse Collin +Date: Fri Sep 3 15:13:12 2010 +0300 + + Tweak the compression presets -0 .. -5. + + "Extreme" mode might need some further tweaking still. + Docs were not updated yet. + +commit 77fe5954cd3d10fb1837372684cbc133b56b6a87 +Author: Lasse Collin +Date: Fri Sep 3 12:28:41 2010 +0300 + + liblzma: Adjust default depth calculation for HC3 and HC4. + + It was 8 + nice_len / 4, now it is 4 + nice_len / 4. + This allows faster settings at lower nice_len values, + even though it seems that I won't use automatic depth + calcuation with HC3 and HC4 in the presets. + +commit fce69059cf901ce8075a78c7607d591f144a3b5a +Author: Lasse Collin +Date: Fri Sep 3 11:11:25 2010 +0300 + + xz: Make --help two lines shorter. + + At least for now, the --help option doesn't list any + options that take arguments, so "Mandatory arguments to..." + can be omitted. + +commit a848e47ced6e5e2a564b5c454b2f5a19c2f40298 +Author: Lasse Collin +Date: Thu Sep 2 19:22:35 2010 +0300 + + xz: Make setting a preset override a custom filter chain. + + This is more logical behavior than ignoring preset level + options once a custom filter chain has been specified. + +commit b3ff7ba044eaeab3e424d7b51fe914daf681b1a3 +Author: Lasse Collin +Date: Thu Sep 2 19:09:57 2010 +0300 + + xz: Always warn if adjusting dictionary size due to memlimit. + +commit d5653ba8a1ea9c00de4fddc617aba3c51e18139d +Author: Lasse Collin +Date: Tue Aug 10 11:04:30 2010 +0300 + + Fix test_compress.sh. + + It broke when --memory option was removed from xzdec. + + Thanks to Jonathan Nieder. + +commit 792331bdee706aa852a78b171040ebf814c6f3ae +Author: Lasse Collin +Date: Sat Aug 7 20:45:18 2010 +0300 + + Disable the memory usage limiter by default. + + For several people, the limiter causes bigger problems that + it solves, so it is better to have it disabled by default. + Those who want to have a limiter by default need to enable + it via the environment variable XZ_DEFAULTS. + + Support for environment variable XZ_DEFAULTS was added. It is + parsed before XZ_OPT and technically identical with it. The + intended uses differ quite a bit though; see the man page. + + The memory usage limit can now be set separately for + compression and decompression using --memlimit-compress and + --memlimit-decompress. To set both at once, -M or --memlimit + can be used. --memory was retained as a legacy alias for + --memlimit for backwards compatibility. + + The semantics of --info-memory were changed in backwards + incompatible way. Compatibility wasn't meaningful due to + changes in the memory usage limiter functionality. + + The memory usage limiter info is no longer shown at the + bottom of xz --long -help. + + The memory usage limiter support for removed completely from xzdec. + + xz's man page was updated to match the above changes. Various + unrelated fixes were also made to the man page. + +commit 4a45dd4c39f75d25c7a37b6400cb24d4010ca801 +Author: Lasse Collin +Date: Fri Aug 6 20:22:16 2010 +0300 + + Add missing const to a global constant in xz. + +commit 01aa4869cb220b7fdad6d1acbabb2233045daa8f +Author: Lasse Collin +Date: Wed Jul 28 11:44:55 2010 +0300 + + Language fixes for man pages. + + Thanks to A. Costa and Jonathan Nieder. + +commit ce1f0deafe8504e1492bf1b1efb3e3ec950b1a2b +Author: Lasse Collin +Date: Tue Jul 27 20:47:12 2010 +0300 + + Windows: Add a note about building a Git repository snapshot + +commit 507a4a4dea1e5462f12f7ed4b076c34e02054a38 +Author: Lasse Collin +Date: Tue Jul 27 20:45:03 2010 +0300 + + Windows: build.sh is a bash script so name it correctly. + +commit b1cbfd40f049a646a639eb78a3e41e9e3ef73339 +Author: Lasse Collin +Date: Tue Jul 27 20:27:32 2010 +0300 + + Windows: Don't strip liblzma.a too much. + +commit a540198ffb25fad36380c5e92ac20c2d28eec46a +Author: Lasse Collin +Date: Tue Jul 13 20:07:26 2010 +0300 + + Updated THANKS. + +commit bab0f01ed931f606b4675aa9f9331a17cec09bad +Author: Lasse Collin +Date: Tue Jul 13 19:55:50 2010 +0300 + + Add two simple example programs. + + Hopefully these help a bit when learning the basics + of liblzma API. I plan to write detailed examples about + both basic and advanced features with lots of comments, + but these two examples are good have right now. + + The examples were written by Daniel Mealha Cabrita. Thanks. + +commit c15c42abb3c8c6e77c778ef06c97a4a10b8b5d00 +Author: Lasse Collin +Date: Tue Jun 15 14:06:29 2010 +0300 + + Add --no-adjust. + +commit 2130926dd1c839280358172dfadd8d3054bde2b4 +Author: Lasse Collin +Date: Fri Jun 11 21:51:32 2010 +0300 + + Updated THANKS. + +commit bc612d0e0c9e4504c59d49168e87a7ae3e458443 +Author: Lasse Collin +Date: Fri Jun 11 21:48:32 2010 +0300 + + Clarify the description of the default memlimit in the man page. + + Thanks to Denis Excoffier. + +commit e1b6935d60a00405e6b5b455a3426d2248cc926c +Author: Lasse Collin +Date: Fri Jun 11 21:43:28 2010 +0300 + + Fix string to uint64_t conversion. + + Thanks to Denis Excoffier for the bug report. + +commit 3e49c8acb0f5312948eddb2342dbb5802d4571d0 +Author: Lasse Collin +Date: Fri Jun 11 10:40:28 2010 +0300 + + Put the git commit to the filename in mydist rule. + +commit d8b41eedce486d400f701b757b7b5e4e32276618 +Author: Lasse Collin +Date: Wed Jun 2 23:13:55 2010 +0300 + + Fix compiling with -Werror. + +commit b5fbab6123a39c9a55cd5d7af410e9aae067d5f8 +Author: Lasse Collin +Date: Wed Jun 2 23:09:22 2010 +0300 + + Silence a bogus Valgrind warning. + + When using -O2 with GCC, it liked to swap two comparisons + in one "if" statement. It's otherwise fine except that + the latter part, which is seemingly never executed, got + executed (nothing wrong with that) and then triggered + warning in Valgrind about conditional jump depending on + uninitialized variable. A few people find this annoying + so do things a bit differently to avoid the warning. + +commit 29a7b250e685852f2f97615493ec49acaf528623 +Author: Lasse Collin +Date: Wed Jun 2 21:32:12 2010 +0300 + + Fix a Windows-specific FIXME in signal handling code. + +commit e89d987056cee7d4e279be3ef3a6cc690bfc0e6d +Author: Lasse Collin +Date: Wed Jun 2 17:46:58 2010 +0300 + + Adjust SA_RESTART workaround. + + I want to get a bug report if something else than + DJGPP lacks SA_RESTART. + +commit e243145c84ab5c3be8259fd486ead0de5235b3f0 +Author: Lasse Collin +Date: Tue Jun 1 16:02:30 2010 +0300 + + xz man page updates. + + - Concatenating .xz files and padding + - List mode + - Robot mode + - A few examples (but many more are needed) + +commit ce6dc3c0a891f23a862f80ec08d3b6f0beb2a562 +Author: Lasse Collin +Date: Tue Jun 1 15:51:44 2010 +0300 + + Major update to xz --list. + +commit 905e54804a899e4ad526d38fdba7e803ab9b71bd +Author: Lasse Collin +Date: Tue Jun 1 14:13:03 2010 +0300 + + Rename message_filters_get() to message_filters_to_str(). + +commit 4b346ae8af20045027ae5efb068c6d69da3324d2 +Author: Lasse Collin +Date: Tue Jun 1 14:09:12 2010 +0300 + + Fix a comment. + +commit 07dc34f6da45c9ab757dad7fd5eef522ad27d296 +Author: Lasse Collin +Date: Thu May 27 16:17:42 2010 +0300 + + Fix lzma_block_compressed_size(). + +commit 44d70cb154225e47eebf15a3cfbdf3794cbb4593 +Author: Lasse Collin +Date: Thu May 27 14:32:51 2010 +0300 + + Take Cygwin into account in some #if lines. + + This change is no-op, but good to have just in case + for the future. + +commit a334348dc02803241cf4e0a539eecdc0e7ad2cc7 +Author: Lasse Collin +Date: Thu May 27 13:42:44 2010 +0300 + + Remove references to the Subblock filter in xz and tests. + + Thanks to Jonathan Nieder. + +commit 70e5e2f6a7084e6af909deee88ceac2f6efa7893 +Author: Lasse Collin +Date: Thu May 27 13:35:36 2010 +0300 + + Remove unused chunk_size.c. + + Thanks to Jonathan Nieder for the reminder. + +commit 01a414eaf4be6352c06b48001b041b47e8202faa +Author: Jonathan Nieder +Date: Thu May 27 02:31:33 2010 -0500 + + Use my_min() instead of MIN() in src/xz/list.c + + This should have been done in + 920a69a8d8e4203c5edddd829d932130eac188ea. + +commit 920a69a8d8e4203c5edddd829d932130eac188ea +Author: Lasse Collin +Date: Wed May 26 10:36:46 2010 +0300 + + Rename MIN() and MAX() to my_min() and my_max(). + + This should avoid some minor portability issues. + +commit 019ae27c24d0c694545a6a46f8b9fb552198b015 +Author: Lasse Collin +Date: Wed May 26 10:30:20 2010 +0300 + + Fix compilation of debug/known_sizes.c. + +commit 98a4856a6ea84f79c790057a6eb89a25bc45b074 +Author: Lasse Collin +Date: Wed May 26 10:28:54 2010 +0300 + + Remove references to Subblock filter in debug/sync_flush.c. + +commit 703d2c33c095c41ae0693ee8c27c45e3847e4535 +Author: Lasse Collin +Date: Wed May 26 10:16:57 2010 +0300 + + Better #error message. + +commit d8a55c48b39703dd83f11089ad01e1ff2ac102e0 +Author: Lasse Collin +Date: Wed May 26 09:55:47 2010 +0300 + + Remove the Subblock filter code for now. + + The spec isn't finished and the code didn't compile anymore. + It won't be included in XZ Utils 5.0.0. It's easy to get it + back once the spec is done. + +commit b6377fc990f9b8651149cae0fecb8b9c5904e26d +Author: Lasse Collin +Date: Sun May 16 18:42:22 2010 +0300 + + Split message_filters(). + + message_filters_to_str() converts the filter chain to + a string. message_filters_show() replaces the original + message_filters(). + + uint32_to_optstr() was also added to show the dictionary + size in nicer format when possible. + +commit d9986db782d6cf0f314342127280519339378fa0 +Author: Lasse Collin +Date: Fri May 14 23:17:20 2010 +0300 + + Omit lzma_restrict from the API headers. + + It isn't really useful so omitting it makes things + shorter and slightly more readable. + +commit 0d3489efca0a723dca0394809fa3e6170843af4b +Author: Lasse Collin +Date: Mon May 10 19:57:24 2010 +0300 + + Updated INSTALL. + +commit 3fb3d594a2b53886adee161b6261e92277f05f7c +Author: Lasse Collin +Date: Mon May 10 19:54:52 2010 +0300 + + Updated THANKS. + +commit 6548e304657e77d3a972053db3c41c5daf591113 +Author: Lasse Collin +Date: Mon May 10 19:54:15 2010 +0300 + + Updates to tuklib_physmem and tuklib_cpucores. + + Don't use #error to generate compile error, because some + compilers actually don't take it as an error. This fixes + tuklib_physmem on IRIX. + + Fix incorrect error check for sysconf() return values. + + Add AIX, HP-UX, and Tru64 specific code to detect the + amount RAM. + + Add HP-UX specific code to detect the number of CPU cores. + + Thanks a lot to Peter O'Gorman for initial patches, + testing, and debugging these fixes. + commit a290cfee3e23f046889c022aa96b4eca2016fdda Author: Lasse Collin Date: Mon Apr 12 21:55:56 2010 +0300 Added: vendor/xz/dist/FREEBSD-Xlist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/xz/dist/FREEBSD-Xlist Mon Oct 11 12:43:51 2010 (r213688) @@ -0,0 +1,37 @@ +$FreeBSD$ +*/*/*/Makefile.* +*/*/Makefile.* +*/.gitignore +*/Makefile.* +.git +.gitignore +ABOUT-NLS +COPYING.GPLv2 +COPYING.GPLv3 +COPYING.LGPLv2.1 +Doxyfile.in +INSTALL +INSTALL.generic +Makefile +Makefile.* +NEWS +PACKAGERS +aclocal.m4 +autogen.sh +build-aux/ +config.h.in +configure +configure.ac +debug/ +doc/ +dos/ +extra/ +lib/ +m4/ +makefile.am +src/*/*.rc +src/liblzma/liblzma.pc.in +src/scripts/ +tests/ +version.sh +windows/ Added: vendor/xz/dist/FREEBSD-upgrade ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/xz/dist/FREEBSD-upgrade Mon Oct 11 12:43:51 2010 (r213688) @@ -0,0 +1,28 @@ +$FreeBSD$ + +xz + +The source code is pulled with git: + + git clone git://ctrl.tukaani.org/xz.git xz + +ChangeLog is generated with: + + git log > ChangeLog + +For the import files and directories were pruned by: + +sh -c 'for F in `cat FREEBSD-Xlist | grep -v FreeBSD`; do rm -rf ./$F ; done' + +You may check if there are any new files that we don't need. + +The instructions for importing new release and merging to HEAD can be found +at FreeBSD wiki: + + http://wiki.freebsd.org/SubversionPrimer/VendorImports + +To make local changes to xz, simply patch and commit to the trunk +branch (aka HEAD). Never make local changes on the vendor branch. + +mm@FreeBSD.org +10-May-2010 Modified: vendor/xz/dist/README ============================================================================== --- vendor/xz/dist/README Mon Oct 11 11:25:37 2010 (r213687) +++ vendor/xz/dist/README Mon Oct 11 12:43:51 2010 (r213688) @@ -9,8 +9,9 @@ XZ Utils 1.3. Documentation for liblzma 2. Version numbering 3. Reporting bugs - 4. Other implementations of the .xz format - 5. Contact information + 4. Translating the xz tool + 5. Other implementations of the .xz format + 6. Contact information 0. Overview @@ -187,7 +188,94 @@ XZ Utils system. -4. Other implementations of the .xz format +4. Translating the xz tool +-------------------------- + + The messages from the xz tool have been translated into a few + languages. Before starting to translate into a new language, ask + the author that someone else hasn't already started working on it. + + Test your translation. Testing includes comparing the translated + output to the original English version by running the same commands + in both your target locale and with LC_ALL=C. Ask someone to + proof-read and test the translation. + + Testing can be done e.g. by installing xz into a temporary directory: + + ./configure --disable-shared --prefix=/tmp/xz-test + # + make -C po update-po + make install + bash debug/translations.bash | less + bash debug/translations.bash | less -S # For --list outputs + + Repeat the above as needed (no need to re-run configure though). + + Note especially the following: + + - The output of --help and --long-help must look nice on + a 80-column terminal. It's OK to add extra lines if needed. + + - In contrast, don't add extra lines to error messages and such. + They are often preceded with e.g. a filename on the same line, + so you have no way to predict where to put a \n. Let the terminal + do the wrapping even if it looks ugly. Adding new lines will be + even uglier in the generic case even if it looks nice in a few + limited examples. + + - Be careful with column alignment in tables and table-like output + (--list, --list --verbose --verbose, --info-memory, --help, and + --long-help): + + * All descriptions of options in --help should start in the + same column (but it doesn't need to be the same column as + in the English messages; just be consistent if you change it). + Check that both --help and --long-help look OK, since they + share several strings. + + * --list --verbose and --info-memory print lines that have + the format "Description: %s". If you need a longer + description, you can put extra space between the colon + and %s. Then you may need to add extra space to other + strings too so that the result as a whole looks good (all + values start at the same column). + + * The columns of the actual tables in --list --verbose --verbose + should be aligned properly. Abbreviate if necessary. It might + be good to keep at least 2 or 3 spaces between column headings + and avoid spaces in the headings so that the columns stand out + better, but this is a matter of opinion. Do what you think + looks best. + + - Be careful to put a period at the end of a sentence when the + original version has it, and don't put it when the original + doesn't have it. Similarly, be careful with \n characters + at the beginning and end of the strings. + + - Read the TRANSLATORS comments that have been extracted from the + source code and included in xz.pot. If they suggest testing the + translation with some type of command, do it. If testing needs + input files, use e.g. tests/files/good-*.xz. + + - When updating the translation, read the fuzzy (modified) strings + carefully, and don't mark them as updated before you actually + have updated them. Reading through the unchanged messages can be + good too; sometimes you may find a better wording for them. + + - If you find language problems in the original English strings, + feel free to suggest improvements. Ask if something is unclear. + + - The translated messages should be understandable (sometimes this + may be a problem with the original English messages too). Don't + make a direct word-by-word translation from English especially if + the result doesn't sound good in your language. + + In short, take your time and pay attention to the details. Making + a good translation is not a quick and trivial thing to do. The + translated xz should look as polished as the English version. + + +5. Other implementations of the .xz format ------------------------------------------ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 12:57:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A9ED1065696; Mon, 11 Oct 2010 12:57:42 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0109D8FC17; Mon, 11 Oct 2010 12:57:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BCvffx015880; Mon, 11 Oct 2010 12:57:41 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BCvfFZ015879; Mon, 11 Oct 2010 12:57:41 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201010111257.o9BCvfFZ015879@svn.freebsd.org> From: Martin Matuska Date: Mon, 11 Oct 2010 12:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213689 - vendor/xz/20101010 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 12:57:42 -0000 Author: mm Date: Mon Oct 11 12:57:41 2010 New Revision: 213689 URL: http://svn.freebsd.org/changeset/base/213689 Log: Tag xz code as 20101010 Git revision: d52b411716a614c202e89ba732492efb9916cd3f Approved by: delphij (mentor) Added: vendor/xz/20101010/ - copied from r213688, vendor/xz/dist/ From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 13:31:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 290F4106566B; Mon, 11 Oct 2010 13:31:10 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1780E8FC13; Mon, 11 Oct 2010 13:31:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BDV97H016727; Mon, 11 Oct 2010 13:31:09 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BDV9x1016725; Mon, 11 Oct 2010 13:31:09 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201010111331.o9BDV9x1016725@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 11 Oct 2010 13:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213690 - stable/7/usr.bin/truss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 13:31:10 -0000 Author: jh Date: Mon Oct 11 13:31:09 2010 New Revision: 213690 URL: http://svn.freebsd.org/changeset/base/213690 Log: MFC r200752: Avoid sharing the file descriptor of the output file with traced processes by setting the FD_CLOEXEC flag for the output file. PR: bin/140493 Modified: stable/7/usr.bin/truss/main.c Directory Properties: stable/7/usr.bin/truss/ (props changed) Modified: stable/7/usr.bin/truss/main.c ============================================================================== --- stable/7/usr.bin/truss/main.c Mon Oct 11 12:57:41 2010 (r213689) +++ stable/7/usr.bin/truss/main.c Mon Oct 11 13:31:09 2010 (r213690) @@ -231,6 +231,12 @@ main(int ac, char **av) if ((trussinfo->outfile = fopen(fname, "w")) == NULL) errx(1, "cannot open %s", fname); } + /* + * Set FD_CLOEXEC, so that the output file is not shared with + * the traced process. + */ + if (fcntl(fileno(trussinfo->outfile), F_SETFD, FD_CLOEXEC) == -1) + warn("fcntl()"); /* * If truss starts the process itself, it will ignore some signals -- From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 14:31:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFE3A106564A; Mon, 11 Oct 2010 14:31:24 +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 CF3748FC14; Mon, 11 Oct 2010 14:31:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BEVOHE018187; Mon, 11 Oct 2010 14:31:24 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BEVO2i018185; Mon, 11 Oct 2010 14:31:24 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201010111431.o9BEVO2i018185@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 11 Oct 2010 14:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213691 - head/usr.sbin/pmccontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 14:31:25 -0000 Author: gnn Date: Mon Oct 11 14:31:24 2010 New Revision: 213691 URL: http://svn.freebsd.org/changeset/base/213691 Log: Add code to print the number and type of the CPU that is present in the system as well has how many PMCs there are per CPU. In this code CPU and core are equivalent. MFC after: 1 day Modified: head/usr.sbin/pmccontrol/pmccontrol.c Modified: head/usr.sbin/pmccontrol/pmccontrol.c ============================================================================== --- head/usr.sbin/pmccontrol/pmccontrol.c Mon Oct 11 13:31:09 2010 (r213690) +++ head/usr.sbin/pmccontrol/pmccontrol.c Mon Oct 11 14:31:24 2010 (r213691) @@ -243,6 +243,10 @@ pmcc_do_list_state(void) if (pmc_cpuinfo(&pc) != 0) err(EX_OSERR, "Unable to determine CPU information"); + printf("%d %s CPUs present, with %d PMCs per CPU\n", pc->pm_ncpu, + pmc_name_of_cputype(pc->pm_cputype), + pc->pm_npmc); + dummy = sizeof(logical_cpus_mask); if (sysctlbyname("machdep.logical_cpus_mask", &logical_cpus_mask, &dummy, NULL, 0) < 0) From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 15:43:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32F361065679; Mon, 11 Oct 2010 15:43:18 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.swip.net [212.247.154.1]) by mx1.freebsd.org (Postfix) with ESMTP id 223448FC14; Mon, 11 Oct 2010 15:43:16 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=omSrwDgyMf70S47Fr5SNr0rQzcmIOo0IafWlB/wSLLo= c=1 sm=1 a=SuzkwCtJyaUA:10 a=N659UExz7-8A:10 a=Zf7CodC7etEA:10 a=A6tapMhSE0WbTaevTJclhA==:17 a=sMkt9YfjiB3btBwrrWsA:9 a=Zy5N_msr2s7x2ijnH9q-NuLqxA8A:4 a=pILNOxqGKmIA:10 a=A6tapMhSE0WbTaevTJclhA==:117 Received: from [188.126.198.168] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe01.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 34223242; Mon, 11 Oct 2010 17:33:13 +0200 From: Hans Petter Selasky To: Gleb Smirnoff Date: Mon, 11 Oct 2010 17:34:33 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.1-STABLE; KDE/4.4.5; amd64; ; ) References: <201010061429.o96ET0RW006850@svn.freebsd.org> In-Reply-To: <201010061429.o96ET0RW006850@svn.freebsd.org> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201010111734.33836.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r213480 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 15:43:18 -0000 On Wednesday 06 October 2010 16:29:00 Gleb Smirnoff wrote: > +static uint8_t scsi_tct_dummy[4]; Hi, struct bbb_transfer *sc; We already have a dummy receive buffer in sc->buffer. Use that instead of declaring a new one. --HPS From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 16:55:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 797191065679; Mon, 11 Oct 2010 16:55:17 +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 66AD48FC18; Mon, 11 Oct 2010 16:55:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BGtH7Z021177; Mon, 11 Oct 2010 16:55:17 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BGtHZs021174; Mon, 11 Oct 2010 16:55:17 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201010111655.o9BGtHZs021174@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 11 Oct 2010 16:55: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: r213692 - stable/8/lib/libpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 16:55:17 -0000 Author: gnn Date: Mon Oct 11 16:55:17 2010 New Revision: 213692 URL: http://svn.freebsd.org/changeset/base/213692 Log: MFC 213402: Fix punctuation and grammar, mostly by ending sentences with a period. Modified: stable/8/lib/libpmc/pmc.westmere.3 stable/8/lib/libpmc/pmc.westmereuc.3 Directory Properties: stable/8/lib/libpmc/ (props changed) Modified: stable/8/lib/libpmc/pmc.westmere.3 ============================================================================== --- stable/8/lib/libpmc/pmc.westmere.3 Mon Oct 11 14:31:24 2010 (r213691) +++ stable/8/lib/libpmc/pmc.westmere.3 Mon Oct 11 16:55:17 2010 (r213692) @@ -388,7 +388,7 @@ requests include both L1D demand RFO mis .It Li L2_RQSTS.RFOS .Pq Event 24H , Umask 0CH Counts all L2 store RFO requests. L2 RFO requests include both L1D demand -RFO misses as well as L1D RFO prefetches.. +RFO misses as well as L1D RFO prefetches. .It Li L2_RQSTS.IFETCH_HIT .Pq Event 24H , Umask 10H Counts number of instruction fetches that hit the L2 cache. L2 instruction @@ -474,13 +474,13 @@ This is a demand RFO request .It Li L2_WRITE.RFO.S_STATE .Pq Event 27H , Umask 02H Counts number of L2 store RFO requests where the cache line to be loaded is -in the S (shared) state. The L1D prefetcher does not issue a RFO prefetch,. -This is a demand RFO request +in the S (shared) state. The L1D prefetcher does not issue a RFO prefetch. +This is a demand RFO request. .It Li L2_WRITE.RFO.M_STATE .Pq Event 27H , Umask 08H Counts number of L2 store RFO requests where the cache line to be loaded is in the M (modified) state. The L1D prefetcher does not issue a RFO prefetch. -This is a demand RFO request +This is a demand RFO request. .It Li L2_WRITE.RFO.HIT .Pq Event 27H , Umask 0EH Counts number of L2 store RFO requests where the cache line to be loaded is @@ -491,7 +491,7 @@ This is a demand RFO request .Pq Event 27H , Umask 0FH Counts all L2 store RFO requests.The L1D prefetcher does not issue a RFO prefetch. -This is a demand RFO request +This is a demand RFO request. .It Li L2_WRITE.LOCK.I_STATE .Pq Event 27H , Umask 10H Counts number of L2 demand lock RFO requests where the cache line to be @@ -539,13 +539,13 @@ Counts all L1 writebacks to the L2. Counts uncore Last Level Cache references. Because cache hierarchy, cache sizes and other implementation-specific characteristics; value comparison to estimate performance differences is not recommended. -see Table A-1 +See Table A-1. .It Li L3_LAT_CACHE.MISS .Pq Event 2EH , Umask 01H Counts uncore Last Level Cache misses. Because cache hierarchy, cache sizes and other implementation-specific characteristics; value comparison to estimate performance differences is not recommended. -see Table A-1 +See Table A-1. .It Li CPU_CLK_UNHALTED.THREAD_P .Pq Event 3CH , Umask 00H Counts the number of thread cycles while the thread is not in a halt state. @@ -601,16 +601,16 @@ Counts Extended Page walk cycles. .It Li L1D.REPL .Pq Event 51H , Umask 01H Counts the number of lines brought into the L1 data cache. -Counter 0, 1 only +Counter 0, 1 only. .It Li L1D.M_REPL .Pq Event 51H , Umask 02H Counts the number of modified lines brought into the L1 data cache. -Counter 0, 1 only +Counter 0, 1 only. .It Li L1D.M_EVICT .Pq Event 51H , Umask 04H Counts the number of modified lines evicted from the L1 data cache due to replacement. -Counter 0, 1 only +Counter 0, 1 only. .It Li L1D.M_SNOOP_EVICT .Pq Event 51H , Umask 08H Counts the number of modified lines evicted from the L1 data cache due to @@ -628,22 +628,22 @@ accepted into the fill buffer. .Pq Event 60H , Umask 01H Counts weighted cycles of offcore demand data read requests. Does not include L2 prefetch requests. -counter 0 +Counter 0. .It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND.READ_CODE .Pq Event 60H , Umask 02H Counts weighted cycles of offcore demand code read requests. Does not include L2 prefetch requests. -counter 0 +Counter 0. .It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND.RFO .Pq Event 60H , Umask 04H Counts weighted cycles of offcore demand RFO requests. Does not include L2 prefetch requests. -counter 0 +Counter 0. .It Li OFFCORE_REQUESTS_OUTSTANDING.ANY.READ .Pq Event 60H , Umask 08H Counts weighted cycles of offcore read requests of any kind. Include L2 prefetch requests. -counter 0 +Ccounter 0. .It Li CACHE_LOCK_CYCLES.L1D_L2 .Pq Event 63H , Umask 01H Cycle count during which the L1D and L2 are locked. A lock is asserted when @@ -915,7 +915,7 @@ ports. This is a core count only and can .It Li UOPS_EXECUTED.PORT015 .Pq Event B1H , Umask 40H Counts number of Uops executed that where issued on port 0, 1, or 5. -use cmask=1, invert=1 to count stall cycles +Use cmask=1, invert=1 to count stall cycles. .It Li UOPS_EXECUTED.PORT234 .Pq Event B1H , Umask 80H Counts number of Uops executed that where issued on port 2, 3, or 4. @@ -928,18 +928,18 @@ Counts weighted cycles of snoopq request Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS_OUTSTANDING.INVALIDATE .Pq Event B3H , Umask 02H -Counts weighted cycles of snoopq invalidate requests. Counter 0 only +Counts weighted cycles of snoopq invalidate requests. Counter 0 only. Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS_OUTSTANDING.CODE .Pq Event B3H , Umask 04H -Counts weighted cycles of snoopq requests for code. Counter 0 only +Counts weighted cycles of snoopq requests for code. Counter 0 only. Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS.CODE .Pq Event B4H , Umask 01H -Counts the number of snoop code requests +Counts the number of snoop code requests. .It Li SNOOPQ_REQUESTS.DATA .Pq Event B4H , Umask 02H -Counts the number of snoop data requests +Counts the number of snoop data requests. .It Li SNOOPQ_REQUESTS.INVALIDATE .Pq Event B4H , Umask 04H Counts the number of snoop invalidate requests @@ -947,7 +947,7 @@ Counts the number of snoop invalidate re .Pq Event B7H , Umask 01H see Section 30.6.1.3, Off-core Response Performance Monitoring in the Processor Core. -Requires programming MSR 01A6H +Requires programming MSR 01A6H. .It Li SNOOP_RESPONSE.HIT .Pq Event B8H , Umask 01H Counts HIT snoop response sent by this thread in response to a snoop @@ -963,8 +963,8 @@ request. .It Li OFF_CORE_RESPONSE_1 .Pq Event BBH , Umask 01H see Section 30.6.1.3, Off-core Response Performance Monitoring in the -Processor Core -Use MSR 01A7H +Processor Core. +Use MSR 01A7H. .It Li INST_RETIRED.ANY_P .Pq Event C0H , Umask 01H See Table A-1 @@ -1007,21 +1007,21 @@ Counts the number of machine clears due Counts the number of times that a program writes to a code section. Self-modifying code causes a sever penalty in all Intel 64 and IA-32 processors. The modified cache line is written back to the L2 and L3caches. -.It Li BR_INST_RETIRED.ALL_BRANCHES +.It Li BR_INST_RETIRED.ANY_P .Pq Event C4H , Umask 00H -See Table A-1 +See Table A-1. .It Li BR_INST_RETIRED.CONDITIONAL .Pq Event C4H , Umask 01H Counts the number of conditional branch instructions retired. .It Li BR_INST_RETIRED.NEAR_CALL .Pq Event C4H , Umask 02H -Counts the number of direct & indirect near unconditional calls retired +Counts the number of direct & indirect near unconditional calls retired. .It Li BR_INST_RETIRED.ALL_BRANCHES .Pq Event C4H , Umask 04H -Counts the number of branch instructions retired -.It Li BR_MISP_RETIRED.ALL_BRANCHES +Counts the number of branch instructions retired. +.It Li BR_MISP_RETIRED.ANY_P .Pq Event C5H , Umask 00H -See Table A-1 +See Table A-1. .It Li BR_MISP_RETIRED.CONDITIONAL .Pq Event C5H , Umask 01H Counts mispredicted conditional retired calls. Modified: stable/8/lib/libpmc/pmc.westmereuc.3 ============================================================================== --- stable/8/lib/libpmc/pmc.westmereuc.3 Mon Oct 11 14:31:24 2010 (r213691) +++ stable/8/lib/libpmc/pmc.westmereuc.3 Mon Oct 11 16:55:17 2010 (r213692) @@ -267,10 +267,10 @@ Number of responses to code or data read has the referenced line cached in the M state. .It Li SNP_RESP_TO_REMOTE_HOME.HITM .Pq Event 07H , Umask 24H -Number of HITM snoop responses to a remote home +Number of HITM snoop responses to a remote home. .It Li L3_HITS.READ .Pq Event 08H , Umask 01H -Number of code read, data read and RFO requests that hit in the L3 +Number of code read, data read and RFO requests that hit in the L3. .It Li L3_HITS.WRITE .Pq Event 08H , Umask 02H Number of writeback requests that hit in the L3. Writebacks from the cores @@ -715,7 +715,7 @@ qualified by mask value written to MSR 3 supported: 0: NONE 40000000_00000000H:RSPFWDI 40001A00_00000000H:RSPFWDS 40001D00_00000000H:RSPIWB -Match opcode/addres s by writing MSR 396H with mask supported mask value +Match opcode/address by writing MSR 396H with mask supported mask value. .It Li ADDR_OPCODE_MATCH.REMOTE .Pq Event 35H , Umask 02H Counts number of requests from the remote socket, address/opcode of request @@ -723,7 +723,7 @@ is qualified by mask value written to MS are supported: 0: NONE 40000000_00000000H:RSPFWDI 40001A00_00000000H:RSPFWDS 40001D00_00000000H:RSPIWB -Match opcode/addres s by writing MSR 396H with mask supported mask value +Match opcode/address by writing MSR 396H with mask supported mask value. .It Li ADDR_OPCODE_MATCH.LOCAL .Pq Event 35H , Umask 04H Counts number of requests from the local socket, address/opcode of request @@ -731,7 +731,7 @@ is qualified by mask value written to MS are supported: 0: NONE 40000000_00000000H:RSPFWDI 40001A00_00000000H:RSPFWDS 40001D00_00000000H:RSPIWB -Match opcode/addres s by writing MSR 396H with mask supported mask value +Match opcode/address by writing MSR 396H with mask supported mask value. .It Li QPI_TX_STALLED_SINGLE_FLIT.HOME.LINK_0 .Pq Event 40H , Umask 01H Counts cycles the Quickpath outbound link 0 HOME virtual channel is stalled From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 16:57:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8BDD106564A; Mon, 11 Oct 2010 16:57:02 +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 B64588FC13; Mon, 11 Oct 2010 16:57:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BGv216021262; Mon, 11 Oct 2010 16:57:02 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BGv2ax021259; Mon, 11 Oct 2010 16:57:02 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201010111657.o9BGv2ax021259@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 11 Oct 2010 16:57:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213693 - stable/7/lib/libpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 16:57:02 -0000 Author: gnn Date: Mon Oct 11 16:57:02 2010 New Revision: 213693 URL: http://svn.freebsd.org/changeset/base/213693 Log: MFC 213402: Fix punctuation and grammar, mostly by ending sentences with a period. Modified: stable/7/lib/libpmc/pmc.westmere.3 stable/7/lib/libpmc/pmc.westmereuc.3 Directory Properties: stable/7/lib/libpmc/ (props changed) Modified: stable/7/lib/libpmc/pmc.westmere.3 ============================================================================== --- stable/7/lib/libpmc/pmc.westmere.3 Mon Oct 11 16:55:17 2010 (r213692) +++ stable/7/lib/libpmc/pmc.westmere.3 Mon Oct 11 16:57:02 2010 (r213693) @@ -388,7 +388,7 @@ requests include both L1D demand RFO mis .It Li L2_RQSTS.RFOS .Pq Event 24H , Umask 0CH Counts all L2 store RFO requests. L2 RFO requests include both L1D demand -RFO misses as well as L1D RFO prefetches.. +RFO misses as well as L1D RFO prefetches. .It Li L2_RQSTS.IFETCH_HIT .Pq Event 24H , Umask 10H Counts number of instruction fetches that hit the L2 cache. L2 instruction @@ -474,13 +474,13 @@ This is a demand RFO request .It Li L2_WRITE.RFO.S_STATE .Pq Event 27H , Umask 02H Counts number of L2 store RFO requests where the cache line to be loaded is -in the S (shared) state. The L1D prefetcher does not issue a RFO prefetch,. -This is a demand RFO request +in the S (shared) state. The L1D prefetcher does not issue a RFO prefetch. +This is a demand RFO request. .It Li L2_WRITE.RFO.M_STATE .Pq Event 27H , Umask 08H Counts number of L2 store RFO requests where the cache line to be loaded is in the M (modified) state. The L1D prefetcher does not issue a RFO prefetch. -This is a demand RFO request +This is a demand RFO request. .It Li L2_WRITE.RFO.HIT .Pq Event 27H , Umask 0EH Counts number of L2 store RFO requests where the cache line to be loaded is @@ -491,7 +491,7 @@ This is a demand RFO request .Pq Event 27H , Umask 0FH Counts all L2 store RFO requests.The L1D prefetcher does not issue a RFO prefetch. -This is a demand RFO request +This is a demand RFO request. .It Li L2_WRITE.LOCK.I_STATE .Pq Event 27H , Umask 10H Counts number of L2 demand lock RFO requests where the cache line to be @@ -539,13 +539,13 @@ Counts all L1 writebacks to the L2. Counts uncore Last Level Cache references. Because cache hierarchy, cache sizes and other implementation-specific characteristics; value comparison to estimate performance differences is not recommended. -see Table A-1 +See Table A-1. .It Li L3_LAT_CACHE.MISS .Pq Event 2EH , Umask 01H Counts uncore Last Level Cache misses. Because cache hierarchy, cache sizes and other implementation-specific characteristics; value comparison to estimate performance differences is not recommended. -see Table A-1 +See Table A-1. .It Li CPU_CLK_UNHALTED.THREAD_P .Pq Event 3CH , Umask 00H Counts the number of thread cycles while the thread is not in a halt state. @@ -601,16 +601,16 @@ Counts Extended Page walk cycles. .It Li L1D.REPL .Pq Event 51H , Umask 01H Counts the number of lines brought into the L1 data cache. -Counter 0, 1 only +Counter 0, 1 only. .It Li L1D.M_REPL .Pq Event 51H , Umask 02H Counts the number of modified lines brought into the L1 data cache. -Counter 0, 1 only +Counter 0, 1 only. .It Li L1D.M_EVICT .Pq Event 51H , Umask 04H Counts the number of modified lines evicted from the L1 data cache due to replacement. -Counter 0, 1 only +Counter 0, 1 only. .It Li L1D.M_SNOOP_EVICT .Pq Event 51H , Umask 08H Counts the number of modified lines evicted from the L1 data cache due to @@ -628,22 +628,22 @@ accepted into the fill buffer. .Pq Event 60H , Umask 01H Counts weighted cycles of offcore demand data read requests. Does not include L2 prefetch requests. -counter 0 +Counter 0. .It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND.READ_CODE .Pq Event 60H , Umask 02H Counts weighted cycles of offcore demand code read requests. Does not include L2 prefetch requests. -counter 0 +Counter 0. .It Li OFFCORE_REQUESTS_OUTSTANDING.DEMAND.RFO .Pq Event 60H , Umask 04H Counts weighted cycles of offcore demand RFO requests. Does not include L2 prefetch requests. -counter 0 +Counter 0. .It Li OFFCORE_REQUESTS_OUTSTANDING.ANY.READ .Pq Event 60H , Umask 08H Counts weighted cycles of offcore read requests of any kind. Include L2 prefetch requests. -counter 0 +Ccounter 0. .It Li CACHE_LOCK_CYCLES.L1D_L2 .Pq Event 63H , Umask 01H Cycle count during which the L1D and L2 are locked. A lock is asserted when @@ -915,7 +915,7 @@ ports. This is a core count only and can .It Li UOPS_EXECUTED.PORT015 .Pq Event B1H , Umask 40H Counts number of Uops executed that where issued on port 0, 1, or 5. -use cmask=1, invert=1 to count stall cycles +Use cmask=1, invert=1 to count stall cycles. .It Li UOPS_EXECUTED.PORT234 .Pq Event B1H , Umask 80H Counts number of Uops executed that where issued on port 2, 3, or 4. @@ -928,18 +928,18 @@ Counts weighted cycles of snoopq request Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS_OUTSTANDING.INVALIDATE .Pq Event B3H , Umask 02H -Counts weighted cycles of snoopq invalidate requests. Counter 0 only +Counts weighted cycles of snoopq invalidate requests. Counter 0 only. Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS_OUTSTANDING.CODE .Pq Event B3H , Umask 04H -Counts weighted cycles of snoopq requests for code. Counter 0 only +Counts weighted cycles of snoopq requests for code. Counter 0 only. Use cmask=1 to count cycles not empty. .It Li SNOOPQ_REQUESTS.CODE .Pq Event B4H , Umask 01H -Counts the number of snoop code requests +Counts the number of snoop code requests. .It Li SNOOPQ_REQUESTS.DATA .Pq Event B4H , Umask 02H -Counts the number of snoop data requests +Counts the number of snoop data requests. .It Li SNOOPQ_REQUESTS.INVALIDATE .Pq Event B4H , Umask 04H Counts the number of snoop invalidate requests @@ -947,7 +947,7 @@ Counts the number of snoop invalidate re .Pq Event B7H , Umask 01H see Section 30.6.1.3, Off-core Response Performance Monitoring in the Processor Core. -Requires programming MSR 01A6H +Requires programming MSR 01A6H. .It Li SNOOP_RESPONSE.HIT .Pq Event B8H , Umask 01H Counts HIT snoop response sent by this thread in response to a snoop @@ -963,8 +963,8 @@ request. .It Li OFF_CORE_RESPONSE_1 .Pq Event BBH , Umask 01H see Section 30.6.1.3, Off-core Response Performance Monitoring in the -Processor Core -Use MSR 01A7H +Processor Core. +Use MSR 01A7H. .It Li INST_RETIRED.ANY_P .Pq Event C0H , Umask 01H See Table A-1 @@ -1007,21 +1007,21 @@ Counts the number of machine clears due Counts the number of times that a program writes to a code section. Self-modifying code causes a sever penalty in all Intel 64 and IA-32 processors. The modified cache line is written back to the L2 and L3caches. -.It Li BR_INST_RETIRED.ALL_BRANCHES +.It Li BR_INST_RETIRED.ANY_P .Pq Event C4H , Umask 00H -See Table A-1 +See Table A-1. .It Li BR_INST_RETIRED.CONDITIONAL .Pq Event C4H , Umask 01H Counts the number of conditional branch instructions retired. .It Li BR_INST_RETIRED.NEAR_CALL .Pq Event C4H , Umask 02H -Counts the number of direct & indirect near unconditional calls retired +Counts the number of direct & indirect near unconditional calls retired. .It Li BR_INST_RETIRED.ALL_BRANCHES .Pq Event C4H , Umask 04H -Counts the number of branch instructions retired -.It Li BR_MISP_RETIRED.ALL_BRANCHES +Counts the number of branch instructions retired. +.It Li BR_MISP_RETIRED.ANY_P .Pq Event C5H , Umask 00H -See Table A-1 +See Table A-1. .It Li BR_MISP_RETIRED.CONDITIONAL .Pq Event C5H , Umask 01H Counts mispredicted conditional retired calls. Modified: stable/7/lib/libpmc/pmc.westmereuc.3 ============================================================================== --- stable/7/lib/libpmc/pmc.westmereuc.3 Mon Oct 11 16:55:17 2010 (r213692) +++ stable/7/lib/libpmc/pmc.westmereuc.3 Mon Oct 11 16:57:02 2010 (r213693) @@ -267,10 +267,10 @@ Number of responses to code or data read has the referenced line cached in the M state. .It Li SNP_RESP_TO_REMOTE_HOME.HITM .Pq Event 07H , Umask 24H -Number of HITM snoop responses to a remote home +Number of HITM snoop responses to a remote home. .It Li L3_HITS.READ .Pq Event 08H , Umask 01H -Number of code read, data read and RFO requests that hit in the L3 +Number of code read, data read and RFO requests that hit in the L3. .It Li L3_HITS.WRITE .Pq Event 08H , Umask 02H Number of writeback requests that hit in the L3. Writebacks from the cores From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 17:18:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7879B1065670; Mon, 11 Oct 2010 17:18:23 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 674578FC0A; Mon, 11 Oct 2010 17:18:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BHINtO021766; Mon, 11 Oct 2010 17:18:23 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BHINX6021762; Mon, 11 Oct 2010 17:18:23 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010111718.o9BHINX6021762@svn.freebsd.org> From: Rui Paulo Date: Mon, 11 Oct 2010 17:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213694 - in head/contrib/llvm/tools/clang: include/clang/Analysis/Analyses lib/Analysis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 17:18:23 -0000 Author: rpaulo Date: Mon Oct 11 17:18:23 2010 New Revision: 213694 URL: http://svn.freebsd.org/changeset/base/213694 Log: Rework the analysis of the 'r' specifier. It turns out that we can't make it like xArg because they are different ('x' doesn't accept sign, but 'r' does). This fixes some warnings when building DDB with clang. With help from: rdivacky Modified: head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/FormatString.h head/contrib/llvm/tools/clang/lib/Analysis/FormatString.cpp head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp Modified: head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/FormatString.h ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/FormatString.h Mon Oct 11 16:57:02 2010 (r213693) +++ head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/FormatString.h Mon Oct 11 17:18:23 2010 (r213694) @@ -147,6 +147,7 @@ public: // FreeBSD specific specifiers bArg, DArg, + rArg, // GlibC specific specifiers. PrintErrno, // 'm' Modified: head/contrib/llvm/tools/clang/lib/Analysis/FormatString.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Analysis/FormatString.cpp Mon Oct 11 16:57:02 2010 (r213693) +++ head/contrib/llvm/tools/clang/lib/Analysis/FormatString.cpp Mon Oct 11 17:18:23 2010 (r213694) @@ -423,6 +423,7 @@ bool FormatSpecifier::hasValidLengthModi case ConversionSpecifier::xArg: case ConversionSpecifier::XArg: case ConversionSpecifier::nArg: + case ConversionSpecifier::rArg: return true; default: return false; @@ -448,6 +449,7 @@ bool FormatSpecifier::hasValidLengthModi case ConversionSpecifier::nArg: case ConversionSpecifier::cArg: case ConversionSpecifier::sArg: + case ConversionSpecifier::rArg: return true; default: return false; Modified: head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp Mon Oct 11 16:57:02 2010 (r213693) +++ head/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp Mon Oct 11 17:18:23 2010 (r213694) @@ -195,7 +195,7 @@ static PrintfSpecifierResult ParsePrintf case 'm': k = ConversionSpecifier::PrintErrno; break; // FreeBSD format extensions case 'b': if (FormatExtensions) k = ConversionSpecifier::bArg; break; /* check for int and then char * */ - case 'r': if (FormatExtensions) k = ConversionSpecifier::xArg; break; + case 'r': if (FormatExtensions) k = ConversionSpecifier::rArg; break; case 'y': if (FormatExtensions) k = ConversionSpecifier::iArg; break; case 'D': if (FormatExtensions) k = ConversionSpecifier::DArg; break; /* check for u_char * pointer and a char * string */ } @@ -279,6 +279,7 @@ const char *ConversionSpecifier::toStrin // FreeBSD specific specifiers. case bArg: return "b"; case DArg: return "D"; + case rArg: return "r"; // GlibC specific specifiers. case PrintErrno: return "m"; @@ -491,6 +492,7 @@ bool PrintfSpecifier::hasValidPlusPrefix case ConversionSpecifier::GArg: case ConversionSpecifier::aArg: case ConversionSpecifier::AArg: + case ConversionSpecifier::rArg: return true; default: @@ -514,6 +516,7 @@ bool PrintfSpecifier::hasValidAlternativ case ConversionSpecifier::FArg: case ConversionSpecifier::gArg: case ConversionSpecifier::GArg: + case ConversionSpecifier::rArg: return true; default: From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 17:22:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D7ED106564A; Mon, 11 Oct 2010 17:22:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDBC88FC12; Mon, 11 Oct 2010 17:22:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BHMGxN021902; Mon, 11 Oct 2010 17:22:16 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BHMGfV021901; Mon, 11 Oct 2010 17:22:16 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201010111722.o9BHMGfV021901@svn.freebsd.org> From: Dimitry Andric Date: Mon, 11 Oct 2010 17:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213695 - in head/contrib/llvm: . autoconf bindings include/llvm include/llvm/Config include/llvm/System lib lib/Analysis lib/Analysis/IPA lib/Archive lib/AsmParser lib/Bitcode lib/Bitc... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 17:22:17 -0000 Author: dim Date: Mon Oct 11 17:22:16 2010 New Revision: 213695 URL: http://svn.freebsd.org/changeset/base/213695 Log: Remove more unneeded files and directories from contrib/llvm. This still allows us to build tblgen and clang, and further reduces the footprint in the tree. Approved by: rpaulo (mentor) Deleted: head/contrib/llvm/CMakeLists.txt head/contrib/llvm/CREDITS.TXT head/contrib/llvm/LICENSE.TXT head/contrib/llvm/Makefile head/contrib/llvm/Makefile.common head/contrib/llvm/Makefile.config.in head/contrib/llvm/Makefile.rules head/contrib/llvm/ModuleInfo.txt head/contrib/llvm/README.txt head/contrib/llvm/autoconf/ head/contrib/llvm/bindings/ head/contrib/llvm/build-for-llvm-top.sh head/contrib/llvm/configure head/contrib/llvm/include/llvm/CMakeLists.txt head/contrib/llvm/include/llvm/Config/ head/contrib/llvm/include/llvm/System/DataTypes.h.cmake head/contrib/llvm/include/llvm/System/DataTypes.h.in head/contrib/llvm/include/llvm/System/LICENSE.TXT head/contrib/llvm/lib/Analysis/CMakeLists.txt head/contrib/llvm/lib/Analysis/IPA/CMakeLists.txt head/contrib/llvm/lib/Analysis/IPA/Makefile head/contrib/llvm/lib/Analysis/Makefile head/contrib/llvm/lib/Analysis/README.txt head/contrib/llvm/lib/Archive/CMakeLists.txt head/contrib/llvm/lib/Archive/Makefile head/contrib/llvm/lib/AsmParser/CMakeLists.txt head/contrib/llvm/lib/AsmParser/Makefile head/contrib/llvm/lib/Bitcode/Makefile head/contrib/llvm/lib/Bitcode/Reader/CMakeLists.txt head/contrib/llvm/lib/Bitcode/Reader/Makefile head/contrib/llvm/lib/Bitcode/Writer/CMakeLists.txt head/contrib/llvm/lib/Bitcode/Writer/Makefile head/contrib/llvm/lib/CodeGen/AsmPrinter/CMakeLists.txt head/contrib/llvm/lib/CodeGen/AsmPrinter/Makefile head/contrib/llvm/lib/CodeGen/CMakeLists.txt head/contrib/llvm/lib/CodeGen/Makefile head/contrib/llvm/lib/CodeGen/README.txt head/contrib/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt head/contrib/llvm/lib/CodeGen/SelectionDAG/Makefile head/contrib/llvm/lib/CompilerDriver/CMakeLists.txt head/contrib/llvm/lib/CompilerDriver/Makefile head/contrib/llvm/lib/ExecutionEngine/CMakeLists.txt head/contrib/llvm/lib/ExecutionEngine/Interpreter/CMakeLists.txt head/contrib/llvm/lib/ExecutionEngine/Interpreter/Makefile head/contrib/llvm/lib/ExecutionEngine/JIT/CMakeLists.txt head/contrib/llvm/lib/ExecutionEngine/JIT/Makefile head/contrib/llvm/lib/ExecutionEngine/Makefile head/contrib/llvm/lib/Linker/CMakeLists.txt head/contrib/llvm/lib/Linker/Makefile head/contrib/llvm/lib/MC/CMakeLists.txt head/contrib/llvm/lib/MC/MCDisassembler/CMakeLists.txt head/contrib/llvm/lib/MC/MCDisassembler/Makefile head/contrib/llvm/lib/MC/MCParser/CMakeLists.txt head/contrib/llvm/lib/MC/MCParser/Makefile head/contrib/llvm/lib/MC/Makefile head/contrib/llvm/lib/Makefile head/contrib/llvm/lib/Support/CMakeLists.txt head/contrib/llvm/lib/Support/COPYRIGHT.regex head/contrib/llvm/lib/Support/Makefile head/contrib/llvm/lib/System/CMakeLists.txt head/contrib/llvm/lib/System/Makefile head/contrib/llvm/lib/System/README.txt head/contrib/llvm/lib/System/Unix/README.txt head/contrib/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt head/contrib/llvm/lib/Target/ARM/AsmParser/Makefile head/contrib/llvm/lib/Target/ARM/AsmPrinter/CMakeLists.txt head/contrib/llvm/lib/Target/ARM/AsmPrinter/Makefile head/contrib/llvm/lib/Target/ARM/CMakeLists.txt head/contrib/llvm/lib/Target/ARM/Disassembler/Makefile head/contrib/llvm/lib/Target/ARM/Makefile head/contrib/llvm/lib/Target/ARM/README-Thumb.txt head/contrib/llvm/lib/Target/ARM/README-Thumb2.txt head/contrib/llvm/lib/Target/ARM/README.txt head/contrib/llvm/lib/Target/ARM/TargetInfo/CMakeLists.txt head/contrib/llvm/lib/Target/ARM/TargetInfo/Makefile head/contrib/llvm/lib/Target/Alpha/AsmPrinter/CMakeLists.txt head/contrib/llvm/lib/Target/Alpha/AsmPrinter/Makefile head/contrib/llvm/lib/Target/Alpha/CMakeLists.txt head/contrib/llvm/lib/Target/Alpha/Makefile head/contrib/llvm/lib/Target/Alpha/README.txt head/contrib/llvm/lib/Target/Alpha/TargetInfo/CMakeLists.txt head/contrib/llvm/lib/Target/Alpha/TargetInfo/Makefile head/contrib/llvm/lib/Target/Blackfin/AsmPrinter/CMakeLists.txt head/contrib/llvm/lib/Target/Blackfin/AsmPrinter/Makefile head/contrib/llvm/lib/Target/Blackfin/CMakeLists.txt head/contrib/llvm/lib/Target/Blackfin/Makefile head/contrib/llvm/lib/Target/Blackfin/README.txt head/contrib/llvm/lib/Target/Blackfin/TargetInfo/CMakeLists.txt head/contrib/llvm/lib/Target/Blackfin/TargetInfo/Makefile head/contrib/llvm/lib/Target/CBackend/CMakeLists.txt head/contrib/llvm/lib/Target/CBackend/Makefile head/contrib/llvm/lib/Target/CBackend/TargetInfo/CMakeLists.txt head/contrib/llvm/lib/Target/CBackend/TargetInfo/Makefile head/contrib/llvm/lib/Target/CMakeLists.txt head/contrib/llvm/lib/Target/CellSPU/AsmPrinter/CMakeLists.txt head/contrib/llvm/lib/Target/CellSPU/AsmPrinter/Makefile head/contrib/llvm/lib/Target/CellSPU/CMakeLists.txt head/contrib/llvm/lib/Target/CellSPU/Makefile head/contrib/llvm/lib/Target/CellSPU/README.txt head/contrib/llvm/lib/Target/CellSPU/TargetInfo/CMakeLists.txt head/contrib/llvm/lib/Target/CellSPU/TargetInfo/Makefile head/contrib/llvm/lib/Target/CppBackend/CMakeLists.txt head/contrib/llvm/lib/Target/CppBackend/Makefile head/contrib/llvm/lib/Target/CppBackend/TargetInfo/CMakeLists.txt head/contrib/llvm/lib/Target/CppBackend/TargetInfo/Makefile head/contrib/llvm/lib/Target/MBlaze/AsmPrinter/CMakeLists.txt head/contrib/llvm/lib/Target/MBlaze/AsmPrinter/Makefile head/contrib/llvm/lib/Target/MBlaze/CMakeLists.txt head/contrib/llvm/lib/Target/MBlaze/Makefile head/contrib/llvm/lib/Target/MBlaze/TargetInfo/CMakeLists.txt head/contrib/llvm/lib/Target/MBlaze/TargetInfo/Makefile head/contrib/llvm/lib/Target/MSP430/AsmPrinter/CMakeLists.txt head/contrib/llvm/lib/Target/MSP430/AsmPrinter/Makefile head/contrib/llvm/lib/Target/MSP430/CMakeLists.txt head/contrib/llvm/lib/Target/MSP430/Makefile head/contrib/llvm/lib/Target/MSP430/README.txt head/contrib/llvm/lib/Target/MSP430/TargetInfo/CMakeLists.txt head/contrib/llvm/lib/Target/MSP430/TargetInfo/Makefile head/contrib/llvm/lib/Target/Makefile head/contrib/llvm/lib/Target/Mips/AsmPrinter/CMakeLists.txt head/contrib/llvm/lib/Target/Mips/AsmPrinter/Makefile head/contrib/llvm/lib/Target/Mips/CMakeLists.txt head/contrib/llvm/lib/Target/Mips/Makefile head/contrib/llvm/lib/Target/Mips/TargetInfo/CMakeLists.txt head/contrib/llvm/lib/Target/Mips/TargetInfo/Makefile head/contrib/llvm/lib/Target/PIC16/AsmPrinter/CMakeLists.txt head/contrib/llvm/lib/Target/PIC16/AsmPrinter/Makefile head/contrib/llvm/lib/Target/PIC16/CMakeLists.txt head/contrib/llvm/lib/Target/PIC16/Makefile head/contrib/llvm/lib/Target/PIC16/PIC16Passes/Makefile head/contrib/llvm/lib/Target/PIC16/TargetInfo/CMakeLists.txt head/contrib/llvm/lib/Target/PIC16/TargetInfo/Makefile head/contrib/llvm/lib/Target/PowerPC/AsmPrinter/CMakeLists.txt head/contrib/llvm/lib/Target/PowerPC/AsmPrinter/Makefile head/contrib/llvm/lib/Target/PowerPC/CMakeLists.txt head/contrib/llvm/lib/Target/PowerPC/Makefile head/contrib/llvm/lib/Target/PowerPC/README.txt head/contrib/llvm/lib/Target/PowerPC/README_ALTIVEC.txt head/contrib/llvm/lib/Target/PowerPC/TargetInfo/CMakeLists.txt head/contrib/llvm/lib/Target/PowerPC/TargetInfo/Makefile head/contrib/llvm/lib/Target/README.txt head/contrib/llvm/lib/Target/Sparc/AsmPrinter/CMakeLists.txt head/contrib/llvm/lib/Target/Sparc/AsmPrinter/Makefile head/contrib/llvm/lib/Target/Sparc/CMakeLists.txt head/contrib/llvm/lib/Target/Sparc/Makefile head/contrib/llvm/lib/Target/Sparc/README.txt head/contrib/llvm/lib/Target/Sparc/TargetInfo/CMakeLists.txt head/contrib/llvm/lib/Target/Sparc/TargetInfo/Makefile head/contrib/llvm/lib/Target/SystemZ/AsmPrinter/CMakeLists.txt head/contrib/llvm/lib/Target/SystemZ/AsmPrinter/Makefile head/contrib/llvm/lib/Target/SystemZ/CMakeLists.txt head/contrib/llvm/lib/Target/SystemZ/Makefile head/contrib/llvm/lib/Target/SystemZ/TargetInfo/CMakeLists.txt head/contrib/llvm/lib/Target/SystemZ/TargetInfo/Makefile head/contrib/llvm/lib/Target/X86/AsmParser/CMakeLists.txt head/contrib/llvm/lib/Target/X86/AsmParser/Makefile head/contrib/llvm/lib/Target/X86/AsmPrinter/CMakeLists.txt head/contrib/llvm/lib/Target/X86/AsmPrinter/Makefile head/contrib/llvm/lib/Target/X86/CMakeLists.txt head/contrib/llvm/lib/Target/X86/Disassembler/CMakeLists.txt head/contrib/llvm/lib/Target/X86/Disassembler/Makefile head/contrib/llvm/lib/Target/X86/Makefile head/contrib/llvm/lib/Target/X86/README-FPStack.txt head/contrib/llvm/lib/Target/X86/README-MMX.txt head/contrib/llvm/lib/Target/X86/README-SSE.txt head/contrib/llvm/lib/Target/X86/README-UNIMPLEMENTED.txt head/contrib/llvm/lib/Target/X86/README-X86-64.txt head/contrib/llvm/lib/Target/X86/README.txt head/contrib/llvm/lib/Target/X86/TargetInfo/CMakeLists.txt head/contrib/llvm/lib/Target/X86/TargetInfo/Makefile head/contrib/llvm/lib/Target/X86/X86CompilationCallback_Win64.asm head/contrib/llvm/lib/Target/XCore/AsmPrinter/CMakeLists.txt head/contrib/llvm/lib/Target/XCore/AsmPrinter/Makefile head/contrib/llvm/lib/Target/XCore/CMakeLists.txt head/contrib/llvm/lib/Target/XCore/Makefile head/contrib/llvm/lib/Target/XCore/README.txt head/contrib/llvm/lib/Target/XCore/TargetInfo/CMakeLists.txt head/contrib/llvm/lib/Target/XCore/TargetInfo/Makefile head/contrib/llvm/lib/Transforms/Hello/ head/contrib/llvm/lib/Transforms/IPO/CMakeLists.txt head/contrib/llvm/lib/Transforms/IPO/Makefile head/contrib/llvm/lib/Transforms/InstCombine/CMakeLists.txt head/contrib/llvm/lib/Transforms/InstCombine/Makefile head/contrib/llvm/lib/Transforms/Instrumentation/CMakeLists.txt head/contrib/llvm/lib/Transforms/Instrumentation/Makefile head/contrib/llvm/lib/Transforms/Makefile head/contrib/llvm/lib/Transforms/Scalar/CMakeLists.txt head/contrib/llvm/lib/Transforms/Scalar/Makefile head/contrib/llvm/lib/Transforms/Utils/CMakeLists.txt head/contrib/llvm/lib/Transforms/Utils/Makefile head/contrib/llvm/lib/VMCore/CMakeLists.txt head/contrib/llvm/lib/VMCore/Makefile head/contrib/llvm/llvm.spec.in head/contrib/llvm/runtime/ head/contrib/llvm/tools/CMakeLists.txt head/contrib/llvm/tools/Makefile head/contrib/llvm/tools/bugpoint/ head/contrib/llvm/tools/bugpoint-passes/ head/contrib/llvm/tools/clang/CMakeLists.txt head/contrib/llvm/tools/clang/INSTALL.txt head/contrib/llvm/tools/clang/LICENSE.TXT head/contrib/llvm/tools/clang/Makefile head/contrib/llvm/tools/clang/ModuleInfo.txt head/contrib/llvm/tools/clang/NOTES.txt head/contrib/llvm/tools/clang/README.txt head/contrib/llvm/tools/clang/TODO.txt head/contrib/llvm/tools/clang/bindings/ head/contrib/llvm/tools/clang/include/CMakeLists.txt head/contrib/llvm/tools/clang/include/Makefile head/contrib/llvm/tools/clang/include/clang-c/Makefile head/contrib/llvm/tools/clang/include/clang/AST/CMakeLists.txt head/contrib/llvm/tools/clang/include/clang/AST/Makefile head/contrib/llvm/tools/clang/include/clang/Basic/CMakeLists.txt head/contrib/llvm/tools/clang/include/clang/Basic/Makefile head/contrib/llvm/tools/clang/include/clang/Basic/Version.inc.in head/contrib/llvm/tools/clang/include/clang/CMakeLists.txt head/contrib/llvm/tools/clang/include/clang/Driver/CMakeLists.txt head/contrib/llvm/tools/clang/include/clang/Driver/Makefile head/contrib/llvm/tools/clang/include/clang/Makefile head/contrib/llvm/tools/clang/include/clang/Serialization/CMakeLists.txt head/contrib/llvm/tools/clang/include/clang/Serialization/Makefile head/contrib/llvm/tools/clang/lib/AST/CMakeLists.txt head/contrib/llvm/tools/clang/lib/AST/Makefile head/contrib/llvm/tools/clang/lib/Analysis/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Analysis/Makefile head/contrib/llvm/tools/clang/lib/Basic/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Basic/Makefile head/contrib/llvm/tools/clang/lib/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Checker/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Checker/Makefile head/contrib/llvm/tools/clang/lib/CodeGen/CMakeLists.txt head/contrib/llvm/tools/clang/lib/CodeGen/Makefile head/contrib/llvm/tools/clang/lib/CodeGen/README.txt head/contrib/llvm/tools/clang/lib/Driver/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Driver/Makefile head/contrib/llvm/tools/clang/lib/Frontend/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Frontend/Makefile head/contrib/llvm/tools/clang/lib/FrontendTool/CMakeLists.txt head/contrib/llvm/tools/clang/lib/FrontendTool/Makefile head/contrib/llvm/tools/clang/lib/Headers/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Headers/Makefile head/contrib/llvm/tools/clang/lib/Index/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Index/Makefile head/contrib/llvm/tools/clang/lib/Lex/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Lex/Makefile head/contrib/llvm/tools/clang/lib/Makefile head/contrib/llvm/tools/clang/lib/Parse/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Parse/Makefile head/contrib/llvm/tools/clang/lib/Rewrite/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Rewrite/Makefile head/contrib/llvm/tools/clang/lib/Sema/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Sema/Makefile head/contrib/llvm/tools/clang/lib/Serialization/CMakeLists.txt head/contrib/llvm/tools/clang/lib/Serialization/Makefile head/contrib/llvm/tools/clang/runtime/ head/contrib/llvm/tools/clang/tools/CMakeLists.txt head/contrib/llvm/tools/clang/tools/Makefile head/contrib/llvm/tools/clang/tools/c-index-test/ head/contrib/llvm/tools/clang/tools/driver/CMakeLists.txt head/contrib/llvm/tools/clang/tools/driver/Info.plist.in head/contrib/llvm/tools/clang/tools/driver/Makefile head/contrib/llvm/tools/clang/tools/libclang/ head/contrib/llvm/tools/clang/tools/scan-build/ head/contrib/llvm/tools/clang/tools/scan-view/ head/contrib/llvm/tools/clang/utils/ head/contrib/llvm/tools/edis/ head/contrib/llvm/tools/gold/ head/contrib/llvm/tools/llc/ head/contrib/llvm/tools/lli/ head/contrib/llvm/tools/llvm-ar/ head/contrib/llvm/tools/llvm-as/ head/contrib/llvm/tools/llvm-bcanalyzer/ head/contrib/llvm/tools/llvm-config/ head/contrib/llvm/tools/llvm-diff/ head/contrib/llvm/tools/llvm-dis/ head/contrib/llvm/tools/llvm-extract/ head/contrib/llvm/tools/llvm-ld/ head/contrib/llvm/tools/llvm-link/ head/contrib/llvm/tools/llvm-mc/ head/contrib/llvm/tools/llvm-nm/ head/contrib/llvm/tools/llvm-prof/ head/contrib/llvm/tools/llvm-ranlib/ head/contrib/llvm/tools/llvm-shlib/ head/contrib/llvm/tools/llvm-stub/ head/contrib/llvm/tools/llvmc/ head/contrib/llvm/tools/lto/ head/contrib/llvm/tools/opt/ head/contrib/llvm/utils/DSAclean.py head/contrib/llvm/utils/DSAextract.py head/contrib/llvm/utils/FileCheck/ head/contrib/llvm/utils/FileUpdate/ head/contrib/llvm/utils/GenLibDeps.pl head/contrib/llvm/utils/GetSourceVersion head/contrib/llvm/utils/Makefile head/contrib/llvm/utils/Misc/ head/contrib/llvm/utils/NLT.schema head/contrib/llvm/utils/NewNightlyTest.pl head/contrib/llvm/utils/NightlyTest.gnuplot head/contrib/llvm/utils/NightlyTestTemplate.html head/contrib/llvm/utils/OldenDataRecover.pl head/contrib/llvm/utils/PerfectShuffle/ head/contrib/llvm/utils/TableGen/CMakeLists.txt head/contrib/llvm/utils/TableGen/Makefile head/contrib/llvm/utils/UpdateCMakeLists.pl head/contrib/llvm/utils/bugpoint/ head/contrib/llvm/utils/buildit/ head/contrib/llvm/utils/cgiplotNLT.pl head/contrib/llvm/utils/check-each-file head/contrib/llvm/utils/codegen-diff head/contrib/llvm/utils/count/ head/contrib/llvm/utils/countloc.sh head/contrib/llvm/utils/crosstool/ head/contrib/llvm/utils/emacs/ head/contrib/llvm/utils/findmisopt head/contrib/llvm/utils/findoptdiff head/contrib/llvm/utils/findsym.pl head/contrib/llvm/utils/fpcmp/ head/contrib/llvm/utils/getsrcs.sh head/contrib/llvm/utils/git/ head/contrib/llvm/utils/importNLT.pl head/contrib/llvm/utils/jedit/ head/contrib/llvm/utils/lint/ head/contrib/llvm/utils/lit/ head/contrib/llvm/utils/llvm-lit/ head/contrib/llvm/utils/llvm-native-gcc head/contrib/llvm/utils/llvm-native-gxx head/contrib/llvm/utils/llvm.grm head/contrib/llvm/utils/llvmdo head/contrib/llvm/utils/llvmgrep head/contrib/llvm/utils/makellvm head/contrib/llvm/utils/not/ head/contrib/llvm/utils/parseNLT.pl head/contrib/llvm/utils/plotNLT.pl head/contrib/llvm/utils/profile.pl head/contrib/llvm/utils/unittest/ head/contrib/llvm/utils/valgrind/ head/contrib/llvm/utils/vim/ head/contrib/llvm/utils/webNLT.pl From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 18:13:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19490106564A; Mon, 11 Oct 2010 18:13:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id DC9988FC08; Mon, 11 Oct 2010 18:13:36 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 94C5346B0C; Mon, 11 Oct 2010 14:13:36 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id AF3848A027; Mon, 11 Oct 2010 14:13:35 -0400 (EDT) From: John Baldwin To: Ivan Voras Date: Mon, 11 Oct 2010 10:23:26 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201010092020.o99KKSYW051470@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201010111023.26220.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 11 Oct 2010 14:13:35 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-0.3 required=4.2 tests=BAYES_00,DATE_IN_PAST_03_06 autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, "Andrey V. Elsukov" , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213662 - in head: sbin/geom/class/concat sbin/geom/class/eli sbin/geom/class/journal sbin/geom/class/mirror sbin/geom/class/part sbin/geom/class/raid3 sbin/geom/class/shsec sbin/geom/c... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 18:13:37 -0000 On Sunday, October 10, 2010 4:54:37 am Ivan Voras wrote: > On 9 October 2010 22:20, Andrey V. Elsukov wrote: > > Author: ae > > Date: Sat Oct 9 20:20:27 2010 > > New Revision: 213662 > > URL: http://svn.freebsd.org/changeset/base/213662 > > > > Log: > > Replace strlen(_PATH_DEV) with sizeof(_PATH_DEV) - 1. > > Um, this looks like a pointless change and for the worse; Even at -O1 > the compiler will reduce strlen(constant) to just its result and for > code like printf("%d\n", sizeof("1234567")) produce code like: > > movl $7, %esi > movl $.LC0, %edi > movl $0, %eax > call printf > > And (though tastes differ) I think the sizeof() variant is less > readable. The strlen(_PATH_something) idiom is common in other parts > of the kernel outside GEOM. > > In short - why was this done? I agree, strlen("foo") is much clearer. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 18:32:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49823106566B; Mon, 11 Oct 2010 18:32:42 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9A16A8FC08; Mon, 11 Oct 2010 18:32:41 +0000 (UTC) Received: by qwe4 with SMTP id 4so1617423qwe.13 for ; Mon, 11 Oct 2010 11:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type:content-transfer-encoding; bh=cyHmBRSrCzlsawe+iQCWXAqRSHHeK3OBxUZkSXT26+M=; b=TrudmdffYQJZRY0pRMn7T/nzBUVqWxgc1z1e/xqdfBfQCNy1b+b4MVS3xjl+ozWh6t 38LydIWhMj8ilnwVzwS8osmdZFwzXnpaHd/cA/sByqTtW/GSAmw9lBnghy57mNu65Y38 cRlDkaFtTEyVzrGt5rlGYZGXaS/QnQbibmaEI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; b=c89QnIxB5nGOMDnRTAMSMbd598IJCwsEJpmEdz2K7kTFC5w1Yhm1PnG3tmohEYf/dT ddHhqXkNf3/0F6Im69L3gHnyTM69Ko/pMXWDyrhShaahwk44osAj1/yWhGHqQzzRnAU3 1n60/dWX3DwkGNS/XGvFmLN9GSlXMJFZ3mcU0= Received: by 10.224.209.6 with SMTP id ge6mr4747438qab.110.1286821960645; Mon, 11 Oct 2010 11:32:40 -0700 (PDT) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.229.234.81 with HTTP; Mon, 11 Oct 2010 11:32:00 -0700 (PDT) In-Reply-To: References: <201010092020.o99KKSYW051470@svn.freebsd.org> From: Ivan Voras Date: Mon, 11 Oct 2010 20:32:00 +0200 X-Google-Sender-Auth: GBzyGdZJvfEIFqe6yGKLm5J-acY Message-ID: To: "Andrey V. Elsukov" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213662 - in head: sbin/geom/class/concat sbin/geom/class/eli sbin/geom/class/journal sbin/geom/class/mirror sbin/geom/class/part sbin/geom/class/raid3 sbin/geom/class/shsec sbin/geom/c... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 18:32:42 -0000 On 10 October 2010 10:54, Ivan Voras wrote: > On 9 October 2010 22:20, Andrey V. Elsukov wrote: >> Author: ae >> Date: Sat Oct =C2=A09 20:20:27 2010 >> New Revision: 213662 >> URL: http://svn.freebsd.org/changeset/base/213662 >> >> Log: >> =C2=A0Replace strlen(_PATH_DEV) with sizeof(_PATH_DEV) - 1. > > Um, this looks like a pointless change and for the worse; Even at -O1 > the compiler will reduce strlen(constant) to just its result and for > code like printf("%d\n", sizeof("1234567")) produce code like: ^^^^^ should be strlen(), of course :) From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 19:20:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BCB3106564A; Mon, 11 Oct 2010 19:20:54 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3F048FC17; Mon, 11 Oct 2010 19:20:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BJKrAX024716; Mon, 11 Oct 2010 19:20:53 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BJKrFk024713; Mon, 11 Oct 2010 19:20:53 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010111920.o9BJKrFk024713@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 11 Oct 2010 19:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213696 - head/sys/dev/usb/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 19:20:54 -0000 Author: yongari Date: Mon Oct 11 19:20:53 2010 New Revision: 213696 URL: http://svn.freebsd.org/changeset/base/213696 Log: Do not setup interrupt endpoint for axe(4). It seems axe(4) controllers support interrupt endpoint such that enabling interrupt endpoint generates about 1000 interrupts/sec. Controllers transfer 8 bytes data through interrupt endpoint and the data include link UP/DOWN state as well as some PHY related information. Previously axe(4) didn't use the transferred data and didn't even try to read the data. Because axe(4) counts on mii(4) to detect link state changes there is no need to use interrupt endpoint here. This change fixes generation of unnecessary interrupts which was seen when interface is brought to UP. No objections from: hselasky Modified: head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_axereg.h Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Mon Oct 11 17:22:16 2010 (r213695) +++ head/sys/dev/usb/net/if_axe.c Mon Oct 11 19:20:53 2010 (r213696) @@ -171,7 +171,6 @@ static device_probe_t axe_probe; static device_attach_t axe_attach; static device_detach_t axe_detach; -static usb_callback_t axe_intr_callback; static usb_callback_t axe_bulk_read_callback; static usb_callback_t axe_bulk_write_callback; @@ -215,15 +214,6 @@ static const struct usb_config axe_confi .callback = axe_bulk_read_callback, .timeout = 0, /* no timeout */ }, - - [AXE_INTR_DT_RD] = { - .type = UE_INTERRUPT, - .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_IN, - .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, - .bufsize = 0, /* use wMaxPacketSize */ - .callback = axe_intr_callback, - }, }; static device_method_t axe_methods[] = { @@ -796,27 +786,6 @@ axe_detach(device_t dev) return (0); } -static void -axe_intr_callback(struct usb_xfer *xfer, usb_error_t error) -{ - switch (USB_GET_STATE(xfer)) { - case USB_ST_TRANSFERRED: - case USB_ST_SETUP: -tr_setup: - usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); - usbd_transfer_submit(xfer); - return; - - default: /* Error */ - if (error != USB_ERR_CANCELLED) { - /* try to clear stall first */ - usbd_xfer_set_stall(xfer); - goto tr_setup; - } - return; - } -} - #if (AXE_BULK_BUF_SIZE >= 0x10000) #error "Please update axe_bulk_read_callback()!" #endif @@ -1034,7 +1003,6 @@ axe_start(struct usb_ether *ue) /* * start the USB transfers, if not already started: */ - usbd_transfer_start(sc->sc_xfer[AXE_INTR_DT_RD]); usbd_transfer_start(sc->sc_xfer[AXE_BULK_DT_RD]); usbd_transfer_start(sc->sc_xfer[AXE_BULK_DT_WR]); } @@ -1139,7 +1107,6 @@ axe_stop(struct usb_ether *ue) */ usbd_transfer_stop(sc->sc_xfer[AXE_BULK_DT_WR]); usbd_transfer_stop(sc->sc_xfer[AXE_BULK_DT_RD]); - usbd_transfer_stop(sc->sc_xfer[AXE_INTR_DT_RD]); axe_reset(sc); } Modified: head/sys/dev/usb/net/if_axereg.h ============================================================================== --- head/sys/dev/usb/net/if_axereg.h Mon Oct 11 17:22:16 2010 (r213695) +++ head/sys/dev/usb/net/if_axereg.h Mon Oct 11 19:20:53 2010 (r213696) @@ -191,7 +191,6 @@ struct axe_sframe_hdr { enum { AXE_BULK_DT_WR, AXE_BULK_DT_RD, - AXE_INTR_DT_RD, AXE_N_TRANSFER, }; From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 20:17:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E39341065670; Mon, 11 Oct 2010 20:17:23 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D30E98FC1A; Mon, 11 Oct 2010 20:17:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BKHN2S026119; Mon, 11 Oct 2010 20:17:23 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BKHNKl026117; Mon, 11 Oct 2010 20:17:23 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201010112017.o9BKHNKl026117@svn.freebsd.org> From: Ed Schouten Date: Mon, 11 Oct 2010 20:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213697 - head/sbin/reboot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 20:17:24 -0000 Author: ed Date: Mon Oct 11 20:17:23 2010 New Revision: 213697 URL: http://svn.freebsd.org/changeset/base/213697 Log: Remove stale reference to wtmp(5). Reported by: pluknet Modified: head/sbin/reboot/reboot.8 Modified: head/sbin/reboot/reboot.8 ============================================================================== --- head/sbin/reboot/reboot.8 Mon Oct 11 19:20:53 2010 (r213696) +++ head/sbin/reboot/reboot.8 Mon Oct 11 20:17:23 2010 (r213697) @@ -28,7 +28,7 @@ .\" @(#)reboot.8 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 9, 1993 +.Dd October 11, 2010 .Dt REBOOT 8 .Os .Sh NAME @@ -129,7 +129,7 @@ utility is used when the system needs to users advance warning of their impending doom and cleanly terminating specific programs. .Sh SEE ALSO -.Xr wtmp 5 , +.Xr getutxent 3 , .Xr boot 8 , .Xr dumpon 8 , .Xr nextboot 8 , From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 20:30:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3139106564A; Mon, 11 Oct 2010 20:30:57 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 924088FC13; Mon, 11 Oct 2010 20:30:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BKUv6n026561; Mon, 11 Oct 2010 20:30:57 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BKUvgq026559; Mon, 11 Oct 2010 20:30:57 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201010112030.o9BKUvgq026559@svn.freebsd.org> From: Ed Schouten Date: Mon, 11 Oct 2010 20:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213698 - head/lib/libulog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 20:30:57 -0000 Author: ed Date: Mon Oct 11 20:30:57 2010 New Revision: 213698 URL: http://svn.freebsd.org/changeset/base/213698 Log: Fix reference to nonexistent manpage getuid(3). Submitted by: pluknet Modified: head/lib/libulog/ulog_login.3 Modified: head/lib/libulog/ulog_login.3 ============================================================================== --- head/lib/libulog/ulog_login.3 Mon Oct 11 20:17:23 2010 (r213697) +++ head/lib/libulog/ulog_login.3 Mon Oct 11 20:30:57 2010 (r213698) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 5, 2009 +.Dd October 11, 2010 .Dt ULOG_LOGIN 3 .Os .Sh NAME @@ -90,8 +90,8 @@ and .Fn ulog_logout_pseudo functions spawn a privileged process to perform the actual logging. .Sh SEE ALSO +.Xr getuid 2 , .Xr posix_openpt 2 , -.Xr getuid 3 , .Xr ptsname 3 , .Xr pututxline 3 .Sh HISTORY From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 20:34:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41EDD10656A3; Mon, 11 Oct 2010 20:34:36 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08DFD8FC2A; Mon, 11 Oct 2010 20:34:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BKYZVf026698; Mon, 11 Oct 2010 20:34:35 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BKYZIg026697; Mon, 11 Oct 2010 20:34:35 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201010112034.o9BKYZIg026697@svn.freebsd.org> From: Martin Matuska Date: Mon, 11 Oct 2010 20:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213699 - vendor/xz/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 20:34:36 -0000 Author: mm Date: Mon Oct 11 20:34:35 2010 New Revision: 213699 URL: http://svn.freebsd.org/changeset/base/213699 Log: Remove two non-vendor files as recommended. Approved by: delphij (mentor) Deleted: vendor/xz/dist/FREEBSD-Xlist vendor/xz/dist/FREEBSD-upgrade From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 21:16:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6272710656C9; Mon, 11 Oct 2010 21:16:51 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C2608FC23; Mon, 11 Oct 2010 21:16:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BLGp8t027657; Mon, 11 Oct 2010 21:16:51 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BLGpS4027649; Mon, 11 Oct 2010 21:16:51 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201010112116.o9BLGpS4027649@svn.freebsd.org> From: Martin Matuska Date: Mon, 11 Oct 2010 21:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213700 - in head: . contrib/xz contrib/xz/po contrib/xz/src/common contrib/xz/src/liblzma/api contrib/xz/src/liblzma/api/lzma contrib/xz/src/liblzma/check contrib/xz/src/liblzma/common... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 21:16:51 -0000 Author: mm Date: Mon Oct 11 21:16:50 2010 New Revision: 213700 URL: http://svn.freebsd.org/changeset/base/213700 Log: Upgrade xz to git snapshot as of 20101010 Approved by: delphij (mentor) MFC after: 1 month Added: head/contrib/xz/po/de.po - copied unchanged from r213699, vendor/xz/dist/po/de.po head/contrib/xz/po/it.po - copied unchanged from r213699, vendor/xz/dist/po/it.po head/contrib/xz/src/common/tuklib_mbstr.h - copied unchanged from r213699, vendor/xz/dist/src/common/tuklib_mbstr.h head/contrib/xz/src/common/tuklib_mbstr_fw.c - copied unchanged from r213699, vendor/xz/dist/src/common/tuklib_mbstr_fw.c head/contrib/xz/src/common/tuklib_mbstr_width.c - copied unchanged from r213699, vendor/xz/dist/src/common/tuklib_mbstr_width.c Deleted: head/contrib/xz/src/liblzma/api/lzma/subblock.h head/contrib/xz/src/liblzma/common/chunk_size.c head/contrib/xz/src/liblzma/subblock/ Modified: head/ObsoleteFiles.inc head/contrib/xz/ChangeLog (contents, props changed) head/contrib/xz/README (contents, props changed) head/contrib/xz/THANKS (contents, props changed) head/contrib/xz/po/LINGUAS (contents, props changed) head/contrib/xz/po/POTFILES.in (contents, props changed) head/contrib/xz/po/cs.po (contents, props changed) head/contrib/xz/src/common/sysdefs.h (contents, props changed) head/contrib/xz/src/common/tuklib_cpucores.c (contents, props changed) head/contrib/xz/src/common/tuklib_gettext.h (contents, props changed) head/contrib/xz/src/common/tuklib_physmem.c (contents, props changed) head/contrib/xz/src/liblzma/api/lzma.h (contents, props changed) head/contrib/xz/src/liblzma/api/lzma/index.h (contents, props changed) head/contrib/xz/src/liblzma/api/lzma/lzma.h (contents, props changed) head/contrib/xz/src/liblzma/api/lzma/vli.h (contents, props changed) head/contrib/xz/src/liblzma/common/block_buffer_encoder.c (contents, props changed) head/contrib/xz/src/liblzma/common/block_util.c (contents, props changed) head/contrib/xz/src/liblzma/common/common.c (contents, props changed) head/contrib/xz/src/liblzma/common/common.h (contents, props changed) head/contrib/xz/src/liblzma/common/filter_common.c (contents, props changed) head/contrib/xz/src/liblzma/common/filter_decoder.c (contents, props changed) head/contrib/xz/src/liblzma/common/filter_encoder.c (contents, props changed) head/contrib/xz/src/liblzma/common/stream_buffer_encoder.c (contents, props changed) head/contrib/xz/src/liblzma/delta/delta_encoder.c (contents, props changed) head/contrib/xz/src/liblzma/lz/lz_decoder.c (contents, props changed) head/contrib/xz/src/liblzma/lz/lz_decoder.h (contents, props changed) head/contrib/xz/src/liblzma/lz/lz_encoder.c (contents, props changed) head/contrib/xz/src/liblzma/lz/lz_encoder.h (contents, props changed) head/contrib/xz/src/liblzma/lz/lz_encoder_mf.c (contents, props changed) head/contrib/xz/src/liblzma/lzma/lzma2_encoder.c (contents, props changed) head/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_fast.c (contents, props changed) head/contrib/xz/src/liblzma/lzma/lzma_encoder_optimum_normal.c (contents, props changed) head/contrib/xz/src/liblzma/lzma/lzma_encoder_presets.c (contents, props changed) head/contrib/xz/src/lzmainfo/lzmainfo.1 (contents, props changed) head/contrib/xz/src/lzmainfo/lzmainfo.c (contents, props changed) head/contrib/xz/src/xz/args.c (contents, props changed) head/contrib/xz/src/xz/args.h (contents, props changed) head/contrib/xz/src/xz/coder.c (contents, props changed) head/contrib/xz/src/xz/coder.h (contents, props changed) head/contrib/xz/src/xz/file_io.c (contents, props changed) head/contrib/xz/src/xz/hardware.c (contents, props changed) head/contrib/xz/src/xz/hardware.h (contents, props changed) head/contrib/xz/src/xz/list.c (contents, props changed) head/contrib/xz/src/xz/main.c (contents, props changed) head/contrib/xz/src/xz/message.c (contents, props changed) head/contrib/xz/src/xz/message.h (contents, props changed) head/contrib/xz/src/xz/options.c (contents, props changed) head/contrib/xz/src/xz/options.h (contents, props changed) head/contrib/xz/src/xz/private.h (contents, props changed) head/contrib/xz/src/xz/signals.c (contents, props changed) head/contrib/xz/src/xz/signals.h (contents, props changed) head/contrib/xz/src/xz/util.c (contents, props changed) head/contrib/xz/src/xz/util.h (contents, props changed) head/contrib/xz/src/xz/xz.1 (contents, props changed) head/contrib/xz/src/xzdec/xzdec.1 (contents, props changed) head/contrib/xz/src/xzdec/xzdec.c (contents, props changed) head/lib/liblzma/Makefile head/lib/liblzma/config.h head/sys/sys/param.h head/usr.bin/xz/Makefile Directory Properties: head/contrib/xz/ (props changed) head/contrib/xz/AUTHORS (props changed) head/contrib/xz/COPYING (props changed) head/contrib/xz/TODO (props changed) head/contrib/xz/po/Makevars (props changed) head/contrib/xz/src/common/mythread.h (props changed) head/contrib/xz/src/common/tuklib_common.h (props changed) head/contrib/xz/src/common/tuklib_config.h (props changed) head/contrib/xz/src/common/tuklib_cpucores.h (props changed) head/contrib/xz/src/common/tuklib_exit.c (props changed) head/contrib/xz/src/common/tuklib_exit.h (props changed) head/contrib/xz/src/common/tuklib_integer.h (props changed) head/contrib/xz/src/common/tuklib_open_stdxxx.c (props changed) head/contrib/xz/src/common/tuklib_open_stdxxx.h (props changed) head/contrib/xz/src/common/tuklib_physmem.h (props changed) head/contrib/xz/src/common/tuklib_progname.c (props changed) head/contrib/xz/src/common/tuklib_progname.h (props changed) head/contrib/xz/src/liblzma/api/lzma/base.h (props changed) head/contrib/xz/src/liblzma/api/lzma/bcj.h (props changed) head/contrib/xz/src/liblzma/api/lzma/block.h (props changed) head/contrib/xz/src/liblzma/api/lzma/check.h (props changed) head/contrib/xz/src/liblzma/api/lzma/container.h (props changed) head/contrib/xz/src/liblzma/api/lzma/delta.h (props changed) head/contrib/xz/src/liblzma/api/lzma/filter.h (props changed) head/contrib/xz/src/liblzma/api/lzma/hardware.h (props changed) head/contrib/xz/src/liblzma/api/lzma/index_hash.h (props changed) head/contrib/xz/src/liblzma/api/lzma/stream_flags.h (props changed) head/contrib/xz/src/liblzma/api/lzma/version.h (props changed) head/contrib/xz/src/liblzma/check/check.c (props changed) head/contrib/xz/src/liblzma/check/check.h (props changed) head/contrib/xz/src/liblzma/check/crc32_fast.c (props changed) head/contrib/xz/src/liblzma/check/crc32_small.c (props changed) head/contrib/xz/src/liblzma/check/crc32_table.c (props changed) head/contrib/xz/src/liblzma/check/crc32_table_be.h (props changed) head/contrib/xz/src/liblzma/check/crc32_table_le.h (props changed) head/contrib/xz/src/liblzma/check/crc32_tablegen.c (props changed) head/contrib/xz/src/liblzma/check/crc32_x86.S (props changed) head/contrib/xz/src/liblzma/check/crc64_fast.c (props changed) head/contrib/xz/src/liblzma/check/crc64_small.c (props changed) head/contrib/xz/src/liblzma/check/crc64_table.c (props changed) head/contrib/xz/src/liblzma/check/crc64_table_be.h (props changed) head/contrib/xz/src/liblzma/check/crc64_table_le.h (props changed) head/contrib/xz/src/liblzma/check/crc64_tablegen.c (props changed) head/contrib/xz/src/liblzma/check/crc64_x86.S (props changed) head/contrib/xz/src/liblzma/check/crc_macros.h (props changed) head/contrib/xz/src/liblzma/check/sha256.c (props changed) head/contrib/xz/src/liblzma/common/alone_decoder.c (props changed) head/contrib/xz/src/liblzma/common/alone_decoder.h (props changed) head/contrib/xz/src/liblzma/common/alone_encoder.c (props changed) head/contrib/xz/src/liblzma/common/auto_decoder.c (props changed) head/contrib/xz/src/liblzma/common/block_buffer_decoder.c (props changed) head/contrib/xz/src/liblzma/common/block_decoder.c (props changed) head/contrib/xz/src/liblzma/common/block_decoder.h (props changed) head/contrib/xz/src/liblzma/common/block_encoder.c (props changed) head/contrib/xz/src/liblzma/common/block_encoder.h (props changed) head/contrib/xz/src/liblzma/common/block_header_decoder.c (props changed) head/contrib/xz/src/liblzma/common/block_header_encoder.c (props changed) head/contrib/xz/src/liblzma/common/easy_buffer_encoder.c (props changed) head/contrib/xz/src/liblzma/common/easy_decoder_memusage.c (props changed) head/contrib/xz/src/liblzma/common/easy_encoder.c (props changed) head/contrib/xz/src/liblzma/common/easy_encoder_memusage.c (props changed) head/contrib/xz/src/liblzma/common/easy_preset.c (props changed) head/contrib/xz/src/liblzma/common/easy_preset.h (props changed) head/contrib/xz/src/liblzma/common/filter_buffer_decoder.c (props changed) head/contrib/xz/src/liblzma/common/filter_buffer_encoder.c (props changed) head/contrib/xz/src/liblzma/common/filter_common.h (props changed) head/contrib/xz/src/liblzma/common/filter_decoder.h (props changed) head/contrib/xz/src/liblzma/common/filter_encoder.h (props changed) head/contrib/xz/src/liblzma/common/filter_flags_decoder.c (props changed) head/contrib/xz/src/liblzma/common/filter_flags_encoder.c (props changed) head/contrib/xz/src/liblzma/common/hardware_physmem.c (props changed) head/contrib/xz/src/liblzma/common/index.c (props changed) head/contrib/xz/src/liblzma/common/index.h (props changed) head/contrib/xz/src/liblzma/common/index_decoder.c (props changed) head/contrib/xz/src/liblzma/common/index_encoder.c (props changed) head/contrib/xz/src/liblzma/common/index_encoder.h (props changed) head/contrib/xz/src/liblzma/common/index_hash.c (props changed) head/contrib/xz/src/liblzma/common/stream_buffer_decoder.c (props changed) head/contrib/xz/src/liblzma/common/stream_decoder.c (props changed) head/contrib/xz/src/liblzma/common/stream_decoder.h (props changed) head/contrib/xz/src/liblzma/common/stream_encoder.c (props changed) head/contrib/xz/src/liblzma/common/stream_encoder.h (props changed) head/contrib/xz/src/liblzma/common/stream_flags_common.c (props changed) head/contrib/xz/src/liblzma/common/stream_flags_common.h (props changed) head/contrib/xz/src/liblzma/common/stream_flags_decoder.c (props changed) head/contrib/xz/src/liblzma/common/stream_flags_encoder.c (props changed) head/contrib/xz/src/liblzma/common/vli_decoder.c (props changed) head/contrib/xz/src/liblzma/common/vli_encoder.c (props changed) head/contrib/xz/src/liblzma/common/vli_size.c (props changed) head/contrib/xz/src/liblzma/delta/delta_common.c (props changed) head/contrib/xz/src/liblzma/delta/delta_common.h (props changed) head/contrib/xz/src/liblzma/delta/delta_decoder.c (props changed) head/contrib/xz/src/liblzma/delta/delta_decoder.h (props changed) head/contrib/xz/src/liblzma/delta/delta_encoder.h (props changed) head/contrib/xz/src/liblzma/delta/delta_private.h (props changed) head/contrib/xz/src/liblzma/lz/lz_encoder_hash.h (props changed) head/contrib/xz/src/liblzma/lz/lz_encoder_hash_table.h (props changed) head/contrib/xz/src/liblzma/lzma/fastpos.h (props changed) head/contrib/xz/src/liblzma/lzma/fastpos_table.c (props changed) head/contrib/xz/src/liblzma/lzma/fastpos_tablegen.c (props changed) head/contrib/xz/src/liblzma/lzma/lzma2_decoder.c (props changed) head/contrib/xz/src/liblzma/lzma/lzma2_decoder.h (props changed) head/contrib/xz/src/liblzma/lzma/lzma2_encoder.h (props changed) head/contrib/xz/src/liblzma/lzma/lzma_common.h (props changed) head/contrib/xz/src/liblzma/lzma/lzma_decoder.c (props changed) head/contrib/xz/src/liblzma/lzma/lzma_decoder.h (props changed) head/contrib/xz/src/liblzma/lzma/lzma_encoder.c (props changed) head/contrib/xz/src/liblzma/lzma/lzma_encoder.h (props changed) head/contrib/xz/src/liblzma/lzma/lzma_encoder_private.h (props changed) head/contrib/xz/src/liblzma/rangecoder/price.h (props changed) head/contrib/xz/src/liblzma/rangecoder/price_table.c (props changed) head/contrib/xz/src/liblzma/rangecoder/price_tablegen.c (props changed) head/contrib/xz/src/liblzma/rangecoder/range_common.h (props changed) head/contrib/xz/src/liblzma/rangecoder/range_decoder.h (props changed) head/contrib/xz/src/liblzma/rangecoder/range_encoder.h (props changed) head/contrib/xz/src/liblzma/simple/arm.c (props changed) head/contrib/xz/src/liblzma/simple/armthumb.c (props changed) head/contrib/xz/src/liblzma/simple/ia64.c (props changed) head/contrib/xz/src/liblzma/simple/powerpc.c (props changed) head/contrib/xz/src/liblzma/simple/simple_coder.c (props changed) head/contrib/xz/src/liblzma/simple/simple_coder.h (props changed) head/contrib/xz/src/liblzma/simple/simple_decoder.c (props changed) head/contrib/xz/src/liblzma/simple/simple_decoder.h (props changed) head/contrib/xz/src/liblzma/simple/simple_encoder.c (props changed) head/contrib/xz/src/liblzma/simple/simple_encoder.h (props changed) head/contrib/xz/src/liblzma/simple/simple_private.h (props changed) head/contrib/xz/src/liblzma/simple/sparc.c (props changed) head/contrib/xz/src/liblzma/simple/x86.c (props changed) head/contrib/xz/src/xz/file_io.h (props changed) head/contrib/xz/src/xz/list.h (props changed) head/contrib/xz/src/xz/main.h (props changed) head/contrib/xz/src/xz/suffix.c (props changed) head/contrib/xz/src/xz/suffix.h (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Oct 11 20:34:35 2010 (r213699) +++ head/ObsoleteFiles.inc Mon Oct 11 21:16:50 2010 (r213700) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20101011: removed subblock.h from liblzma +OLD_FILES+=usr/include/lzma/subblock.h # 20101002: removed manpath.config OLD_FILES+=etc/manpath.config OLD_FILES+=usr/share/examples/etc/manpath.config Modified: head/contrib/xz/ChangeLog ============================================================================== --- head/contrib/xz/ChangeLog Mon Oct 11 20:34:35 2010 (r213699) +++ head/contrib/xz/ChangeLog Mon Oct 11 21:16:50 2010 (r213700) @@ -1,3 +1,817 @@ +commit d52b411716a614c202e89ba732492efb9916cd3f +Author: Lasse Collin +Date: Sun Oct 10 17:58:58 2010 +0300 + + xz: Use "%"PRIu32 instead of "%d" in a format string. + +commit ae74d1bdeb075c3beefe76e1136c5741804e7e91 +Author: Lasse Collin +Date: Sun Oct 10 17:43:26 2010 +0300 + + test_files.sh: Fix the first line. + + For some reason this prevented running the test only + on OS/2 and even on that it broke only recently. + + Thanks to Elbert Pol. + +commit d492b80ddd6f9a13419de6d102df7374d8f448e8 +Author: Lasse Collin +Date: Sun Oct 10 16:49:01 2010 +0300 + + lzmainfo: Use "%"PRIu32 instead of "%u" for uint32_t. + +commit 825e859a9054bd91202e5723c41a17e72f63040a +Author: Lasse Collin +Date: Sun Oct 10 16:47:01 2010 +0300 + + lzmainfo: Use fileno(stdin) instead of STDIN_FILENO. + +commit acbc4cdecbeec2a4dfaac04f185ece49b2ff17c8 +Author: Lasse Collin +Date: Sat Oct 9 23:20:51 2010 +0300 + + lzmainfo: Use setmode() on DOS-like systems. + +commit ef364d3abc5647111c5424ea0d83a567e184a23b +Author: Lasse Collin +Date: Sat Oct 9 21:51:03 2010 +0300 + + OS/2 and DOS: Be less verbose on signals. + + Calling raise() to kill xz when user has pressed C-c + is a bit verbose on OS/2 and DOS/DJGPP. Instead of + calling raise(), set only the exit status to 1. + +commit 5629c4be07b6c67e79842b2569da1cedc9c0d69a +Author: Lasse Collin +Date: Sat Oct 9 19:28:49 2010 +0300 + + DOS: Update the Makefile, config.h and README. + + This is now simpler and builds only xz.exe. + +commit f25a77e6b9bc48a243ddfbbd755b7960eec7e0ac +Author: Lasse Collin +Date: Sat Oct 9 18:57:55 2010 +0300 + + Windows: Put some license info into README-Windows.txt. + +commit e75100f549f85d231df25c07aa94d63e78e2d668 +Author: Lasse Collin +Date: Sat Oct 9 18:57:04 2010 +0300 + + Windows: Fix a diagnostics bug in build.bash. + +commit efeb998a2b1025df1c1d202cc7d21d866cd1c336 +Author: Lasse Collin +Date: Sat Oct 9 13:02:15 2010 +0300 + + lzmainfo: Add Windows resource file. + +commit 389d418445f1623593dfdbba55d52fbb6d1205f5 +Author: Lasse Collin +Date: Sat Oct 9 12:57:25 2010 +0300 + + Add missing public domain notice to lzmadec_w32res.rc. + +commit 6389c773a4912dd9f111256d74ba1605230a7957 +Author: Lasse Collin +Date: Sat Oct 9 12:52:12 2010 +0300 + + Windows: Update common_w32res.rc. + +commit 71275457ca24c9b01721f5cfc3638cf094daf454 +Author: Lasse Collin +Date: Sat Oct 9 12:27:08 2010 +0300 + + Windows: Make build.bash prefer MinGW-w32 over MinGW. + + This is simply for licensing reasons. The 64-bit version + will be built with MinGW-w64 anyway (at least for now), + so using it also for 32-bit build allows using the same + copyright notice about the MinGW-w64/w32 runtime. + + Note that using MinGW would require a copyright notice too, + because its runtime is not in the public domain either even + though MinGW's home page claims that it is public domain. + See . + +commit 3ac35719d8433af937af6491383d4a50e343099b +Author: Lasse Collin +Date: Sat Oct 9 11:33:21 2010 +0300 + + Windows: Copy COPYING-Windows.txt (if it exists) to the package. + + Also, put README-Windows.txt to the doc directory like + the other documentation files. + +commit 7b5db576fd7a4a67813b8437a9ccd4dbc94bbaae +Author: Lasse Collin +Date: Fri Oct 8 21:42:37 2010 +0300 + + Windows: Fix build.bash again. + + 630a8beda34af0ac153c8051b1bf01230558e422 wasn't good. + +commit d3cd7abe85ec7c2f46cf198b15c00d5d119df3dd +Author: Lasse Collin +Date: Fri Oct 8 16:53:20 2010 +0300 + + Use LZMA_VERSION_STRING instead of PACKAGE_VERSION. + + Those are the same thing, and the former makes it a bit + easier to build the code with other build systems, because + one doesn't need to update the version number into custom + config.h. + + This change affects only lzmainfo. Other tools were already + using LZMA_VERSION_STRING. + +commit 084c60d318f2dbaef4078d9b100b4a373d0c3a7f +Author: Lasse Collin +Date: Fri Oct 8 15:59:25 2010 +0300 + + configure.ac: Remove two unused defines. + +commit 11f51b6714357cb67ec7e56ed9575c199b5581fe +Author: Lasse Collin +Date: Fri Oct 8 15:32:29 2010 +0300 + + Make tests accommodate missing xz or xzdec. + +commit b1c7368f95e93ccdefdd0748e04398c26766f47f +Author: Lasse Collin +Date: Fri Oct 8 15:25:45 2010 +0300 + + Build: Add options to disable individual command line tools. + +commit 630a8beda34af0ac153c8051b1bf01230558e422 +Author: Lasse Collin +Date: Thu Oct 7 00:44:53 2010 +0300 + + Windows: Make build.bash work without --enable-dynamic=no. + +commit f9907503f882a745dce9d84c2968f6c175ba966a +Author: Lasse Collin +Date: Tue Oct 5 14:13:16 2010 +0300 + + Build: Remove the static/dynamic tricks. + + Most distros want xz linked against shared liblzma, so + it doesn't help much to require --enable-dynamic for that. + Those who want to avoid PIC on x86-32 to get better + performance, can still do it e.g. by using --disable-shared + to compile xz and then another pass to compile shared liblzma. + + Part of these static/dynamic tricks were needed for Windows + in the past. Nowadays we rely on GCC and binutils to do the + right thing with auto-import. If the Autotooled build system + needs to support some other toolchain on Windows in the future, + this may need some rethinking. + +commit fda4724d8114fccfa31c1839c15479f350c2fb4c +Author: Lasse Collin +Date: Tue Oct 5 12:18:58 2010 +0300 + + configure.ac: Silence a warning from Autoconf 2.68. + +commit 80b5675fa62c87426fe86f8fcd20feeabc4361b9 +Author: Lasse Collin +Date: Mon Oct 4 19:43:01 2010 +0300 + + A few more languages files to the xz man page. + + Thanks to Jonathan Nieder. + +commit f9722dbeca4dc4c43cfd15d122dafaac50b0a0bb +Author: Lasse Collin +Date: Sat Oct 2 12:07:33 2010 +0300 + + Update the FAQ. + +commit 61ae593661e8dc402394e84d567ca2044a51572b +Author: Lasse Collin +Date: Sat Oct 2 11:38:20 2010 +0300 + + liblzma: Small fixes to comments in the API headers. + +commit 9166682dc601fd42c1b9510572e3f917d18de504 +Author: Lasse Collin +Date: Tue Sep 28 11:40:12 2010 +0300 + + Create the PDF versions of the man pages better. + +commit 17d3c61edd35de8fa884944fc70d1db86daa5dd8 +Author: Lasse Collin +Date: Tue Sep 28 10:59:53 2010 +0300 + + Move version.sh to build-aux. + +commit 84af9d8770451339a692e9b70f96cf56156a6069 +Author: Lasse Collin +Date: Tue Sep 28 10:53:02 2010 +0300 + + Update .gitignore. + +commit 31575a449ac64c523da3bab8d0c0b522cdc7c780 +Author: Lasse Collin +Date: Tue Sep 28 01:17:14 2010 +0300 + + Fix accomodate -> accommodate on the xz man page. + +commit cec0ddc8ec4ce81685a51998b978e22167e461f9 +Author: Lasse Collin +Date: Mon Sep 27 23:29:34 2010 +0300 + + Major man page updates. + + Lots of content was updated on the xz man page. + + Technical improvements: + - Start a new sentence on a new line. + - Use fairly short lines. + - Use constant-width font for examples (where supported). + - Some minor cleanups. + + Thanks to Jonathan Nieder for some language fixes. + +commit 075257ab0416a0603be930082e31a5703e4ba345 +Author: Lasse Collin +Date: Sun Sep 26 18:10:31 2010 +0300 + + Fix the preset -3e. + + depth=0 was missing. + +commit 2577da9ebdba13fbe99ae5ee8bde35f7ed60f6d1 +Author: Lasse Collin +Date: Thu Sep 23 14:03:10 2010 +0300 + + Add translations.bash and translation notes to README. + + translations.bash prints some messages from xz, which + hopefully makes it a bit easier to test translations. + +commit a3c5997c57e5b1a20aae6d1071b584b4f17d0b23 +Author: Lasse Collin +Date: Fri Sep 17 22:14:30 2010 +0300 + + xz: Update the Czech translation. + + Thanks to Marek Černocký. + +commit a1766af582dc23fddd9da1eeb4b9d61e3eb4c2e6 +Author: Lasse Collin +Date: Thu Sep 16 23:40:41 2010 +0300 + + xz: Add Italian translation. + + Thanks to Milo Casagrande and Lorenzo De Liso. + +commit 21088018554e2b0e02914205377ceb6e34a090bd +Author: Lasse Collin +Date: Wed Sep 15 00:34:13 2010 +0300 + + xz: Edit a translators comment. + +commit be16e28ece1b492b8f93382b7fa1cc4da23c6ff6 +Author: Lasse Collin +Date: Tue Sep 14 22:47:14 2010 +0300 + + xz: Add German translation. + + Thanks to Andre Noll. + +commit e23ea74f3240e6b69683f9e69d1716e0f9e9092b +Author: Lasse Collin +Date: Fri Sep 10 14:30:25 2010 +0300 + + Updated README. + +commit 8dad2fd69336985adb9f774fa96dc9c0efcb5a71 +Author: Lasse Collin +Date: Fri Sep 10 14:30:07 2010 +0300 + + Updated INSTALL. + +commit 0b5f07fe3728c27cce416ddc40f7e4803ae96ac2 +Author: Lasse Collin +Date: Fri Sep 10 14:26:20 2010 +0300 + + Updated the git repository address in ChangeLog. + +commit a8760203f93a69bc39fd14520a6e9e7b7d70be06 +Author: Lasse Collin +Date: Fri Sep 10 14:09:33 2010 +0300 + + xz: Add a comment to translators about "literal context bits". + +commit bb0b1004f83cdc4d309e1471c2ecaf9f95ce60c5 +Author: Lasse Collin +Date: Fri Sep 10 10:30:33 2010 +0300 + + xz: Multiple fixes. + + The code assumed that printing numbers with thousand separators + and decimal points would always produce only US-ASCII characters. + This was used for buffer sizes (with snprintf(), no overflows) + and aligning columns of the progress indicator and --list. That + assumption was wrong (e.g. LC_ALL=fi_FI.UTF-8 with glibc), so + multibyte character support was added in this commit. The old + way is used if the operating system doesn't have enough multibyte + support (e.g. lacks wcwidth()). + + The sizes of buffers were increased to accomodate multibyte + characters. I don't know how big they should be exactly, but + they aren't used for anything critical, so it's not too bad. + If they still aren't big enough, I hopefully get a bug report. + snprintf() takes care of avoiding buffer overflows. + + Some static buffers were replaced with buffers allocated on + stack. double_to_str() was removed. uint64_to_str() and + uint64_to_nicestr() now share the static buffer and test + for thousand separator support. + + Integrity check names "None" and "Unknown-N" (2 <= N <= 15) + were marked to be translated. I had forgot these, plus they + wouldn't have worked correctly anyway before this commit, + because printing tables with multibyte strings didn't work. + + Thanks to Marek Černocký for reporting the bug about + misaligned table columns in --list output. + +commit 639f8e2af33cf8a184d59ba56b6df7c098679d61 +Author: Lasse Collin +Date: Wed Sep 8 08:49:22 2010 +0300 + + Update the Czech translation. + + Thanks to Marek Černocký. + +commit 41bc9956ebfd7c86777d33676acf34c45e7ca7c7 +Author: Lasse Collin +Date: Tue Sep 7 12:31:40 2010 +0300 + + xz: Add a note to translators. + +commit 77a7746616e555fc08028e883a56d06bf0088b81 +Author: Lasse Collin +Date: Tue Sep 7 10:42:13 2010 +0300 + + Fix use of N_() and ngettext(). + + I had somehow thought that N_() is usually used + as shorthand for ngettext(). + + This also fixes a missing \n from a call to ngettext(). + +commit e6ad39335842343e622ab51207d1d3cb9caad801 +Author: Lasse Collin +Date: Mon Sep 6 19:43:12 2010 +0300 + + Add missing files to POTFILES.in. + +commit 58f55131820d2e08a1a6beb9ec0ee2378044eb30 +Author: Lasse Collin +Date: Mon Sep 6 10:16:24 2010 +0300 + + xz: Improve a comment. + +commit bcb1b898341f7073f51660d7052d7ed6c5461a66 +Author: Lasse Collin +Date: Sun Sep 5 21:34:29 2010 +0300 + + xz: Update the comment about NetBSD in file_io.c. + + Thanks to Joerg Sonnenberger. + +commit da014d55972f5addbf6b4360d3d8ed2ef4282170 +Author: Lasse Collin +Date: Sun Sep 5 21:11:33 2010 +0300 + + xz: Use an array instead of pointer for stdin_filename. + + Thanks Joerg Sonnenberger. + +commit 8c7d3d1a0781c296c6b6e2465becaffd2132f7ee +Author: Lasse Collin +Date: Sun Sep 5 12:16:17 2010 +0300 + + xz: Hopefully ease translating the messages in list.c. + +commit ef840950ad99cf2955c754875af0e01acf125079 +Author: Lasse Collin +Date: Sat Sep 4 23:14:44 2010 +0300 + + xz: Fix grammar. + +commit c46afd6edc04ea140db6c59e8486f5707c810c13 +Author: Lasse Collin +Date: Sat Sep 4 23:12:20 2010 +0300 + + xz: Use lzma_lzma_preset() to initialize the options structure. + +commit 8fd3ac046d0b1416a2094fecc456d9e0f4d5d065 +Author: Lasse Collin +Date: Sat Sep 4 22:16:28 2010 +0300 + + Don't set lc=4 with --extreme. + + This should reduce the cases where --extreme makes + compression worse. On the other hand, some other + files may now benefit slightly less from --extreme. + +commit 474bac0c33e94aeaca8ada17ab19972b1424bc2b +Author: Lasse Collin +Date: Sat Sep 4 22:10:32 2010 +0300 + + xz: Minor improvements to --help and --long-help. + +commit 373ee26f955617295c5c537b04a153a1969140d2 +Author: Jonathan Nieder +Date: Fri Sep 3 16:49:15 2010 -0500 + + Adjust memory limits in test_compress.sh + + Testing compression at level -4 now requires 48 MiB of free store at + compression time and 5 MiB at decompression time. + + Signed-off-by: Jonathan Nieder + +commit 2fce9312f36727ea82f3430cc5d3a7d243c5f087 +Author: Lasse Collin +Date: Fri Sep 3 15:54:40 2010 +0300 + + xz: Make -vv show also decompressor memory usage. + +commit b4b1cbcb53624ab832f8b3189c74450dc7ea29b6 +Author: Lasse Collin +Date: Fri Sep 3 15:13:12 2010 +0300 + + Tweak the compression presets -0 .. -5. + + "Extreme" mode might need some further tweaking still. + Docs were not updated yet. + +commit 77fe5954cd3d10fb1837372684cbc133b56b6a87 +Author: Lasse Collin +Date: Fri Sep 3 12:28:41 2010 +0300 + + liblzma: Adjust default depth calculation for HC3 and HC4. + + It was 8 + nice_len / 4, now it is 4 + nice_len / 4. + This allows faster settings at lower nice_len values, + even though it seems that I won't use automatic depth + calcuation with HC3 and HC4 in the presets. + +commit fce69059cf901ce8075a78c7607d591f144a3b5a +Author: Lasse Collin +Date: Fri Sep 3 11:11:25 2010 +0300 + + xz: Make --help two lines shorter. + + At least for now, the --help option doesn't list any + options that take arguments, so "Mandatory arguments to..." + can be omitted. + +commit a848e47ced6e5e2a564b5c454b2f5a19c2f40298 +Author: Lasse Collin +Date: Thu Sep 2 19:22:35 2010 +0300 + + xz: Make setting a preset override a custom filter chain. + + This is more logical behavior than ignoring preset level + options once a custom filter chain has been specified. + +commit b3ff7ba044eaeab3e424d7b51fe914daf681b1a3 +Author: Lasse Collin +Date: Thu Sep 2 19:09:57 2010 +0300 + + xz: Always warn if adjusting dictionary size due to memlimit. + +commit d5653ba8a1ea9c00de4fddc617aba3c51e18139d +Author: Lasse Collin +Date: Tue Aug 10 11:04:30 2010 +0300 + + Fix test_compress.sh. + + It broke when --memory option was removed from xzdec. + + Thanks to Jonathan Nieder. + +commit 792331bdee706aa852a78b171040ebf814c6f3ae +Author: Lasse Collin +Date: Sat Aug 7 20:45:18 2010 +0300 + + Disable the memory usage limiter by default. + + For several people, the limiter causes bigger problems that + it solves, so it is better to have it disabled by default. + Those who want to have a limiter by default need to enable + it via the environment variable XZ_DEFAULTS. + + Support for environment variable XZ_DEFAULTS was added. It is + parsed before XZ_OPT and technically identical with it. The + intended uses differ quite a bit though; see the man page. + + The memory usage limit can now be set separately for + compression and decompression using --memlimit-compress and + --memlimit-decompress. To set both at once, -M or --memlimit + can be used. --memory was retained as a legacy alias for + --memlimit for backwards compatibility. + + The semantics of --info-memory were changed in backwards + incompatible way. Compatibility wasn't meaningful due to + changes in the memory usage limiter functionality. + + The memory usage limiter info is no longer shown at the + bottom of xz --long -help. + + The memory usage limiter support for removed completely from xzdec. + + xz's man page was updated to match the above changes. Various + unrelated fixes were also made to the man page. + +commit 4a45dd4c39f75d25c7a37b6400cb24d4010ca801 +Author: Lasse Collin +Date: Fri Aug 6 20:22:16 2010 +0300 + + Add missing const to a global constant in xz. + +commit 01aa4869cb220b7fdad6d1acbabb2233045daa8f +Author: Lasse Collin +Date: Wed Jul 28 11:44:55 2010 +0300 + + Language fixes for man pages. + + Thanks to A. Costa and Jonathan Nieder. + +commit ce1f0deafe8504e1492bf1b1efb3e3ec950b1a2b +Author: Lasse Collin +Date: Tue Jul 27 20:47:12 2010 +0300 + + Windows: Add a note about building a Git repository snapshot + +commit 507a4a4dea1e5462f12f7ed4b076c34e02054a38 +Author: Lasse Collin +Date: Tue Jul 27 20:45:03 2010 +0300 + + Windows: build.sh is a bash script so name it correctly. + +commit b1cbfd40f049a646a639eb78a3e41e9e3ef73339 +Author: Lasse Collin +Date: Tue Jul 27 20:27:32 2010 +0300 + + Windows: Don't strip liblzma.a too much. + +commit a540198ffb25fad36380c5e92ac20c2d28eec46a +Author: Lasse Collin +Date: Tue Jul 13 20:07:26 2010 +0300 + + Updated THANKS. + +commit bab0f01ed931f606b4675aa9f9331a17cec09bad +Author: Lasse Collin +Date: Tue Jul 13 19:55:50 2010 +0300 + + Add two simple example programs. + + Hopefully these help a bit when learning the basics + of liblzma API. I plan to write detailed examples about + both basic and advanced features with lots of comments, + but these two examples are good have right now. + + The examples were written by Daniel Mealha Cabrita. Thanks. + +commit c15c42abb3c8c6e77c778ef06c97a4a10b8b5d00 +Author: Lasse Collin +Date: Tue Jun 15 14:06:29 2010 +0300 + + Add --no-adjust. + +commit 2130926dd1c839280358172dfadd8d3054bde2b4 +Author: Lasse Collin +Date: Fri Jun 11 21:51:32 2010 +0300 + + Updated THANKS. + +commit bc612d0e0c9e4504c59d49168e87a7ae3e458443 +Author: Lasse Collin +Date: Fri Jun 11 21:48:32 2010 +0300 + + Clarify the description of the default memlimit in the man page. + + Thanks to Denis Excoffier. + +commit e1b6935d60a00405e6b5b455a3426d2248cc926c +Author: Lasse Collin +Date: Fri Jun 11 21:43:28 2010 +0300 + + Fix string to uint64_t conversion. + + Thanks to Denis Excoffier for the bug report. + +commit 3e49c8acb0f5312948eddb2342dbb5802d4571d0 +Author: Lasse Collin +Date: Fri Jun 11 10:40:28 2010 +0300 + + Put the git commit to the filename in mydist rule. + +commit d8b41eedce486d400f701b757b7b5e4e32276618 +Author: Lasse Collin +Date: Wed Jun 2 23:13:55 2010 +0300 + + Fix compiling with -Werror. + +commit b5fbab6123a39c9a55cd5d7af410e9aae067d5f8 +Author: Lasse Collin +Date: Wed Jun 2 23:09:22 2010 +0300 + + Silence a bogus Valgrind warning. + + When using -O2 with GCC, it liked to swap two comparisons + in one "if" statement. It's otherwise fine except that + the latter part, which is seemingly never executed, got + executed (nothing wrong with that) and then triggered + warning in Valgrind about conditional jump depending on + uninitialized variable. A few people find this annoying + so do things a bit differently to avoid the warning. + +commit 29a7b250e685852f2f97615493ec49acaf528623 +Author: Lasse Collin +Date: Wed Jun 2 21:32:12 2010 +0300 + + Fix a Windows-specific FIXME in signal handling code. + +commit e89d987056cee7d4e279be3ef3a6cc690bfc0e6d +Author: Lasse Collin +Date: Wed Jun 2 17:46:58 2010 +0300 + + Adjust SA_RESTART workaround. + + I want to get a bug report if something else than + DJGPP lacks SA_RESTART. + +commit e243145c84ab5c3be8259fd486ead0de5235b3f0 +Author: Lasse Collin +Date: Tue Jun 1 16:02:30 2010 +0300 + + xz man page updates. + + - Concatenating .xz files and padding + - List mode + - Robot mode + - A few examples (but many more are needed) + +commit ce6dc3c0a891f23a862f80ec08d3b6f0beb2a562 +Author: Lasse Collin +Date: Tue Jun 1 15:51:44 2010 +0300 + + Major update to xz --list. + +commit 905e54804a899e4ad526d38fdba7e803ab9b71bd +Author: Lasse Collin +Date: Tue Jun 1 14:13:03 2010 +0300 + + Rename message_filters_get() to message_filters_to_str(). + +commit 4b346ae8af20045027ae5efb068c6d69da3324d2 +Author: Lasse Collin +Date: Tue Jun 1 14:09:12 2010 +0300 + + Fix a comment. + +commit 07dc34f6da45c9ab757dad7fd5eef522ad27d296 +Author: Lasse Collin +Date: Thu May 27 16:17:42 2010 +0300 + + Fix lzma_block_compressed_size(). + +commit 44d70cb154225e47eebf15a3cfbdf3794cbb4593 +Author: Lasse Collin +Date: Thu May 27 14:32:51 2010 +0300 + + Take Cygwin into account in some #if lines. + + This change is no-op, but good to have just in case + for the future. + +commit a334348dc02803241cf4e0a539eecdc0e7ad2cc7 +Author: Lasse Collin +Date: Thu May 27 13:42:44 2010 +0300 + + Remove references to the Subblock filter in xz and tests. + + Thanks to Jonathan Nieder. + +commit 70e5e2f6a7084e6af909deee88ceac2f6efa7893 +Author: Lasse Collin +Date: Thu May 27 13:35:36 2010 +0300 + + Remove unused chunk_size.c. + + Thanks to Jonathan Nieder for the reminder. + +commit 01a414eaf4be6352c06b48001b041b47e8202faa +Author: Jonathan Nieder +Date: Thu May 27 02:31:33 2010 -0500 + + Use my_min() instead of MIN() in src/xz/list.c + + This should have been done in + 920a69a8d8e4203c5edddd829d932130eac188ea. + +commit 920a69a8d8e4203c5edddd829d932130eac188ea +Author: Lasse Collin +Date: Wed May 26 10:36:46 2010 +0300 + + Rename MIN() and MAX() to my_min() and my_max(). + + This should avoid some minor portability issues. + +commit 019ae27c24d0c694545a6a46f8b9fb552198b015 +Author: Lasse Collin +Date: Wed May 26 10:30:20 2010 +0300 + + Fix compilation of debug/known_sizes.c. + +commit 98a4856a6ea84f79c790057a6eb89a25bc45b074 +Author: Lasse Collin +Date: Wed May 26 10:28:54 2010 +0300 + + Remove references to Subblock filter in debug/sync_flush.c. + +commit 703d2c33c095c41ae0693ee8c27c45e3847e4535 +Author: Lasse Collin +Date: Wed May 26 10:16:57 2010 +0300 + + Better #error message. + +commit d8a55c48b39703dd83f11089ad01e1ff2ac102e0 +Author: Lasse Collin +Date: Wed May 26 09:55:47 2010 +0300 + + Remove the Subblock filter code for now. + + The spec isn't finished and the code didn't compile anymore. + It won't be included in XZ Utils 5.0.0. It's easy to get it + back once the spec is done. + +commit b6377fc990f9b8651149cae0fecb8b9c5904e26d +Author: Lasse Collin +Date: Sun May 16 18:42:22 2010 +0300 + + Split message_filters(). + + message_filters_to_str() converts the filter chain to + a string. message_filters_show() replaces the original + message_filters(). + + uint32_to_optstr() was also added to show the dictionary + size in nicer format when possible. + +commit d9986db782d6cf0f314342127280519339378fa0 +Author: Lasse Collin +Date: Fri May 14 23:17:20 2010 +0300 + + Omit lzma_restrict from the API headers. + + It isn't really useful so omitting it makes things + shorter and slightly more readable. + +commit 0d3489efca0a723dca0394809fa3e6170843af4b +Author: Lasse Collin +Date: Mon May 10 19:57:24 2010 +0300 + + Updated INSTALL. + +commit 3fb3d594a2b53886adee161b6261e92277f05f7c +Author: Lasse Collin +Date: Mon May 10 19:54:52 2010 +0300 + + Updated THANKS. + +commit 6548e304657e77d3a972053db3c41c5daf591113 +Author: Lasse Collin +Date: Mon May 10 19:54:15 2010 +0300 + + Updates to tuklib_physmem and tuklib_cpucores. + + Don't use #error to generate compile error, because some + compilers actually don't take it as an error. This fixes + tuklib_physmem on IRIX. + + Fix incorrect error check for sysconf() return values. + + Add AIX, HP-UX, and Tru64 specific code to detect the + amount RAM. + + Add HP-UX specific code to detect the number of CPU cores. + + Thanks a lot to Peter O'Gorman for initial patches, + testing, and debugging these fixes. + commit a290cfee3e23f046889c022aa96b4eca2016fdda Author: Lasse Collin Date: Mon Apr 12 21:55:56 2010 +0300 Modified: head/contrib/xz/README ============================================================================== --- head/contrib/xz/README Mon Oct 11 20:34:35 2010 (r213699) +++ head/contrib/xz/README Mon Oct 11 21:16:50 2010 (r213700) @@ -9,8 +9,9 @@ XZ Utils 1.3. Documentation for liblzma 2. Version numbering 3. Reporting bugs - 4. Other implementations of the .xz format - 5. Contact information + 4. Translating the xz tool + 5. Other implementations of the .xz format + 6. Contact information 0. Overview @@ -187,7 +188,94 @@ XZ Utils system. -4. Other implementations of the .xz format +4. Translating the xz tool +-------------------------- + + The messages from the xz tool have been translated into a few + languages. Before starting to translate into a new language, ask + the author that someone else hasn't already started working on it. + + Test your translation. Testing includes comparing the translated + output to the original English version by running the same commands + in both your target locale and with LC_ALL=C. Ask someone to + proof-read and test the translation. + + Testing can be done e.g. by installing xz into a temporary directory: + + ./configure --disable-shared --prefix=/tmp/xz-test + # + make -C po update-po + make install + bash debug/translations.bash | less + bash debug/translations.bash | less -S # For --list outputs + + Repeat the above as needed (no need to re-run configure though). + + Note especially the following: + + - The output of --help and --long-help must look nice on + a 80-column terminal. It's OK to add extra lines if needed. + + - In contrast, don't add extra lines to error messages and such. + They are often preceded with e.g. a filename on the same line, + so you have no way to predict where to put a \n. Let the terminal + do the wrapping even if it looks ugly. Adding new lines will be + even uglier in the generic case even if it looks nice in a few + limited examples. + + - Be careful with column alignment in tables and table-like output + (--list, --list --verbose --verbose, --info-memory, --help, and + --long-help): + + * All descriptions of options in --help should start in the + same column (but it doesn't need to be the same column as + in the English messages; just be consistent if you change it). + Check that both --help and --long-help look OK, since they + share several strings. + + * --list --verbose and --info-memory print lines that have + the format "Description: %s". If you need a longer + description, you can put extra space between the colon + and %s. Then you may need to add extra space to other + strings too so that the result as a whole looks good (all + values start at the same column). + + * The columns of the actual tables in --list --verbose --verbose + should be aligned properly. Abbreviate if necessary. It might + be good to keep at least 2 or 3 spaces between column headings + and avoid spaces in the headings so that the columns stand out + better, but this is a matter of opinion. Do what you think + looks best. + + - Be careful to put a period at the end of a sentence when the + original version has it, and don't put it when the original + doesn't have it. Similarly, be careful with \n characters + at the beginning and end of the strings. + + - Read the TRANSLATORS comments that have been extracted from the + source code and included in xz.pot. If they suggest testing the + translation with some type of command, do it. If testing needs + input files, use e.g. tests/files/good-*.xz. + + - When updating the translation, read the fuzzy (modified) strings + carefully, and don't mark them as updated before you actually + have updated them. Reading through the unchanged messages can be + good too; sometimes you may find a better wording for them. + + - If you find language problems in the original English strings, + feel free to suggest improvements. Ask if something is unclear. + + - The translated messages should be understandable (sometimes this + may be a problem with the original English messages too). Don't + make a direct word-by-word translation from English especially if + the result doesn't sound good in your language. + + In short, take your time and pay attention to the details. Making + a good translation is not a quick and trivial thing to do. The + translated xz should look as polished as the English version. + + +5. Other implementations of the .xz format ------------------------------------------ 7-Zip and the p7zip port of 7-Zip support the .xz format starting @@ -202,13 +290,11 @@ XZ Utils http://tukaani.org/xz/embedded.html -5. Contact information +6. Contact information ---------------------- If you have questions, bug reports, patches etc. related to XZ Utils, contact Lasse Collin (in Finnish or English). - tukaani.org uses greylisting to reduce spam, thus when you send your - first email, it may get delayed by a few hours. In addition to that, I'm sometimes slow at replying. If you haven't got a reply within two weeks, assume that your email has got lost and resend it or use IRC. Modified: head/contrib/xz/THANKS ============================================================================== --- head/contrib/xz/THANKS Mon Oct 11 20:34:35 2010 (r213699) +++ head/contrib/xz/THANKS Mon Oct 11 21:16:50 2010 (r213700) @@ -12,12 +12,15 @@ has been important. :-) In alphabetical - Emmanuel Blot - Trent W. Buck - David Burklund + - Daniel Mealha Cabrita + - Milo Casagrande - Marek Černocký - Andrew Dudman - Markus Duft - İsmail Dönmez - Robert Elz - Gilles Espinasse + - Denis Excoffier - Mike Frysinger - Joachim Henke - Peter Ivanov @@ -30,11 +33,14 @@ has been important. :-) In alphabetical - Peter Lawler - Hin-Tak Leung - Andraž 'ruskie' Levstik + - Lorenzo De Liso - Jim Meyering - Rafał Mużyło - Adrien Nader - Hongbo Ni - Jonathan Nieder + - Andre Noll + - Peter O'Gorman - Igor Pavlov - Elbert Pol - Mikko Pouru Modified: head/contrib/xz/po/LINGUAS ============================================================================== --- head/contrib/xz/po/LINGUAS Mon Oct 11 20:34:35 2010 (r213699) +++ head/contrib/xz/po/LINGUAS Mon Oct 11 21:16:50 2010 (r213700) @@ -1 +1,3 @@ cs +de +it Modified: head/contrib/xz/po/POTFILES.in ============================================================================== --- head/contrib/xz/po/POTFILES.in Mon Oct 11 20:34:35 2010 (r213699) +++ head/contrib/xz/po/POTFILES.in Mon Oct 11 21:16:50 2010 (r213700) @@ -3,8 +3,11 @@ src/xz/args.c src/xz/coder.c src/xz/file_io.c *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 21:23:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62E3A106564A; Mon, 11 Oct 2010 21:23:07 +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 504928FC18; Mon, 11 Oct 2010 21:23:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BLN7tn027819; Mon, 11 Oct 2010 21:23:07 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BLN757027817; Mon, 11 Oct 2010 21:23:07 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201010112123.o9BLN757027817@svn.freebsd.org> From: "George V. Neville-Neil" Date: Mon, 11 Oct 2010 21:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213701 - stable/8/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 21:23:07 -0000 Author: gnn Date: Mon Oct 11 21:23:07 2010 New Revision: 213701 URL: http://svn.freebsd.org/changeset/base/213701 Log: MFC 213409: Fix two aliases that had the same name but were pointing to different events. These are now disamiguated. Modified: stable/8/sys/dev/hwpmc/pmc_events.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/hwpmc/pmc_events.h ============================================================================== --- stable/8/sys/dev/hwpmc/pmc_events.h Mon Oct 11 21:16:50 2010 (r213700) +++ stable/8/sys/dev/hwpmc/pmc_events.h Mon Oct 11 21:23:07 2010 (r213701) @@ -2243,11 +2243,11 @@ __PMC_EV_ALIAS("UOPS_RETIRED.MACRO_FUSED __PMC_EV_ALIAS("MACHINE_CLEARS.CYCLES", IAP_EVENT_C3H_01H) \ __PMC_EV_ALIAS("MACHINE_CLEARS.MEM_ORDER", IAP_EVENT_C3H_02H) \ __PMC_EV_ALIAS("MACHINE_CLEARS.SMC", IAP_EVENT_C3H_04H) \ -__PMC_EV_ALIAS("BR_INST_RETIRED.ALL_BRANCHES", IAP_EVENT_C4H_00H) \ +__PMC_EV_ALIAS("BR_INST_RETIRED.ANY_P", IAP_EVENT_C4H_00H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.CONDITIONAL", IAP_EVENT_C4H_01H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.NEAR_CALL", IAP_EVENT_C4H_02H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.ALL_BRANCHES", IAP_EVENT_C4H_04H) \ -__PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_00H) \ +__PMC_EV_ALIAS("BR_MISP_RETIRED.ANY_P", IAP_EVENT_C5H_00H) \ __PMC_EV_ALIAS("BR_MISP_RETIRED.CONDITIONAL", IAP_EVENT_C5H_01H) \ __PMC_EV_ALIAS("BR_MISP_RETIRED.NEAR_CALL", IAP_EVENT_C5H_02H) \ __PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_04H) \ From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 21:26:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C814106564A; Mon, 11 Oct 2010 21:26:24 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 596A38FC19; Mon, 11 Oct 2010 21:26:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BLQODo027956; Mon, 11 Oct 2010 21:26:24 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BLQO8F027953; Mon, 11 Oct 2010 21:26:24 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201010112126.o9BLQO8F027953@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 11 Oct 2010 21:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213702 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 21:26:24 -0000 Author: mdf Date: Mon Oct 11 21:26:24 2010 New Revision: 213702 URL: http://svn.freebsd.org/changeset/base/213702 Log: Fix up the COMPAT_FREEBSD32 ioctl logic for mps(4). Reviewed by: ken Modified: head/sys/dev/mps/mps_ioctl.h head/sys/dev/mps/mps_user.c Modified: head/sys/dev/mps/mps_ioctl.h ============================================================================== --- head/sys/dev/mps/mps_ioctl.h Mon Oct 11 21:23:07 2010 (r213701) +++ head/sys/dev/mps/mps_ioctl.h Mon Oct 11 21:26:24 2010 (r213702) @@ -103,44 +103,4 @@ struct mps_usr_command { #define MPSIO_RAID_ACTION _IOWR('M', 205, struct mps_raid_action) #define MPSIO_MPS_COMMAND _IOWR('M', 210, struct mps_usr_command) -#if defined(__amd64__) -struct mps_cfg_page_req32 { - MPI2_CONFIG_PAGE_HEADER header; - uint32_t page_address; - uint32_t buf; - int len; - uint16_t ioc_status; -}; - -struct mps_ext_cfg_page_req32 { - MPI2_CONFIG_EXTENDED_PAGE_HEADER header; - uint32_t page_address; - uint32_t buf; - int len; - uint16_t ioc_status; -}; - -struct mps_raid_action32 { - uint8_t action; - uint8_t volume_bus; - uint8_t volume_id; - uint8_t phys_disk_num; - uint32_t action_data_word; - uint32_t buf; - int len; - uint32_t volume_status; - uint32_t action_data[4]; - uint16_t action_status; - uint16_t ioc_status; - uint8_t write; -}; - -#define MPSIO_READ_CFG_HEADER32 _IOWR('M', 100, struct mps_cfg_page_req32) -#define MPSIO_READ_CFG_PAGE32 _IOWR('M', 101, struct mps_cfg_page_req32) -#define MPSIO_READ_EXT_CFG_HEADER32 _IOWR('M', 102, struct mps_ext_cfg_page_req32) -#define MPSIO_READ_EXT_CFG_PAGE32 _IOWR('M', 103, struct mps_ext_cfg_page_req32) -#define MPSIO_WRITE_CFG_PAGE32 _IOWR('M', 104, struct mps_cfg_page_req32) -#define MPSIO_RAID_ACTION32 _IOWR('M', 105, struct mps_raid_action32) -#endif - #endif /* !_MPS_IOCTL_H_ */ Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Mon Oct 11 21:23:07 2010 (r213701) +++ head/sys/dev/mps/mps_user.c Mon Oct 11 21:26:24 2010 (r213702) @@ -33,6 +33,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" + #include #include #include @@ -47,6 +49,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -64,14 +68,14 @@ __FBSDID("$FreeBSD$"); static d_open_t mps_open; static d_close_t mps_close; -static d_ioctl_t mps_ioctl; +static d_ioctl_t mps_ioctl_devsw; static struct cdevsw mps_cdevsw = { .d_version = D_VERSION, .d_flags = 0, .d_open = mps_open, .d_close = mps_close, - .d_ioctl = mps_ioctl, + .d_ioctl = mps_ioctl_devsw, .d_name = "mps", }; @@ -424,25 +428,14 @@ Ret: return err; } -#ifdef __amd64__ -#define PTRIN(p) ((void *)(uintptr_t)(p)) -#define PTROUT(v) ((u_int32_t)(uintptr_t)(v)) -#endif - static int -mps_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, +mps_ioctl(struct cdev *dev, u_long cmd, void *arg, int flag, struct thread *td) { struct mps_softc *sc; struct mps_cfg_page_req *page_req; struct mps_ext_cfg_page_req *ext_page_req; void *mps_page; -#ifdef __amd64__ - struct mps_cfg_page_req32 *page_req32; - struct mps_cfg_page_req page_req_swab; - struct mps_ext_cfg_page_req32 *ext_page_req32; - struct mps_ext_cfg_page_req ext_page_req_swab; -#endif int error; mps_page = NULL; @@ -450,47 +443,12 @@ mps_ioctl(struct cdev *dev, u_long cmd, page_req = (void *)arg; ext_page_req = (void *)arg; -#ifdef __amd64__ - /* Convert 32-bit structs to native ones. */ - page_req32 = (void *)arg; - ext_page_req32 = (void *)arg; - switch (cmd) { - case MPSIO_READ_CFG_HEADER32: - case MPSIO_READ_CFG_PAGE32: - case MPSIO_WRITE_CFG_PAGE32: - page_req = &page_req_swab; - page_req->header = page_req32->header; - page_req->page_address = page_req32->page_address; - page_req->buf = PTRIN(page_req32->buf); - page_req->len = page_req32->len; - page_req->ioc_status = page_req32->ioc_status; - break; - case MPSIO_READ_EXT_CFG_HEADER32: - case MPSIO_READ_EXT_CFG_PAGE32: - ext_page_req = &ext_page_req_swab; - ext_page_req->header = ext_page_req32->header; - ext_page_req->page_address = ext_page_req32->page_address; - ext_page_req->buf = PTRIN(ext_page_req32->buf); - ext_page_req->len = ext_page_req32->len; - ext_page_req->ioc_status = ext_page_req32->ioc_status; - break; - default: - return (ENOIOCTL); - } -#endif - switch (cmd) { -#ifdef __amd64__ - case MPSIO_READ_CFG_HEADER32: -#endif case MPSIO_READ_CFG_HEADER: mps_lock(sc); error = mps_user_read_cfg_header(sc, page_req); mps_unlock(sc); break; -#ifdef __amd64__ - case MPSIO_READ_CFG_PAGE32: -#endif case MPSIO_READ_CFG_PAGE: mps_page = malloc(page_req->len, M_MPSUSER, M_WAITOK | M_ZERO); error = copyin(page_req->buf, mps_page, @@ -504,17 +462,11 @@ mps_ioctl(struct cdev *dev, u_long cmd, break; error = copyout(mps_page, page_req->buf, page_req->len); break; -#ifdef __amd64__ - case MPSIO_READ_EXT_CFG_HEADER32: -#endif case MPSIO_READ_EXT_CFG_HEADER: mps_lock(sc); error = mps_user_read_extcfg_header(sc, ext_page_req); mps_unlock(sc); break; -#ifdef __amd64__ - case MPSIO_READ_EXT_CFG_PAGE32: -#endif case MPSIO_READ_EXT_CFG_PAGE: mps_page = malloc(ext_page_req->len, M_MPSUSER, M_WAITOK|M_ZERO); error = copyin(ext_page_req->buf, mps_page, @@ -528,9 +480,6 @@ mps_ioctl(struct cdev *dev, u_long cmd, break; error = copyout(mps_page, ext_page_req->buf, ext_page_req->len); break; -#ifdef __amd64__ - case MPSIO_WRITE_CFG_PAGE32: -#endif case MPSIO_WRITE_CFG_PAGE: mps_page = malloc(page_req->len, M_MPSUSER, M_WAITOK|M_ZERO); error = copyin(page_req->buf, mps_page, page_req->len); @@ -551,33 +500,207 @@ mps_ioctl(struct cdev *dev, u_long cmd, if (mps_page != NULL) free(mps_page, M_MPSUSER); - if (error) - return (error); + return (error); +} + +#ifdef COMPAT_FREEBSD32 -#ifdef __amd64__ - /* Convert native structs to 32-bit ones. */ - switch (cmd) { +/* Macros from compat/freebsd32/freebsd32.h */ +#define PTRIN(v) (void *)(uintptr_t)(v) +#define PTROUT(v) (uint32_t)(uintptr_t)(v) + +#define CP(src,dst,fld) do { (dst).fld = (src).fld; } while (0) +#define PTRIN_CP(src,dst,fld) \ + do { (dst).fld = PTRIN((src).fld); } while (0) +#define PTROUT_CP(src,dst,fld) \ + do { (dst).fld = PTROUT((src).fld); } while (0) + +struct mps_cfg_page_req32 { + MPI2_CONFIG_PAGE_HEADER header; + uint32_t page_address; + uint32_t buf; + int len; + uint16_t ioc_status; +}; + +struct mps_ext_cfg_page_req32 { + MPI2_CONFIG_EXTENDED_PAGE_HEADER header; + uint32_t page_address; + uint32_t buf; + int len; + uint16_t ioc_status; +}; + +struct mps_raid_action32 { + uint8_t action; + uint8_t volume_bus; + uint8_t volume_id; + uint8_t phys_disk_num; + uint32_t action_data_word; + uint32_t buf; + int len; + uint32_t volume_status; + uint32_t action_data[4]; + uint16_t action_status; + uint16_t ioc_status; + uint8_t write; +}; + +struct mps_usr_command32 { + uint32_t req; + uint32_t req_len; + uint32_t rpl; + uint32_t rpl_len; + uint32_t buf; + int len; + uint32_t flags; +}; + +#define MPSIO_READ_CFG_HEADER32 _IOWR('M', 200, struct mps_cfg_page_req32) +#define MPSIO_READ_CFG_PAGE32 _IOWR('M', 201, struct mps_cfg_page_req32) +#define MPSIO_READ_EXT_CFG_HEADER32 _IOWR('M', 202, struct mps_ext_cfg_page_req32) +#define MPSIO_READ_EXT_CFG_PAGE32 _IOWR('M', 203, struct mps_ext_cfg_page_req32) +#define MPSIO_WRITE_CFG_PAGE32 _IOWR('M', 204, struct mps_cfg_page_req32) +#define MPSIO_RAID_ACTION32 _IOWR('M', 205, struct mps_raid_action32) +#define MPSIO_MPS_COMMAND32 _IOWR('M', 210, struct mps_usr_command32) + +static int +mps_ioctl32(struct cdev *dev, u_long cmd32, void *_arg, int flag, + struct thread *td) +{ + struct mps_cfg_page_req32 *page32 = _arg; + struct mps_ext_cfg_page_req32 *ext32 = _arg; + struct mps_raid_action32 *raid32 = _arg; + struct mps_usr_command32 *user32 = _arg; + union { + struct mps_cfg_page_req page; + struct mps_ext_cfg_page_req ext; + struct mps_raid_action raid; + struct mps_usr_command user; + } arg; + u_long cmd; + int error; + + switch (cmd32) { case MPSIO_READ_CFG_HEADER32: case MPSIO_READ_CFG_PAGE32: case MPSIO_WRITE_CFG_PAGE32: - page_req32->header = page_req->header; - page_req32->page_address = page_req->page_address; - page_req32->buf = PTROUT(page_req->buf); - page_req32->len = page_req->len; - page_req32->ioc_status = page_req->ioc_status; + if (cmd32 == MPSIO_READ_CFG_HEADER32) + cmd = MPSIO_READ_CFG_HEADER; + else if (cmd32 == MPSIO_READ_CFG_PAGE32) + cmd = MPSIO_READ_CFG_PAGE; + else + cmd = MPSIO_WRITE_CFG_PAGE; + CP(*page32, arg.page, header); + CP(*page32, arg.page, page_address); + PTRIN_CP(*page32, arg.page, buf); + CP(*page32, arg.page, len); + CP(*page32, arg.page, ioc_status); break; + case MPSIO_READ_EXT_CFG_HEADER32: - case MPSIO_READ_EXT_CFG_PAGE32: - ext_page_req32->header = ext_page_req->header; - ext_page_req32->page_address = ext_page_req->page_address; - ext_page_req32->buf = PTROUT(ext_page_req->buf); - ext_page_req32->len = ext_page_req->len; - ext_page_req32->ioc_status = ext_page_req->ioc_status; + case MPSIO_READ_EXT_CFG_PAGE32: + if (cmd32 == MPSIO_READ_EXT_CFG_HEADER32) + cmd = MPSIO_READ_EXT_CFG_HEADER; + else + cmd = MPSIO_READ_EXT_CFG_PAGE; + CP(*ext32, arg.ext, header); + CP(*ext32, arg.ext, page_address); + PTRIN_CP(*ext32, arg.ext, buf); + CP(*ext32, arg.ext, len); + CP(*ext32, arg.ext, ioc_status); + break; + + case MPSIO_RAID_ACTION32: + cmd = MPSIO_RAID_ACTION; + CP(*raid32, arg.raid, action); + CP(*raid32, arg.raid, volume_bus); + CP(*raid32, arg.raid, volume_id); + CP(*raid32, arg.raid, phys_disk_num); + CP(*raid32, arg.raid, action_data_word); + PTRIN_CP(*raid32, arg.raid, buf); + CP(*raid32, arg.raid, len); + CP(*raid32, arg.raid, volume_status); + bcopy(raid32->action_data, arg.raid.action_data, + sizeof arg.raid.action_data); + CP(*raid32, arg.raid, ioc_status); + CP(*raid32, arg.raid, write); + break; + + case MPSIO_MPS_COMMAND32: + cmd = MPSIO_MPS_COMMAND; + PTRIN_CP(*user32, arg.user, req); + CP(*user32, arg.user, req_len); + PTRIN_CP(*user32, arg.user, rpl); + CP(*user32, arg.user, rpl_len); + PTRIN_CP(*user32, arg.user, buf); + CP(*user32, arg.user, len); + CP(*user32, arg.user, flags); break; default: return (ENOIOCTL); } -#endif - return (0); + error = mps_ioctl(dev, cmd, &arg, flag, td); + if (error == 0 && (cmd32 & IOC_OUT) != 0) { + switch (cmd32) { + case MPSIO_READ_CFG_HEADER32: + case MPSIO_READ_CFG_PAGE32: + case MPSIO_WRITE_CFG_PAGE32: + CP(arg.page, *page32, header); + CP(arg.page, *page32, page_address); + PTROUT_CP(arg.page, *page32, buf); + CP(arg.page, *page32, len); + CP(arg.page, *page32, ioc_status); + break; + + case MPSIO_READ_EXT_CFG_HEADER32: + case MPSIO_READ_EXT_CFG_PAGE32: + CP(arg.ext, *ext32, header); + CP(arg.ext, *ext32, page_address); + PTROUT_CP(arg.ext, *ext32, buf); + CP(arg.ext, *ext32, len); + CP(arg.ext, *ext32, ioc_status); + break; + + case MPSIO_RAID_ACTION32: + CP(arg.raid, *raid32, action); + CP(arg.raid, *raid32, volume_bus); + CP(arg.raid, *raid32, volume_id); + CP(arg.raid, *raid32, phys_disk_num); + CP(arg.raid, *raid32, action_data_word); + PTROUT_CP(arg.raid, *raid32, buf); + CP(arg.raid, *raid32, len); + CP(arg.raid, *raid32, volume_status); + bcopy(arg.raid.action_data, raid32->action_data, + sizeof arg.raid.action_data); + CP(arg.raid, *raid32, ioc_status); + CP(arg.raid, *raid32, write); + break; + + case MPSIO_MPS_COMMAND32: + PTROUT_CP(arg.user, *user32, req); + CP(arg.user, *user32, req_len); + PTROUT_CP(arg.user, *user32, rpl); + CP(arg.user, *user32, rpl_len); + PTROUT_CP(arg.user, *user32, buf); + CP(arg.user, *user32, len); + CP(arg.user, *user32, flags); + break; + } + } + + return (error); +} +#endif /* COMPAT_FREEBSD32 */ + +static int +mps_ioctl_devsw(struct cdev *dev, u_long com, caddr_t arg, int flag, + struct thread *td) +{ +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) + return (mps_ioctl32(dev, com, arg, flag, td)); +#endif + return (mps_ioctl(dev, com, arg, flag, td)); } From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 21:34:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 020D510656A6; Mon, 11 Oct 2010 21:34: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 E4BF68FC0A; Mon, 11 Oct 2010 21:34:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BLYZFZ028151; Mon, 11 Oct 2010 21:34:35 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BLYZef028149; Mon, 11 Oct 2010 21:34:35 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010112134.o9BLYZef028149@svn.freebsd.org> From: Andriy Gapon Date: Mon, 11 Oct 2010 21:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213703 - head/lib/libcam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 21:34:36 -0000 Author: avg Date: Mon Oct 11 21:34:35 2010 New Revision: 213703 URL: http://svn.freebsd.org/changeset/base/213703 Log: camlib.c: update one overlooked comment Modified: head/lib/libcam/camlib.c Modified: head/lib/libcam/camlib.c ============================================================================== --- head/lib/libcam/camlib.c Mon Oct 11 21:26:24 2010 (r213702) +++ head/lib/libcam/camlib.c Mon Oct 11 21:34:35 2010 (r213703) @@ -165,9 +165,9 @@ cam_get_device(const char *path, char *d } /* - * After we nuke off the slice, we should have just a device name - * and unit number. That means there must be at least 2 - * characters. If we only have 1, we don't have a valid device name. + * We should now have just a device name and unit number. + * That means that there must be at least 2 characters. + * If we only have 1, we don't have a valid device name. */ if (strlen(tmpstr) < 2) { sprintf(cam_errbuf, From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 21:38:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E807106564A; Mon, 11 Oct 2010 21:38:32 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 128138FC12; Mon, 11 Oct 2010 21:38:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BLcVML028267; Mon, 11 Oct 2010 21:38:31 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BLcVIZ028265; Mon, 11 Oct 2010 21:38:31 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201010112138.o9BLcVIZ028265@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 11 Oct 2010 21:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213704 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 21:38:32 -0000 Author: mdf Date: Mon Oct 11 21:38:31 2010 New Revision: 213704 URL: http://svn.freebsd.org/changeset/base/213704 Log: Fix a memory leak and locking inconsistency in mps(4) ioctl handling. Check copyin(9) for error and sanity check the length before copyin. Reviewed by: ken Modified: head/sys/dev/mps/mps_user.c Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Mon Oct 11 21:34:35 2010 (r213703) +++ head/sys/dev/mps/mps_user.c Mon Oct 11 21:38:31 2010 (r213704) @@ -343,7 +343,7 @@ mps_user_command(struct mps_softc *sc, s MPI2_REQUEST_HEADER *hdr; MPI2_DEFAULT_REPLY *rpl; MPI2_SGE_IO_UNION *sgl; - void *buf; + void *buf = NULL; struct mps_command *cm; int err = 0; int sz; @@ -363,7 +363,13 @@ mps_user_command(struct mps_softc *sc, s mps_dprint(sc, MPS_INFO, "mps_user_command: req %p %d rpl %p %d\n", cmd->req, cmd->req_len, cmd->rpl, cmd->rpl_len ); - copyin(cmd->req, hdr, cmd->req_len); + if (cmd->req_len > (int)sc->facts->IOCRequestFrameSize * 4) { + err = EINVAL; + goto RetFreeUnlocked; + } + err = copyin(cmd->req, hdr, cmd->req_len); + if (err != 0) + goto RetFreeUnlocked; mps_dprint(sc, MPS_INFO, "mps_user_command: Function %02X " "MsgFlags %02X\n", hdr->Function, hdr->MsgFlags ); @@ -372,7 +378,7 @@ mps_user_command(struct mps_softc *sc, s if (err != 0) { mps_printf(sc, "mps_user_command: unsupported function 0x%X\n", hdr->Function ); - goto RetFree; + goto RetFreeUnlocked; } if (cmd->len > 0) { @@ -380,7 +386,6 @@ mps_user_command(struct mps_softc *sc, s cm->cm_data = buf; cm->cm_length = cmd->len; } else { - buf = NULL; cm->cm_data = NULL; cm->cm_length = 0; } @@ -412,20 +417,27 @@ mps_user_command(struct mps_softc *sc, s mps_unlock(sc); copyout(rpl, cmd->rpl, sz); - if (buf != NULL) { + if (buf != NULL) copyout(buf, cmd->buf, cmd->len); - free(buf, M_MPSUSER); - } mps_lock(sc); mps_dprint(sc, MPS_INFO, "mps_user_command: reply size %d\n", sz ); -RetFree: mps_free_command(sc, cm); - Ret: mps_unlock(sc); - return err; + if (buf != NULL) + free(buf, M_MPSUSER); + return (err); + +RetFreeUnlocked: + mps_lock(sc); + mps_free_command(sc, cm); + mps_unlock(sc); + + if (buf != NULL) + free(buf, M_MPSUSER); + return (err); } static int From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 21:53:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA67D106564A; Mon, 11 Oct 2010 21:53:03 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8ADF8FC21; Mon, 11 Oct 2010 21:53:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BLr3XH028586; Mon, 11 Oct 2010 21:53:03 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BLr3lW028584; Mon, 11 Oct 2010 21:53:03 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201010112153.o9BLr3lW028584@svn.freebsd.org> From: Andrew Thompson Date: Mon, 11 Oct 2010 21:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213705 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 21:53:03 -0000 Author: thompsa Date: Mon Oct 11 21:53:03 2010 New Revision: 213705 URL: http://svn.freebsd.org/changeset/base/213705 Log: Add the XHCI USB controller to NOTES. Reviewed by: hselasky Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Oct 11 21:38:31 2010 (r213704) +++ head/sys/conf/NOTES Mon Oct 11 21:53:03 2010 (r213705) @@ -2609,6 +2609,8 @@ device uhci device ohci # EHCI controller device ehci +# XHCI controller +device xhci # SL811 Controller #device slhci # General USB code (mandatory for USB) From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 22:41:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CA54106566B; Mon, 11 Oct 2010 22:41:02 +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 395C98FC0A; Mon, 11 Oct 2010 22:41:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BMf2v9029741; Mon, 11 Oct 2010 22:41:02 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BMf2OZ029739; Mon, 11 Oct 2010 22:41:02 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010112241.o9BMf2OZ029739@svn.freebsd.org> From: Andriy Gapon Date: Mon, 11 Oct 2010 22:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213706 - stable/8/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 22:41:02 -0000 Author: avg Date: Mon Oct 11 22:41:01 2010 New Revision: 213706 URL: http://svn.freebsd.org/changeset/base/213706 Log: MFC r208722: Remove unnecessary pointer type castings, shift operations and dead code. On behalf of: jkim Modified: stable/8/sys/dev/acpica/acpi_ec.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_ec.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_ec.c Mon Oct 11 21:53:03 2010 (r213705) +++ stable/8/sys/dev/acpica/acpi_ec.c Mon Oct 11 22:41:01 2010 (r213706) @@ -223,7 +223,7 @@ static ACPI_STATUS EcSpaceSetup(ACPI_HAN void *Context, void **return_Context); static ACPI_STATUS EcSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, - UINT32 width, UINT64 *Value, + UINT32 Width, UINT64 *Value, void *Context, void *RegionContext); static ACPI_STATUS EcWaitEvent(struct acpi_ec_softc *sc, EC_EVENT Event, u_int gen_count); @@ -231,7 +231,7 @@ static ACPI_STATUS EcCommand(struct acpi static ACPI_STATUS EcRead(struct acpi_ec_softc *sc, UINT8 Address, UINT8 *Data); static ACPI_STATUS EcWrite(struct acpi_ec_softc *sc, UINT8 Address, - UINT8 *Data); + UINT8 Data); static int acpi_ec_probe(device_t dev); static int acpi_ec_attach(device_t dev); static int acpi_ec_suspend(device_t dev); @@ -717,25 +717,27 @@ EcSpaceSetup(ACPI_HANDLE Region, UINT32 } static ACPI_STATUS -EcSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 width, +EcSpaceHandler(UINT32 Function, ACPI_PHYSICAL_ADDRESS Address, UINT32 Width, UINT64 *Value, void *Context, void *RegionContext) { struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; ACPI_STATUS Status; - UINT8 EcAddr, EcData; - int i; + UINT8 *EcData; + UINT8 EcAddr; + int bytes, i; ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, (UINT32)Address); - if (width % 8 != 0 || Value == NULL || Context == NULL) + if (Width % 8 != 0 || Value == NULL || Context == NULL) return_ACPI_STATUS (AE_BAD_PARAMETER); - if (Address + (width / 8) - 1 > 0xFF) + bytes = Width / 8; + if (Address + bytes - 1 > 0xFF) return_ACPI_STATUS (AE_BAD_ADDRESS); if (Function == ACPI_READ) *Value = 0; EcAddr = Address; - Status = AE_ERROR; + EcData = (UINT8 *)Value; /* * If booting, check if we need to run the query handler. If so, we @@ -753,17 +755,14 @@ EcSpaceHandler(UINT32 Function, ACPI_PHY if (ACPI_FAILURE(Status)) return_ACPI_STATUS (Status); - /* Perform the transaction(s), based on width. */ - for (i = 0; i < width; i += 8, EcAddr++) { + /* Perform the transaction(s), based on Width. */ + for (i = 0; i < bytes; i++, EcAddr++, EcData++) { switch (Function) { case ACPI_READ: - Status = EcRead(sc, EcAddr, &EcData); - if (ACPI_SUCCESS(Status)) - *Value |= ((UINT64)EcData) << i; + Status = EcRead(sc, EcAddr, EcData); break; case ACPI_WRITE: - EcData = (UINT8)((*Value) >> i); - Status = EcWrite(sc, EcAddr, &EcData); + Status = EcWrite(sc, EcAddr, *EcData); break; default: device_printf(sc->ec_dev, "invalid EcSpaceHandler function %d\n", @@ -986,14 +985,14 @@ EcRead(struct acpi_ec_softc *sc, UINT8 A } static ACPI_STATUS -EcWrite(struct acpi_ec_softc *sc, UINT8 Address, UINT8 *Data) +EcWrite(struct acpi_ec_softc *sc, UINT8 Address, UINT8 Data) { ACPI_STATUS status; UINT8 data; u_int gen_count; ACPI_SERIAL_ASSERT(ec); - CTR2(KTR_ACPI, "ec write to %#x, data %#x", Address, *Data); + CTR2(KTR_ACPI, "ec write to %#x, data %#x", Address, Data); /* If we can't start burst mode, continue anyway. */ status = EcCommand(sc, EC_COMMAND_BURST_ENABLE); @@ -1018,7 +1017,7 @@ EcWrite(struct acpi_ec_softc *sc, UINT8 } gen_count = sc->ec_gencount; - EC_SET_DATA(sc, *Data); + EC_SET_DATA(sc, Data); status = EcWaitEvent(sc, EC_EVENT_INPUT_BUFFER_EMPTY, gen_count); if (ACPI_FAILURE(status)) { device_printf(sc->ec_dev, "EcWrite: failed waiting for sent data\n"); From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 22:44:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C7A310656C3; Mon, 11 Oct 2010 22:44:05 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A6CC8FC12; Mon, 11 Oct 2010 22:44:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BMi5k0029926; Mon, 11 Oct 2010 22:44:05 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BMi5qh029924; Mon, 11 Oct 2010 22:44:05 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201010112244.o9BMi5qh029924@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 11 Oct 2010 22:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213707 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 22:44:05 -0000 Author: mdf Date: Mon Oct 11 22:44:05 2010 New Revision: 213707 URL: http://svn.freebsd.org/changeset/base/213707 Log: Add function prototypes for static functions. Requested by: ken Modified: head/sys/dev/mps/mps_user.c Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Mon Oct 11 22:41:01 2010 (r213706) +++ head/sys/dev/mps/mps_user.c Mon Oct 11 22:44:05 2010 (r213707) @@ -79,6 +79,19 @@ static struct cdevsw mps_cdevsw = { .d_name = "mps", }; +static int mps_user_read_cfg_header(struct mps_softc *, + struct mps_cfg_page_req *); +static int mps_user_read_cfg_page(struct mps_softc *, + struct mps_cfg_page_req *, void *); +static int mps_user_read_extcfg_header(struct mps_softc *, + struct mps_ext_cfg_page_req *); +static int mps_user_read_extcfg_page(struct mps_softc *, + struct mps_ext_cfg_page_req *, void *); +static int mps_user_write_cfg_page(struct mps_softc *, + struct mps_cfg_page_req *, void *); +static int mps_user_verify_request(MPI2_REQUEST_HEADER *, MPI2_SGE_IO_UNION **); +static int mps_user_command(struct mps_softc *, struct mps_usr_command *); + static MALLOC_DEFINE(M_MPSUSER, "mps_user", "Buffers for mps(4) ioctls"); int From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 22:44:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAC3B1065698; Mon, 11 Oct 2010 22:44:15 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C85368FC1E; Mon, 11 Oct 2010 22:44:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BMiF15029969; Mon, 11 Oct 2010 22:44:15 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BMiFVb029967; Mon, 11 Oct 2010 22:44:15 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201010112244.o9BMiFVb029967@svn.freebsd.org> From: Matthew D Fleming Date: Mon, 11 Oct 2010 22:44:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213708 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 22:44:16 -0000 Author: mdf Date: Mon Oct 11 22:44:15 2010 New Revision: 213708 URL: http://svn.freebsd.org/changeset/base/213708 Log: Re-work the internal user ioctl command table, and support the FW_UPLOAD command. Reviewed by: ken (previous version) Modified: head/sys/dev/mps/mps_user.c Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Mon Oct 11 22:44:05 2010 (r213707) +++ head/sys/dev/mps/mps_user.c Mon Oct 11 22:44:15 2010 (r213708) @@ -79,6 +79,16 @@ static struct cdevsw mps_cdevsw = { .d_name = "mps", }; +typedef int (mps_user_f)(struct mps_command *, struct mps_usr_command *); +static mps_user_f mpi_pre_ioc_facts; +static mps_user_f mpi_pre_port_facts; +static mps_user_f mpi_pre_fw_download; +static mps_user_f mpi_pre_fw_upload; +static mps_user_f mpi_pre_sata_passthrough; +static mps_user_f mpi_pre_smp_passthrough; +static mps_user_f mpi_pre_config; +static mps_user_f mpi_pre_sas_io_unit_control; + static int mps_user_read_cfg_header(struct mps_softc *, struct mps_cfg_page_req *); static int mps_user_read_cfg_page(struct mps_softc *, @@ -89,7 +99,8 @@ static int mps_user_read_extcfg_page(str struct mps_ext_cfg_page_req *, void *); static int mps_user_write_cfg_page(struct mps_softc *, struct mps_cfg_page_req *, void *); -static int mps_user_verify_request(MPI2_REQUEST_HEADER *, MPI2_SGE_IO_UNION **); +static int mps_user_setup_request(struct mps_command *, + struct mps_usr_command *); static int mps_user_command(struct mps_softc *, struct mps_usr_command *); static MALLOC_DEFINE(M_MPSUSER, "mps_user", "Buffers for mps(4) ioctls"); @@ -311,43 +322,212 @@ mps_user_write_cfg_page(struct mps_softc return (0); } +/* + * Prepare the mps_command for an IOC_FACTS request. + */ +static int +mpi_pre_ioc_facts(struct mps_command *cm, struct mps_usr_command *cmd) +{ + MPI2_IOC_FACTS_REQUEST *req = (void *)cm->cm_req; + MPI2_IOC_FACTS_REPLY *rpl; + + if (cmd->req_len != sizeof *req) + return (EINVAL); + if (cmd->rpl_len != sizeof *rpl) + return (EINVAL); + + cm->cm_sge = NULL; + cm->cm_sglsize = 0; + return (0); +} + +/* + * Prepare the mps_command for a PORT_FACTS request. + */ +static int +mpi_pre_port_facts(struct mps_command *cm, struct mps_usr_command *cmd) +{ + MPI2_PORT_FACTS_REQUEST *req = (void *)cm->cm_req; + MPI2_PORT_FACTS_REPLY *rpl; + + if (cmd->req_len != sizeof *req) + return (EINVAL); + if (cmd->rpl_len != sizeof *rpl) + return (EINVAL); + + cm->cm_sge = NULL; + cm->cm_sglsize = 0; + return (0); +} + +/* + * Prepare the mps_command for a FW_DOWNLOAD request. + */ +static int +mpi_pre_fw_download(struct mps_command *cm, struct mps_usr_command *cmd) +{ + MPI2_FW_DOWNLOAD_REQUEST *req = (void *)cm->cm_req; + MPI2_FW_DOWNLOAD_REPLY *rpl; + + if (cmd->req_len != sizeof *req) + return (EINVAL); + if (cmd->rpl_len != sizeof *rpl) + return (EINVAL); + + cm->cm_sge = (MPI2_SGE_IO_UNION *)&req->SGL; + cm->cm_sglsize = sizeof req->SGL; + return (0); +} + +/* + * Prepare the mps_command for a FW_UPLOAD request. + */ +static int +mpi_pre_fw_upload(struct mps_command *cm, struct mps_usr_command *cmd) +{ + MPI2_FW_UPLOAD_REQUEST *req = (void *)cm->cm_req; + MPI2_FW_UPLOAD_REPLY *rpl; + MPI2_FW_UPLOAD_TCSGE *tc; + + /* + * This code assumes there is room in the request's SGL for + * the TransactionContext plus at least a SGL chain element. + */ + CTASSERT(sizeof req->SGL >= sizeof *tc + MPS_SGC_SIZE); + + if (cmd->req_len != sizeof *req) + return (EINVAL); + if (cmd->rpl_len != sizeof *rpl) + return (EINVAL); + + cm->cm_sglsize = sizeof req->SGL; + if (cmd->len == 0) { + /* Perhaps just asking what the size of the fw is? */ + cm->cm_sge = (MPI2_SGE_IO_UNION *)&req->SGL; + return (0); + } + + tc = (void *)&req->SGL; + bzero(tc, sizeof *tc); + + /* + * The value of the first two elements is specified in the + * Fusion-MPT Message Passing Interface document. + */ + tc->ContextSize = 0; + tc->DetailsLength = 12; + /* + * XXX Is there any reason to fetch a partial image? I.e. to + * set ImageOffset to something other than 0? + */ + tc->ImageOffset = 0; + tc->ImageSize = cmd->len; + cm->cm_sge = (MPI2_SGE_IO_UNION *)(tc + 1); + cm->cm_sglsize -= sizeof *tc; + + return (0); +} + +/* + * Prepare the mps_command for a SATA_PASSTHROUGH request. + */ +static int +mpi_pre_sata_passthrough(struct mps_command *cm, struct mps_usr_command *cmd) +{ + MPI2_SATA_PASSTHROUGH_REQUEST *req = (void *)cm->cm_req; + MPI2_SATA_PASSTHROUGH_REPLY *rpl; + + if (cmd->req_len != sizeof *req) + return (EINVAL); + if (cmd->rpl_len != sizeof *rpl) + return (EINVAL); + + cm->cm_sge = (MPI2_SGE_IO_UNION *)&req->SGL; + cm->cm_sglsize = sizeof req->SGL; + return (0); +} + +/* + * Prepare the mps_command for a SMP_PASSTHROUGH request. + */ +static int +mpi_pre_smp_passthrough(struct mps_command *cm, struct mps_usr_command *cmd) +{ + MPI2_SMP_PASSTHROUGH_REQUEST *req = (void *)cm->cm_req; + MPI2_SMP_PASSTHROUGH_REPLY *rpl; + + if (cmd->req_len != sizeof *req) + return (EINVAL); + if (cmd->rpl_len != sizeof *rpl) + return (EINVAL); + + cm->cm_sge = (MPI2_SGE_IO_UNION *)&req->SGL; + cm->cm_sglsize = sizeof req->SGL; + return (0); +} + +/* + * Prepare the mps_command for a CONFIG request. + */ +static int +mpi_pre_config(struct mps_command *cm, struct mps_usr_command *cmd) +{ + MPI2_CONFIG_REQUEST *req = (void *)cm->cm_req; + MPI2_CONFIG_REPLY *rpl; + + if (cmd->req_len != sizeof *req) + return (EINVAL); + if (cmd->rpl_len != sizeof *rpl) + return (EINVAL); + + cm->cm_sge = (MPI2_SGE_IO_UNION *)&req->PageBufferSGE; + cm->cm_sglsize = sizeof req->PageBufferSGE; + return (0); +} + +/* + * Prepare the mps_command for a SAS_IO_UNIT_CONTROL request. + */ +static int +mpi_pre_sas_io_unit_control(struct mps_command *cm, + struct mps_usr_command *cmd) +{ + + cm->cm_sge = NULL; + cm->cm_sglsize = 0; + return (0); +} + +/* + * A set of functions to prepare an mps_command for the various + * supported requests. + */ struct mps_user_func { - U8 Func; - U8 SgOff; + U8 Function; + mps_user_f *f_pre; } mps_user_func_list[] = { - { MPI2_FUNCTION_IOC_FACTS, 0 }, - { MPI2_FUNCTION_PORT_FACTS, 0 }, - { MPI2_FUNCTION_FW_DOWNLOAD, offsetof(Mpi2FWDownloadRequest,SGL)}, - { MPI2_FUNCTION_FW_UPLOAD, offsetof(Mpi2FWUploadRequest_t,SGL)}, - { MPI2_FUNCTION_SATA_PASSTHROUGH,offsetof(Mpi2SataPassthroughRequest_t,SGL)}, - { MPI2_FUNCTION_SMP_PASSTHROUGH, offsetof(Mpi2SmpPassthroughRequest_t,SGL)}, - { MPI2_FUNCTION_CONFIG, offsetof(Mpi2ConfigRequest_t,PageBufferSGE)}, - { MPI2_FUNCTION_SAS_IO_UNIT_CONTROL, 0 }, -}; - -static int -mps_user_verify_request(MPI2_REQUEST_HEADER *hdr, MPI2_SGE_IO_UNION **psgl) -{ - int i, err = EINVAL; - - for (i = 0; i < sizeof(mps_user_func_list) / - sizeof(mps_user_func_list[0]); i++ ) { - struct mps_user_func *func = &mps_user_func_list[i]; - - if (hdr->Function == func->Func) { - if (psgl != NULL) { - if (func->SgOff != 0) - *psgl = (PTR_MPI2_SGE_IO_UNION) - ((char*)hdr + func->SgOff); - else - *psgl = NULL; - err = 0; - break; - } - } - } + { MPI2_FUNCTION_IOC_FACTS, mpi_pre_ioc_facts }, + { MPI2_FUNCTION_PORT_FACTS, mpi_pre_port_facts }, + { MPI2_FUNCTION_FW_DOWNLOAD, mpi_pre_fw_download }, + { MPI2_FUNCTION_FW_UPLOAD, mpi_pre_fw_upload }, + { MPI2_FUNCTION_SATA_PASSTHROUGH, mpi_pre_sata_passthrough }, + { MPI2_FUNCTION_SMP_PASSTHROUGH, mpi_pre_smp_passthrough}, + { MPI2_FUNCTION_CONFIG, mpi_pre_config}, + { MPI2_FUNCTION_SAS_IO_UNIT_CONTROL, mpi_pre_sas_io_unit_control }, + { 0xFF, NULL } /* list end */ +}; - return err; +static int +mps_user_setup_request(struct mps_command *cm, struct mps_usr_command *cmd) +{ + MPI2_REQUEST_HEADER *hdr = (MPI2_REQUEST_HEADER *)cm->cm_req; + struct mps_user_func *f; + + for (f = mps_user_func_list; f->f_pre != NULL; f++) { + if (hdr->Function == f->Function) + return (f->f_pre(cm, cmd)); + } + return (EINVAL); } static int @@ -355,7 +535,6 @@ mps_user_command(struct mps_softc *sc, s { MPI2_REQUEST_HEADER *hdr; MPI2_DEFAULT_REPLY *rpl; - MPI2_SGE_IO_UNION *sgl; void *buf = NULL; struct mps_command *cm; int err = 0; @@ -387,7 +566,7 @@ mps_user_command(struct mps_softc *sc, s mps_dprint(sc, MPS_INFO, "mps_user_command: Function %02X " "MsgFlags %02X\n", hdr->Function, hdr->MsgFlags ); - err = mps_user_verify_request(hdr, &sgl); + err = mps_user_setup_request(cm, cmd); if (err != 0) { mps_printf(sc, "mps_user_command: unsupported function 0x%X\n", hdr->Function ); @@ -403,8 +582,6 @@ mps_user_command(struct mps_softc *sc, s cm->cm_length = 0; } - cm->cm_sge = sgl; - cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); cm->cm_flags = MPS_CM_FLAGS_SGE_SIMPLE | MPS_CM_FLAGS_WAKEUP; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 22:46:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C254F106566B; Mon, 11 Oct 2010 22:46:15 +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 AF21A8FC17; Mon, 11 Oct 2010 22:46:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BMkFxI030056; Mon, 11 Oct 2010 22:46:15 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BMkFKA030054; Mon, 11 Oct 2010 22:46:15 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010112246.o9BMkFKA030054@svn.freebsd.org> From: Andriy Gapon Date: Mon, 11 Oct 2010 22:46:15 +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: r213709 - stable/8/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 22:46:15 -0000 Author: avg Date: Mon Oct 11 22:46:15 2010 New Revision: 213709 URL: http://svn.freebsd.org/changeset/base/213709 Log: MFC r210977: When EC burst mode is activated and multiple bytes are accessed, do not disable and enable repeatedly, just do it once per call. It also reduces code duplication. Check all parameters early and fail immediately. On behalf of: jkim Modified: stable/8/sys/dev/acpica/acpi_ec.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_ec.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_ec.c Mon Oct 11 22:44:15 2010 (r213708) +++ stable/8/sys/dev/acpica/acpi_ec.c Mon Oct 11 22:46:15 2010 (r213709) @@ -721,24 +721,19 @@ EcSpaceHandler(UINT32 Function, ACPI_PHY UINT64 *Value, void *Context, void *RegionContext) { struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; - ACPI_STATUS Status; + ACPI_PHYSICAL_ADDRESS EcAddr; UINT8 *EcData; - UINT8 EcAddr; - int bytes, i; + ACPI_STATUS Status; ACPI_FUNCTION_TRACE_U32((char *)(uintptr_t)__func__, (UINT32)Address); + if (Function != ACPI_READ && Function != ACPI_WRITE) + return_ACPI_STATUS (AE_BAD_PARAMETER); if (Width % 8 != 0 || Value == NULL || Context == NULL) return_ACPI_STATUS (AE_BAD_PARAMETER); - bytes = Width / 8; - if (Address + bytes - 1 > 0xFF) + if (Address + Width / 8 > 256) return_ACPI_STATUS (AE_BAD_ADDRESS); - if (Function == ACPI_READ) - *Value = 0; - EcAddr = Address; - EcData = (UINT8 *)Value; - /* * If booting, check if we need to run the query handler. If so, we * we call it directly here since our thread taskq is not active yet. @@ -755,8 +750,21 @@ EcSpaceHandler(UINT32 Function, ACPI_PHY if (ACPI_FAILURE(Status)) return_ACPI_STATUS (Status); + /* If we can't start burst mode, continue anyway. */ + Status = EcCommand(sc, EC_COMMAND_BURST_ENABLE); + if (ACPI_SUCCESS(Status)) { + if (EC_GET_DATA(sc) == EC_BURST_ACK) { + CTR0(KTR_ACPI, "ec burst enabled"); + sc->ec_burstactive = TRUE; + } + } + /* Perform the transaction(s), based on Width. */ - for (i = 0; i < bytes; i++, EcAddr++, EcData++) { + EcAddr = Address; + EcData = (UINT8 *)Value; + if (Function == ACPI_READ) + *Value = 0; + do { switch (Function) { case ACPI_READ: Status = EcRead(sc, EcAddr, EcData); @@ -764,14 +772,17 @@ EcSpaceHandler(UINT32 Function, ACPI_PHY case ACPI_WRITE: Status = EcWrite(sc, EcAddr, *EcData); break; - default: - device_printf(sc->ec_dev, "invalid EcSpaceHandler function %d\n", - Function); - Status = AE_BAD_PARAMETER; - break; } if (ACPI_FAILURE(Status)) break; + EcAddr++; + EcData++; + } while (EcAddr < Address + Width / 8); + + if (sc->ec_burstactive) { + sc->ec_burstactive = FALSE; + if (ACPI_SUCCESS(EcCommand(sc, EC_COMMAND_BURST_DISABLE))) + CTR0(KTR_ACPI, "ec disabled burst ok"); } EcUnlock(sc); @@ -944,22 +955,11 @@ static ACPI_STATUS EcRead(struct acpi_ec_softc *sc, UINT8 Address, UINT8 *Data) { ACPI_STATUS status; - UINT8 data; u_int gen_count; ACPI_SERIAL_ASSERT(ec); CTR1(KTR_ACPI, "ec read from %#x", Address); - /* If we can't start burst mode, continue anyway. */ - status = EcCommand(sc, EC_COMMAND_BURST_ENABLE); - if (status == AE_OK) { - data = EC_GET_DATA(sc); - if (data == EC_BURST_ACK) { - CTR0(KTR_ACPI, "ec burst enabled"); - sc->ec_burstactive = TRUE; - } - } - status = EcCommand(sc, EC_COMMAND_READ); if (ACPI_FAILURE(status)) return (status); @@ -973,14 +973,6 @@ EcRead(struct acpi_ec_softc *sc, UINT8 A } *Data = EC_GET_DATA(sc); - if (sc->ec_burstactive) { - sc->ec_burstactive = FALSE; - status = EcCommand(sc, EC_COMMAND_BURST_DISABLE); - if (ACPI_FAILURE(status)) - return (status); - CTR0(KTR_ACPI, "ec disabled burst ok"); - } - return (AE_OK); } @@ -988,22 +980,11 @@ static ACPI_STATUS EcWrite(struct acpi_ec_softc *sc, UINT8 Address, UINT8 Data) { ACPI_STATUS status; - UINT8 data; u_int gen_count; ACPI_SERIAL_ASSERT(ec); CTR2(KTR_ACPI, "ec write to %#x, data %#x", Address, Data); - /* If we can't start burst mode, continue anyway. */ - status = EcCommand(sc, EC_COMMAND_BURST_ENABLE); - if (status == AE_OK) { - data = EC_GET_DATA(sc); - if (data == EC_BURST_ACK) { - CTR0(KTR_ACPI, "ec burst enabled"); - sc->ec_burstactive = TRUE; - } - } - status = EcCommand(sc, EC_COMMAND_WRITE); if (ACPI_FAILURE(status)) return (status); @@ -1024,13 +1005,5 @@ EcWrite(struct acpi_ec_softc *sc, UINT8 return (status); } - if (sc->ec_burstactive) { - sc->ec_burstactive = FALSE; - status = EcCommand(sc, EC_COMMAND_BURST_DISABLE); - if (ACPI_FAILURE(status)) - return (status); - CTR0(KTR_ACPI, "ec disabled burst ok"); - } - return (AE_OK); } From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 22:56:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 716A8106566B; Mon, 11 Oct 2010 22:56:24 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 449FC8FC0A; Mon, 11 Oct 2010 22:56:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BMuONA030310; Mon, 11 Oct 2010 22:56:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BMuOIN030308; Mon, 11 Oct 2010 22:56:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010112256.o9BMuOIN030308@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 11 Oct 2010 22:56:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213710 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 22:56:24 -0000 Author: yongari Date: Mon Oct 11 22:56:23 2010 New Revision: 213710 URL: http://svn.freebsd.org/changeset/base/213710 Log: Remove one last reference of BGE_MI_MODE register for auto polling. Previously bge(4) always enabled auto polling for non-BGE_FLAG_TBI controllers. With this change, auto polling is not used anymore so polling through mii(4) was introduced. Reviewed by: davidch Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Oct 11 22:46:15 2010 (r213709) +++ head/sys/dev/bge/if_bge.c Mon Oct 11 22:56:23 2010 (r213710) @@ -1974,11 +1974,13 @@ bge_blockinit(struct bge_softc *sc) BGE_MACSTAT_LINK_CHANGED); CSR_WRITE_4(sc, BGE_MI_STS, 0); - /* Enable PHY auto polling (for MII/GMII only) */ + /* + * Enable attention when the link has changed state for + * devices that use auto polling. + */ if (sc->bge_flags & BGE_FLAG_TBI) { CSR_WRITE_4(sc, BGE_MI_STS, BGE_MISTS_LINK); } else { - BGE_SETBIT(sc, BGE_MI_MODE, BGE_MIMODE_AUTOPOLL | (10 << 16)); if (sc->bge_asicrev == BGE_ASICREV_BCM5700 && sc->bge_chipid != BGE_CHIPID_BCM5700_B2) CSR_WRITE_4(sc, BGE_MAC_EVT_ENB, @@ -5018,7 +5020,7 @@ bge_link_upd(struct bge_softc *sc) if_printf(sc->bge_ifp, "link DOWN\n"); if_link_state_change(sc->bge_ifp, LINK_STATE_DOWN); } - } else if (CSR_READ_4(sc, BGE_MI_MODE) & BGE_MIMODE_AUTOPOLL) { + } else if ((sc->bge_mi_mode & BGE_MIMODE_AUTOPOLL) != 0) { /* * Some broken BCM chips have BGE_STATFLAG_LINKSTATE_CHANGED bit * in status word always set. Workaround this bug by reading @@ -5046,9 +5048,17 @@ bge_link_upd(struct bge_softc *sc) } } else { /* - * Discard link events for MII/GMII controllers - * if MI auto-polling is disabled. + * For controllers that call mii_tick, we have to poll + * link status. */ + mii = device_get_softc(sc->bge_miibus); + mii_pollstat(mii); + if (!sc->bge_link && mii->mii_media_status & IFM_ACTIVE && + IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { + bge_miibus_statchg(sc->bge_dev); + sc->bge_link = 1; + } else + sc->bge_link = 0; } /* Clear the attention. */ From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 23:07:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B09B106564A; Mon, 11 Oct 2010 23:07:13 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E4598FC08; Mon, 11 Oct 2010 23:07:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BN7DSG030566; Mon, 11 Oct 2010 23:07:13 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BN7DL4030564; Mon, 11 Oct 2010 23:07:13 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010112307.o9BN7DL4030564@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 11 Oct 2010 23:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213711 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 23:07:13 -0000 Author: yongari Date: Mon Oct 11 23:07:12 2010 New Revision: 213711 URL: http://svn.freebsd.org/changeset/base/213711 Log: The IFF_DRV_RUNNING flag is set at the end of bge_init_locked. But before setting the flag, interrupt was already enabled such that interrupt handler could be run before setting IFF_DRV_RUNNING flag. This can lose initial link state change interrupt which in turn make bge(4) think that it still does not have valid link. Fix this race by protecting the taskqueue with a driver lock. While I'm here move reenabling interrupt code after handling of link state chage. Reviewed by: davidch Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon Oct 11 22:56:23 2010 (r213710) +++ head/sys/dev/bge/if_bge.c Mon Oct 11 23:07:12 2010 (r213711) @@ -3629,8 +3629,11 @@ bge_intr_task(void *arg, int pending) sc = (struct bge_softc *)arg; ifp = sc->bge_ifp; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + BGE_LOCK(sc); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + BGE_UNLOCK(sc); return; + } /* Get updated status block. */ bus_dmamap_sync(sc->bge_cdata.bge_status_tag, @@ -3645,26 +3648,27 @@ bge_intr_task(void *arg, int pending) bus_dmamap_sync(sc->bge_cdata.bge_status_tag, sc->bge_cdata.bge_status_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + + if ((status & BGE_STATFLAG_LINKSTATE_CHANGED) != 0) + bge_link_upd(sc); + /* Let controller work. */ bge_writembx(sc, BGE_MBX_IRQ0_LO, 0); - if ((status & BGE_STATFLAG_LINKSTATE_CHANGED) != 0) { - BGE_LOCK(sc); - bge_link_upd(sc); - BGE_UNLOCK(sc); - } - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING && + sc->bge_rx_saved_considx != rx_prod) { /* Check RX return ring producer/consumer. */ + BGE_UNLOCK(sc); bge_rxeof(sc, rx_prod, 0); + BGE_LOCK(sc); } if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - BGE_LOCK(sc); /* Check TX ring producer/consumer. */ bge_txeof(sc, tx_cons); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) bge_start_locked(ifp); - BGE_UNLOCK(sc); } + BGE_UNLOCK(sc); } static void From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 23:15:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 657C9106564A; Mon, 11 Oct 2010 23:15:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48B3D8FC14; Mon, 11 Oct 2010 23:15:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BNFIhK030761; Mon, 11 Oct 2010 23:15:18 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BNFIWg030759; Mon, 11 Oct 2010 23:15:18 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201010112315.o9BNFIWg030759@svn.freebsd.org> From: Rick Macklem Date: Mon, 11 Oct 2010 23:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213712 - head/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 23:15:18 -0000 Author: rmacklem Date: Mon Oct 11 23:15:18 2010 New Revision: 213712 URL: http://svn.freebsd.org/changeset/base/213712 Log: Try and make the nfsrv_localunlock() function in the experimental NFSv4 server more readable. Mostly changes to comments, but a case of >= is changed to >, since == can never happen. Also, I've added a couple of KASSERT()s and a slight optimization, since once the "else if" case happens, subsequent locks in the list can't have any effect. None of these changes fixes any known bug. MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Mon Oct 11 23:07:12 2010 (r213711) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Mon Oct 11 23:15:18 2010 (r213712) @@ -4957,31 +4957,56 @@ nfsrv_locallock(vnode_t vp, struct nfslo /* * Local lock unlock. Unlock all byte ranges that are no longer locked - * by NFSv4. + * by NFSv4. To do this, unlock any subranges of first-->end that + * do not overlap with the byte ranges of any lock in the lfp->lf_lock + * list. This list has all locks for the file held by other + * tuples. The list is ordered by increasing + * lo_first value, but may have entries that overlap each other, for + * the case of read locks. */ static void nfsrv_localunlock(vnode_t vp, struct nfslockfile *lfp, uint64_t init_first, uint64_t init_end, NFSPROC_T *p) { struct nfslock *lop; - - uint64_t first, end; + uint64_t first, end, prevfirst; first = init_first; end = init_end; while (first < init_end) { /* Loop through all nfs locks, adjusting first and end */ + prevfirst = 0; LIST_FOREACH(lop, &lfp->lf_lock, lo_lckfile) { + KASSERT(prevfirst <= lop->lo_first, + ("nfsv4 locks out of order")); + KASSERT(lop->lo_first < lop->lo_end, + ("nfsv4 bogus lock")); + prevfirst = lop->lo_first; if (first >= lop->lo_first && first < lop->lo_end) - /* Overlaps initial part */ + /* + * Overlaps with initial part, so trim + * off that initial part by moving first past + * it. + */ first = lop->lo_end; else if (end > lop->lo_first && - lop->lo_first >= first) - /* Begins before end and past first */ + lop->lo_first > first) { + /* + * This lock defines the end of the + * segment to unlock, so set end to the + * start of it and break out of the loop. + */ end = lop->lo_first; + break; + } if (first >= end) - /* shrunk to 0 so this iteration is done */ + /* + * There is no segment left to do, so + * break out of this loop and then exit + * the outer while() since first will be set + * to end, which must equal init_end here. + */ break; } if (first < end) { @@ -4991,7 +5016,10 @@ nfsrv_localunlock(vnode_t vp, struct nfs nfsrv_locallock_commit(lfp, NFSLCK_UNLOCK, first, end); } - /* and move on to the rest of the range */ + /* + * Now move past this segment and look for any further + * segment in the range, if there is one. + */ first = end; end = init_end; } From owner-svn-src-all@FreeBSD.ORG Mon Oct 11 23:24:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D842C106566B; Mon, 11 Oct 2010 23:24:57 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C596B8FC0A; Mon, 11 Oct 2010 23:24:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9BNOvme030979; Mon, 11 Oct 2010 23:24:57 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9BNOveI030977; Mon, 11 Oct 2010 23:24:57 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010112324.o9BNOveI030977@svn.freebsd.org> From: "David E. O'Brien" Date: Mon, 11 Oct 2010 23:24:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213713 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2010 23:24:58 -0000 Author: obrien Date: Mon Oct 11 23:24:57 2010 New Revision: 213713 URL: http://svn.freebsd.org/changeset/base/213713 Log: Correct regression test to not show a false positive when run as root. Modified: head/tools/regression/bin/sh/builtins/cd1.0 Modified: head/tools/regression/bin/sh/builtins/cd1.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/cd1.0 Mon Oct 11 23:15:18 2010 (r213712) +++ head/tools/regression/bin/sh/builtins/cd1.0 Mon Oct 11 23:24:57 2010 (r213713) @@ -6,12 +6,15 @@ cd $P T=$(mktemp -d sh-test.XXXXXX) chmod 0 $T -cd -L $T 2>/dev/null && exit 1 -[ "$PWD" = "$P" ] -[ "$(pwd)" = "$P" ] -cd -P $T 2>/dev/null && exit 1 -[ "$PWD" = "$P" ] -[ "$(pwd)" = "$P" ] +if [ `id -u` -ne 0 ]; then + # Root can always cd, irregardless of directory permissions. + cd -L $T 2>/dev/null && exit 1 + [ "$PWD" = "$P" ] + [ "$(pwd)" = "$P" ] + cd -P $T 2>/dev/null && exit 1 + [ "$PWD" = "$P" ] + [ "$(pwd)" = "$P" ] +fi chmod 755 $T cd $T From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 00:36:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 030BA106564A; Tue, 12 Oct 2010 00:36:57 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4A688FC3F; Tue, 12 Oct 2010 00:36:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9C0au0X032394; Tue, 12 Oct 2010 00:36:56 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9C0aueg032391; Tue, 12 Oct 2010 00:36:56 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201010120036.o9C0aueg032391@svn.freebsd.org> From: David Xu Date: Tue, 12 Oct 2010 00:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213714 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 00:36:57 -0000 Author: davidxu Date: Tue Oct 12 00:36:56 2010 New Revision: 213714 URL: http://svn.freebsd.org/changeset/base/213714 Log: Add a flag TDF_TIDHASH to prevent a thread from being added to or removed from thread hash table multiple times. Modified: head/sys/kern/kern_thread.c head/sys/sys/proc.h Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Mon Oct 11 23:24:57 2010 (r213713) +++ head/sys/kern/kern_thread.c Tue Oct 12 00:36:56 2010 (r213714) @@ -981,7 +981,12 @@ void tidhash_add(struct thread *td) { rw_wlock(&tidhash_lock); - LIST_INSERT_HEAD(TIDHASH(td->td_tid), td, td_hash); + thread_lock(td); + if ((td->td_flags & TDF_TIDHASH) == 0) { + LIST_INSERT_HEAD(TIDHASH(td->td_tid), td, td_hash); + td->td_flags |= TDF_TIDHASH; + } + thread_unlock(td); rw_wunlock(&tidhash_lock); } @@ -989,6 +994,11 @@ void tidhash_remove(struct thread *td) { rw_wlock(&tidhash_lock); - LIST_REMOVE(td, td_hash); + thread_lock(td); + if ((td->td_flags & TDF_TIDHASH) != 0) { + LIST_REMOVE(td, td_hash); + td->td_flags &= ~TDF_TIDHASH; + } + thread_unlock(td); rw_wunlock(&tidhash_lock); } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Mon Oct 11 23:24:57 2010 (r213713) +++ head/sys/sys/proc.h Tue Oct 12 00:36:56 2010 (r213714) @@ -353,7 +353,7 @@ do { \ #define TDF_NEEDRESCHED 0x00010000 /* Thread needs to yield. */ #define TDF_NEEDSIGCHK 0x00020000 /* Thread may need signal delivery. */ #define TDF_NOLOAD 0x00040000 /* Ignore during load avg calculations. */ -#define TDF_UNUSED19 0x00080000 /* Thread is sleeping on a umtx. */ +#define TDF_TIDHASH 0x00080000 /* Thread is on hash table. */ #define TDF_THRWAKEUP 0x00100000 /* Libthr thread must not suspend itself. */ #define TDF_UNUSED21 0x00200000 /* --available-- */ #define TDF_SWAPINREQ 0x00400000 /* Swapin request due to wakeup. */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 09:10:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C60901065679; Tue, 12 Oct 2010 09:10:24 +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 988A58FC16; Tue, 12 Oct 2010 09:10:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9C9AOaM043093; Tue, 12 Oct 2010 09:10:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9C9AO4Q043088; Tue, 12 Oct 2010 09:10:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010120910.o9C9AO4Q043088@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 12 Oct 2010 09:10:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213715 - in stable/8/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 09:10:24 -0000 Author: kib Date: Tue Oct 12 09:10:24 2010 New Revision: 213715 URL: http://svn.freebsd.org/changeset/base/213715 Log: MFC r213452: Display PCID capability of CPU and add CPUID define for it. Modified: stable/8/sys/amd64/amd64/identcpu.c stable/8/sys/amd64/include/specialreg.h stable/8/sys/i386/i386/identcpu.c stable/8/sys/i386/include/specialreg.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/identcpu.c ============================================================================== --- stable/8/sys/amd64/amd64/identcpu.c Tue Oct 12 00:36:56 2010 (r213714) +++ stable/8/sys/amd64/amd64/identcpu.c Tue Oct 12 09:10:24 2010 (r213715) @@ -278,7 +278,7 @@ printcpuinfo(void) "\017xTPR" /* Send Task Priority Messages*/ "\020PDCM" /* Perf/Debug Capability MSR */ "\021" - "\022" + "\022PCID" /* Process-context Identifiers */ "\023DCA" /* Direct Cache Access */ "\024SSE4.1" "\025SSE4.2" Modified: stable/8/sys/amd64/include/specialreg.h ============================================================================== --- stable/8/sys/amd64/include/specialreg.h Tue Oct 12 00:36:56 2010 (r213714) +++ stable/8/sys/amd64/include/specialreg.h Tue Oct 12 09:10:24 2010 (r213715) @@ -126,6 +126,7 @@ #define CPUID2_CX16 0x00002000 #define CPUID2_XTPR 0x00004000 #define CPUID2_PDCM 0x00008000 +#define CPUID2_PCID 0x00020000 #define CPUID2_DCA 0x00040000 #define CPUID2_SSE41 0x00080000 #define CPUID2_SSE42 0x00100000 Modified: stable/8/sys/i386/i386/identcpu.c ============================================================================== --- stable/8/sys/i386/i386/identcpu.c Tue Oct 12 00:36:56 2010 (r213714) +++ stable/8/sys/i386/i386/identcpu.c Tue Oct 12 09:10:24 2010 (r213715) @@ -743,7 +743,7 @@ printcpuinfo(void) "\017xTPR" /* Send Task Priority Messages*/ "\020PDCM" /* Perf/Debug Capability MSR */ "\021" - "\022" + "\022PCID" /* Process-context Identifiers */ "\023DCA" /* Direct Cache Access */ "\024SSE4.1" "\025SSE4.2" Modified: stable/8/sys/i386/include/specialreg.h ============================================================================== --- stable/8/sys/i386/include/specialreg.h Tue Oct 12 00:36:56 2010 (r213714) +++ stable/8/sys/i386/include/specialreg.h Tue Oct 12 09:10:24 2010 (r213715) @@ -123,6 +123,7 @@ #define CPUID2_CX16 0x00002000 #define CPUID2_XTPR 0x00004000 #define CPUID2_PDCM 0x00008000 +#define CPUID2_PCID 0x00020000 #define CPUID2_DCA 0x00040000 #define CPUID2_SSE41 0x00080000 #define CPUID2_SSE42 0x00100000 From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 09:18:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04C8E1065672; Tue, 12 Oct 2010 09:18:18 +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 E61508FC08; Tue, 12 Oct 2010 09:18:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9C9IHj0043330; Tue, 12 Oct 2010 09:18:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9C9IHrQ043323; Tue, 12 Oct 2010 09:18:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010120918.o9C9IHrQ043323@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 12 Oct 2010 09:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213716 - in head/sys: amd64/linux32 compat/svr4 i386/ibcs2 i386/linux sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 09:18:18 -0000 Author: kib Date: Tue Oct 12 09:18:17 2010 New Revision: 213716 URL: http://svn.freebsd.org/changeset/base/213716 Log: Add macro DECLARE_MODULE_TIED to denote a module as requiring the kernel of exactly the same __FreeBSD_version as the headers module was compiled against. Mark our in-tree ABI emulators with DECLARE_MODULE_TIED. The modules use kernel interfaces that the Release Engineering Team feel are not stable enough to guarantee they will not change during the life cycle of a STABLE branch. In particular, the layout of struct sysentvec is declared to be not part of the STABLE KBI. Discussed with: bz, rwatson Approved by: re (bz, kensmith) MFC after: 2 weeks Modified: head/sys/amd64/linux32/linux32_sysvec.c head/sys/compat/svr4/svr4_sysvec.c head/sys/i386/ibcs2/ibcs2_sysvec.c head/sys/i386/linux/linux_sysvec.c head/sys/sys/exec.h head/sys/sys/module.h Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Tue Oct 12 09:10:24 2010 (r213715) +++ head/sys/amd64/linux32/linux32_sysvec.c Tue Oct 12 09:18:17 2010 (r213716) @@ -1210,4 +1210,4 @@ static moduledata_t linux_elf_mod = { 0 }; -DECLARE_MODULE(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); +DECLARE_MODULE_TIED(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); Modified: head/sys/compat/svr4/svr4_sysvec.c ============================================================================== --- head/sys/compat/svr4/svr4_sysvec.c Tue Oct 12 09:10:24 2010 (r213715) +++ head/sys/compat/svr4/svr4_sysvec.c Tue Oct 12 09:18:17 2010 (r213716) @@ -309,5 +309,5 @@ static moduledata_t svr4_elf_mod = { svr4_elf_modevent, 0 }; -DECLARE_MODULE(svr4elf, svr4_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); +DECLARE_MODULE_TIED(svr4elf, svr4_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); MODULE_DEPEND(svr4elf, streams, 1, 1, 1); Modified: head/sys/i386/ibcs2/ibcs2_sysvec.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_sysvec.c Tue Oct 12 09:10:24 2010 (r213715) +++ head/sys/i386/ibcs2/ibcs2_sysvec.c Tue Oct 12 09:18:17 2010 (r213716) @@ -134,4 +134,4 @@ static moduledata_t ibcs2_mod = { ibcs2_modevent, 0 }; -DECLARE_MODULE(ibcs2, ibcs2_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +DECLARE_MODULE_TIED(ibcs2, ibcs2_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Tue Oct 12 09:10:24 2010 (r213715) +++ head/sys/i386/linux/linux_sysvec.c Tue Oct 12 09:18:17 2010 (r213716) @@ -1179,4 +1179,4 @@ static moduledata_t linux_elf_mod = { 0 }; -DECLARE_MODULE(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); +DECLARE_MODULE_TIED(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); Modified: head/sys/sys/exec.h ============================================================================== --- head/sys/sys/exec.h Tue Oct 12 09:10:24 2010 (r213715) +++ head/sys/sys/exec.h Tue Oct 12 09:18:17 2010 (r213716) @@ -115,7 +115,8 @@ int exec_unregister(const struct execsw __CONCAT(name,_modevent), \ (void *)& execsw_arg \ }; \ - DECLARE_MODULE(name, __CONCAT(name,_mod), SI_SUB_EXEC, SI_ORDER_ANY) + DECLARE_MODULE_TIED(name, __CONCAT(name,_mod), SI_SUB_EXEC, \ + SI_ORDER_ANY) #endif #endif Modified: head/sys/sys/module.h ============================================================================== --- head/sys/sys/module.h Tue Oct 12 09:10:24 2010 (r213715) +++ head/sys/sys/module.h Tue Oct 12 09:18:17 2010 (r213716) @@ -125,13 +125,26 @@ struct mod_metadata { */ #define MODULE_KERNEL_MAXVER (roundup(__FreeBSD_version, 100000) - 1) -#define DECLARE_MODULE(name, data, sub, order) \ +#define DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, maxver) \ MODULE_DEPEND(name, kernel, __FreeBSD_version, \ - __FreeBSD_version, MODULE_KERNEL_MAXVER); \ + __FreeBSD_version, maxver); \ MODULE_METADATA(_md_##name, MDT_MODULE, &data, #name); \ SYSINIT(name##module, sub, order, module_register_init, &data); \ struct __hack +#define DECLARE_MODULE(name, data, sub, order) \ + DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, MODULE_KERNEL_MAXVER) + +/* + * The module declared with DECLARE_MODULE_TIED can only be loaded + * into the kernel with exactly the same __FreeBSD_version. + * + * Use it for modules that use kernel interfaces that are not stable + * even on STABLE/X branches. + */ +#define DECLARE_MODULE_TIED(name, data, sub, order) \ + DECLARE_MODULE_WITH_MAXVER(name, data, sub, order, __FreeBSD_version) + #define MODULE_VERSION(module, version) \ static struct mod_version _##module##_version = { \ version \ From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 09:41:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7C2B106566B; Tue, 12 Oct 2010 09:41:42 +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 A61FF8FC08; Tue, 12 Oct 2010 09:41:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9C9fgIm043818; Tue, 12 Oct 2010 09:41:42 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9C9fgd8043816; Tue, 12 Oct 2010 09:41:42 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201010120941.o9C9fgd8043816@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 12 Oct 2010 09:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213717 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 09:41:42 -0000 Author: glebius Date: Tue Oct 12 09:41:42 2010 New Revision: 213717 URL: http://svn.freebsd.org/changeset/base/213717 Log: We already have dummy receive buffer in sc->buffer. Suggested by: hselasky Modified: head/sys/dev/usb/usb_msctest.c Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Tue Oct 12 09:18:17 2010 (r213716) +++ head/sys/dev/usb/usb_msctest.c Tue Oct 12 09:41:42 2010 (r213717) @@ -98,7 +98,6 @@ static uint8_t scsi_huawei_eject[] = { 0 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; static uint8_t scsi_tct_eject[] = { 0x06, 0xf5, 0x04, 0x02, 0x52, 0x70 }; -static uint8_t scsi_tct_dummy[4]; #define BULK_SIZE 64 /* dummy */ #define ERR_CSW_FAILED -1 @@ -621,8 +620,12 @@ usb_msc_eject(struct usb_device *udev, u USB_MS_HZ); break; case MSC_EJECT_TCT: - err = bbb_command_start(sc, DIR_IN, 0, &scsi_tct_dummy, - sizeof(scsi_tct_dummy), &scsi_tct_eject, + /* + * TCTMobile needs DIR_IN flag. To get it, we + * supply a dummy data with the command. + */ + err = bbb_command_start(sc, DIR_IN, 0, &sc->buffer, + sizeof(sc->buffer), &scsi_tct_eject, sizeof(scsi_tct_eject), USB_MS_HZ); break; default: From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 10:04:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F0B8106566B; Tue, 12 Oct 2010 10:04:45 +0000 (UTC) (envelope-from flz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C88C8FC0A; Tue, 12 Oct 2010 10:04:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CA4j4D044386; Tue, 12 Oct 2010 10:04:45 GMT (envelope-from flz@svn.freebsd.org) Received: (from flz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CA4js4044379; Tue, 12 Oct 2010 10:04:45 GMT (envelope-from flz@svn.freebsd.org) Message-Id: <201010121004.o9CA4js4044379@svn.freebsd.org> From: Florent Thoumie Date: Tue, 12 Oct 2010 10:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213718 - in head/usr.sbin/pkg_install: . add create X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 10:04:45 -0000 Author: flz Date: Tue Oct 12 10:04:44 2010 New Revision: 213718 URL: http://svn.freebsd.org/changeset/base/213718 Log: - Add support for xz compression to pkg_create, bzip2 remains the default compression algorithm. - Bump PKG_INSTALL_VERSION to 20101012. Submitted by: mm MFC after: 1 month Modified: head/usr.sbin/pkg_install/Makefile.inc head/usr.sbin/pkg_install/add/main.c head/usr.sbin/pkg_install/create/create.h head/usr.sbin/pkg_install/create/main.c head/usr.sbin/pkg_install/create/perform.c head/usr.sbin/pkg_install/create/pkg_create.1 Modified: head/usr.sbin/pkg_install/Makefile.inc ============================================================================== --- head/usr.sbin/pkg_install/Makefile.inc Tue Oct 12 09:41:42 2010 (r213717) +++ head/usr.sbin/pkg_install/Makefile.inc Tue Oct 12 10:04:44 2010 (r213718) @@ -2,7 +2,7 @@ .include -CFLAGS+= -DPKG_INSTALL_VERSION=20100423 +CFLAGS+= -DPKG_INSTALL_VERSION=20101012 CFLAGS+= -DYES_I_KNOW_THE_API_IS_RUBBISH_AND_IS_DOOMED_TO_CHANGE DPADD+= ${LIBPKG} Modified: head/usr.sbin/pkg_install/add/main.c ============================================================================== --- head/usr.sbin/pkg_install/add/main.c Tue Oct 12 09:41:42 2010 (r213717) +++ head/usr.sbin/pkg_install/add/main.c Tue Oct 12 10:04:44 2010 (r213718) @@ -227,9 +227,9 @@ main(int argc, char **argv) >= sizeof(temppackageroot)) errx(1, "package name too long"); remotepkg = temppackageroot; - if (!((ptr = strrchr(remotepkg, '.')) && ptr[1] == 't' && - (ptr[2] == 'b' || ptr[2] == 'g') && ptr[3] == 'z' && - !ptr[4])) + if (!((ptr = strrchr(remotepkg, '.')) && ptr[1] == 't' && + (ptr[2] == 'b' || ptr[2] == 'g' || ptr[2] == 'x') && + ptr[3] == 'z' && !ptr[4])) if (strlcat(remotepkg, ".tbz", sizeof(temppackageroot)) >= sizeof(temppackageroot)) errx(1, "package name too long"); Modified: head/usr.sbin/pkg_install/create/create.h ============================================================================== --- head/usr.sbin/pkg_install/create/create.h Tue Oct 12 09:41:42 2010 (r213717) +++ head/usr.sbin/pkg_install/create/create.h Tue Oct 12 10:04:44 2010 (r213718) @@ -48,7 +48,7 @@ extern int PlistOnly; extern int Recursive; extern int Regenerate; -enum zipper {NONE, GZIP, BZIP, BZIP2 }; +enum zipper {NONE, GZIP, BZIP, BZIP2, XZ }; extern enum zipper Zipper; void add_cksum(Package *, PackingList, const char *); Modified: head/usr.sbin/pkg_install/create/main.c ============================================================================== --- head/usr.sbin/pkg_install/create/main.c Tue Oct 12 09:41:42 2010 (r213717) +++ head/usr.sbin/pkg_install/create/main.c Tue Oct 12 10:04:44 2010 (r213718) @@ -48,7 +48,7 @@ enum zipper Zipper = BZIP2; static void usage(void); -static char opts[] = "EGYNnORhjvxyzf:p:P:C:c:d:i:I:k:K:r:t:X:D:m:s:S:o:b:"; +static char opts[] = "EGYNnORhjJvxyzf:p:P:C:c:d:i:I:k:K:r:t:X:D:m:s:S:o:b:"; static struct option longopts[] = { { "backup", required_argument, NULL, 'b' }, { "extended", no_argument, NULL, 'E' }, @@ -190,6 +190,10 @@ main(int argc, char **argv) Zipper = GZIP; break; + case 'J': + Zipper = XZ; + break; + case 'b': InstalledPkg = optarg; while ((tmp = strrchr(optarg, (int)'/')) != NULL) { Modified: head/usr.sbin/pkg_install/create/perform.c ============================================================================== --- head/usr.sbin/pkg_install/create/perform.c Tue Oct 12 09:41:42 2010 (r213717) +++ head/usr.sbin/pkg_install/create/perform.c Tue Oct 12 10:04:44 2010 (r213718) @@ -67,6 +67,10 @@ pkg_perform(char **pkgs) Zipper = GZIP; pkg[len - 4] = '\0'; } + else if (!strcmp(&pkg[len - 4], ".txz")) { + Zipper = XZ; + pkg[len - 4] = '\0'; + } else if (!strcmp(&pkg[len - 4], ".tar")) { Zipper = NONE; pkg[len - 4] = '\0'; @@ -78,6 +82,8 @@ pkg_perform(char **pkgs) } else if (Zipper == GZIP) { suf = "tgz"; setenv("GZIP", "-9", 0); + } else if (Zipper == XZ) { + suf = "txz"; } else suf = "tar"; @@ -375,6 +381,10 @@ make_dist(const char *homedir, const cha args[nargs++] = "-j"; cname = "bzip'd "; } + else if (Zipper == XZ) { + args[nargs++] = "-J"; + cname = "xz'd "; + } else { args[nargs++] = "-z"; cname = "gzip'd "; Modified: head/usr.sbin/pkg_install/create/pkg_create.1 ============================================================================== --- head/usr.sbin/pkg_install/create/pkg_create.1 Tue Oct 12 09:41:42 2010 (r213717) +++ head/usr.sbin/pkg_install/create/pkg_create.1 Tue Oct 12 10:04:44 2010 (r213718) @@ -23,7 +23,7 @@ .\" [jkh] Took John's changes back and made some additional extensions for .\" better integration with FreeBSD's new ports collection. .\" -.Dd May 30, 2008 +.Dd Oct 12, 2010 .Dt PKG_CREATE 1 .Os .Sh NAME @@ -315,7 +315,7 @@ archive is explicitly specified by the r Currently .Nm recognizes the following suffixes: -.Pa .tbz , .tgz +.Pa .tbz , .tgz, .txz and .Pa .tar . .It Fl y @@ -325,6 +325,20 @@ Compatibility synonym for Use .Xr gzip 1 utility to compress package tarball. +.It Fl J +Use +.Xr xz 1 +utility to compress package tarball instead of +.Xr gzip 1 . +Please note that this option is a NO-OP if the format of the resulting +archive is explicitly specified by the recognizable suffix of +.Ar pkg-filename . +Currently +.Nm +recognizes the following suffixes: +.Pa .tbz , .tgz, .txz +and +.Pa .tar . .It Fl b , -backup Ar pkg-name Create package file from a locally installed package named .Ar pkg-name . From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 11:05:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBE9D106566B; Tue, 12 Oct 2010 11:05:32 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA4928FC0A; Tue, 12 Oct 2010 11:05:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CB5WLs045845; Tue, 12 Oct 2010 11:05:32 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CB5W6l045843; Tue, 12 Oct 2010 11:05:32 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201010121105.o9CB5W6l045843@svn.freebsd.org> From: Joel Dahl Date: Tue, 12 Oct 2010 11:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213719 - head/sys/dev/bwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 11:05:33 -0000 Author: joel (doc committer) Date: Tue Oct 12 11:05:32 2010 New Revision: 213719 URL: http://svn.freebsd.org/changeset/base/213719 Log: Small grammar nit in a printf message. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue Oct 12 10:04:44 2010 (r213718) +++ head/sys/dev/bwn/if_bwn.c Tue Oct 12 11:05:32 2010 (r213719) @@ -2907,7 +2907,7 @@ bwn_set_channel(struct ieee80211com *ic) bwn_rf_turnon(mac); if (!(mac->mac_flags & BWN_MAC_FLAG_RADIO_ON)) device_printf(sc->sc_dev, - "please turns on the RF switch\n"); + "please turn on the RF switch\n"); } else bwn_rf_turnoff(mac); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 13:13:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FA5E1065697; Tue, 12 Oct 2010 13:13:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8B92F8FC2D; Tue, 12 Oct 2010 13:13:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CDDKve048600; Tue, 12 Oct 2010 13:13:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CDDKVw048587; Tue, 12 Oct 2010 13:13:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121313.o9CDDKVw048587@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 13:13: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: r213720 - stable/8/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 13:13:20 -0000 Author: jhb Date: Tue Oct 12 13:13:20 2010 New Revision: 213720 URL: http://svn.freebsd.org/changeset/base/213720 Log: MFC 205021: - Use an initializer macro to initialize fields in 'fake' FILE objects used by *sprintf(), etc. - Explicitly initialize _fl_mutex to PTHREAD_MUTEX_INITIALIZER for all FILE objects. This is currently a nop on FreeBSD, but is import for other platforms (or in the future) where PTHREAD_MUTEX_INITIALIZER is not simply zero. Modified: stable/8/lib/libc/stdio/findfp.c stable/8/lib/libc/stdio/local.h stable/8/lib/libc/stdio/snprintf.c stable/8/lib/libc/stdio/vasprintf.c stable/8/lib/libc/stdio/vdprintf.c stable/8/lib/libc/stdio/vfprintf.c stable/8/lib/libc/stdio/vsnprintf.c stable/8/lib/libc/stdio/vsprintf.c stable/8/lib/libc/stdio/vsscanf.c stable/8/lib/libc/stdio/vswprintf.c stable/8/lib/libc/stdio/vswscanf.c stable/8/lib/libc/stdio/xprintf.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/stdio/findfp.c ============================================================================== --- stable/8/lib/libc/stdio/findfp.c Tue Oct 12 11:05:32 2010 (r213719) +++ stable/8/lib/libc/stdio/findfp.c Tue Oct 12 13:13:20 2010 (r213720) @@ -61,6 +61,7 @@ int __sdidinit; ._read = __sread, \ ._seek = __sseek, \ ._write = __swrite, \ + ._fl_mutex = PTHREAD_MUTEX_INITIALIZER, \ } /* the usual - (stdin + stdout + stderr) */ static FILE usual[FOPEN_MAX - 3]; @@ -96,7 +97,7 @@ moreglue(n) int n; { struct glue *g; - static FILE empty; + static FILE empty = { ._fl_mutex = PTHREAD_MUTEX_INITIALIZER }; FILE *p; g = (struct glue *)malloc(sizeof(*g) + ALIGNBYTES + n * sizeof(FILE)); @@ -154,7 +155,7 @@ found: fp->_ub._size = 0; fp->_lb._base = NULL; /* no line buffer */ fp->_lb._size = 0; -/* fp->_lock = NULL; */ /* once set always set (reused) */ +/* fp->_fl_mutex = NULL; */ /* once set always set (reused) */ fp->_orientation = 0; memset(&fp->_mbstate, 0, sizeof(mbstate_t)); return (fp); Modified: stable/8/lib/libc/stdio/local.h ============================================================================== --- stable/8/lib/libc/stdio/local.h Tue Oct 12 11:05:32 2010 (r213719) +++ stable/8/lib/libc/stdio/local.h Tue Oct 12 13:13:20 2010 (r213720) @@ -110,6 +110,14 @@ extern int __sdidinit; } /* + * Structure initializations for 'fake' FILE objects. + */ +#define FAKE_FILE { \ + ._file = -1, \ + ._fl_mutex = PTHREAD_MUTEX_INITIALIZER, \ +} + +/* * Set the orientation for a stream. If o > 0, the stream has wide- * orientation. If o < 0, the stream has byte-orientation. */ Modified: stable/8/lib/libc/stdio/snprintf.c ============================================================================== --- stable/8/lib/libc/stdio/snprintf.c Tue Oct 12 11:05:32 2010 (r213719) +++ stable/8/lib/libc/stdio/snprintf.c Tue Oct 12 13:13:20 2010 (r213720) @@ -48,7 +48,7 @@ snprintf(char * __restrict str, size_t n size_t on; int ret; va_list ap; - FILE f; + FILE f = FAKE_FILE; on = n; if (n != 0) @@ -56,12 +56,9 @@ snprintf(char * __restrict str, size_t n if (n > INT_MAX) n = INT_MAX; va_start(ap, fmt); - f._file = -1; f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._w = n; - f._orientation = 0; - memset(&f._mbstate, 0, sizeof(mbstate_t)); ret = __vfprintf(&f, fmt, ap); if (on > 0) *f._p = '\0'; Modified: stable/8/lib/libc/stdio/vasprintf.c ============================================================================== --- stable/8/lib/libc/stdio/vasprintf.c Tue Oct 12 11:05:32 2010 (r213719) +++ stable/8/lib/libc/stdio/vasprintf.c Tue Oct 12 13:13:20 2010 (r213720) @@ -42,9 +42,8 @@ vasprintf(str, fmt, ap) __va_list ap; { int ret; - FILE f; + FILE f = FAKE_FILE; - f._file = -1; f._flags = __SWR | __SSTR | __SALC; f._bf._base = f._p = (unsigned char *)malloc(128); if (f._bf._base == NULL) { @@ -53,8 +52,6 @@ vasprintf(str, fmt, ap) return (-1); } f._bf._size = f._w = 127; /* Leave room for the NUL */ - f._orientation = 0; - memset(&f._mbstate, 0, sizeof(mbstate_t)); ret = __vfprintf(&f, fmt, ap); if (ret < 0) { free(f._bf._base); Modified: stable/8/lib/libc/stdio/vdprintf.c ============================================================================== --- stable/8/lib/libc/stdio/vdprintf.c Tue Oct 12 11:05:32 2010 (r213719) +++ stable/8/lib/libc/stdio/vdprintf.c Tue Oct 12 13:13:20 2010 (r213720) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); int vdprintf(int fd, const char * __restrict fmt, va_list ap) { - FILE f; + FILE f = FAKE_FILE; unsigned char buf[BUFSIZ]; int ret; @@ -56,8 +56,6 @@ vdprintf(int fd, const char * __restrict f._write = __swrite; f._bf._base = buf; f._bf._size = sizeof(buf); - f._orientation = 0; - bzero(&f._mbstate, sizeof(f._mbstate)); if ((ret = __vfprintf(&f, fmt, ap)) < 0) return (ret); Modified: stable/8/lib/libc/stdio/vfprintf.c ============================================================================== --- stable/8/lib/libc/stdio/vfprintf.c Tue Oct 12 11:05:32 2010 (r213719) +++ stable/8/lib/libc/stdio/vfprintf.c Tue Oct 12 13:13:20 2010 (r213720) @@ -169,7 +169,7 @@ static int __sbprintf(FILE *fp, const char *fmt, va_list ap) { int ret; - FILE fake; + FILE fake = FAKE_FILE; unsigned char buf[BUFSIZ]; /* XXX This is probably not needed. */ Modified: stable/8/lib/libc/stdio/vsnprintf.c ============================================================================== --- stable/8/lib/libc/stdio/vsnprintf.c Tue Oct 12 11:05:32 2010 (r213719) +++ stable/8/lib/libc/stdio/vsnprintf.c Tue Oct 12 13:13:20 2010 (r213720) @@ -47,7 +47,7 @@ vsnprintf(char * __restrict str, size_t size_t on; int ret; char dummy[2]; - FILE f; + FILE f = FAKE_FILE; on = n; if (n != 0) @@ -61,12 +61,9 @@ vsnprintf(char * __restrict str, size_t str = dummy; n = 1; } - f._file = -1; f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._w = n; - f._orientation = 0; - memset(&f._mbstate, 0, sizeof(mbstate_t)); ret = __vfprintf(&f, fmt, ap); if (on > 0) *f._p = '\0'; Modified: stable/8/lib/libc/stdio/vsprintf.c ============================================================================== --- stable/8/lib/libc/stdio/vsprintf.c Tue Oct 12 11:05:32 2010 (r213719) +++ stable/8/lib/libc/stdio/vsprintf.c Tue Oct 12 13:13:20 2010 (r213720) @@ -44,14 +44,11 @@ int vsprintf(char * __restrict str, const char * __restrict fmt, __va_list ap) { int ret; - FILE f; + FILE f = FAKE_FILE; - f._file = -1; f._flags = __SWR | __SSTR; f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._w = INT_MAX; - f._orientation = 0; - memset(&f._mbstate, 0, sizeof(mbstate_t)); ret = __vfprintf(&f, fmt, ap); *f._p = 0; return (ret); Modified: stable/8/lib/libc/stdio/vsscanf.c ============================================================================== --- stable/8/lib/libc/stdio/vsscanf.c Tue Oct 12 11:05:32 2010 (r213719) +++ stable/8/lib/libc/stdio/vsscanf.c Tue Oct 12 13:13:20 2010 (r213720) @@ -55,16 +55,11 @@ int vsscanf(const char * __restrict str, const char * __restrict fmt, __va_list ap) { - FILE f; + FILE f = FAKE_FILE; - f._file = -1; f._flags = __SRD; f._bf._base = f._p = (unsigned char *)str; f._bf._size = f._r = strlen(str); f._read = eofread; - f._ub._base = NULL; - f._lb._base = NULL; - f._orientation = 0; - memset(&f._mbstate, 0, sizeof(mbstate_t)); return (__svfscanf(&f, fmt, ap)); } Modified: stable/8/lib/libc/stdio/vswprintf.c ============================================================================== --- stable/8/lib/libc/stdio/vswprintf.c Tue Oct 12 11:05:32 2010 (r213719) +++ stable/8/lib/libc/stdio/vswprintf.c Tue Oct 12 13:13:20 2010 (r213720) @@ -45,7 +45,7 @@ vswprintf(wchar_t * __restrict s, size_t { static const mbstate_t initial; mbstate_t mbs; - FILE f; + FILE f = FAKE_FILE; char *mbp; int ret, sverrno; size_t nwc; @@ -55,7 +55,6 @@ vswprintf(wchar_t * __restrict s, size_t return (-1); } - f._file = -1; f._flags = __SWR | __SSTR | __SALC; f._bf._base = f._p = (unsigned char *)malloc(128); if (f._bf._base == NULL) { @@ -63,8 +62,6 @@ vswprintf(wchar_t * __restrict s, size_t return (-1); } f._bf._size = f._w = 127; /* Leave room for the NUL */ - f._orientation = 0; - memset(&f._mbstate, 0, sizeof(mbstate_t)); ret = __vfwprintf(&f, fmt, ap); if (ret < 0) { sverrno = errno; Modified: stable/8/lib/libc/stdio/vswscanf.c ============================================================================== --- stable/8/lib/libc/stdio/vswscanf.c Tue Oct 12 11:05:32 2010 (r213719) +++ stable/8/lib/libc/stdio/vswscanf.c Tue Oct 12 13:13:20 2010 (r213720) @@ -62,7 +62,7 @@ vswscanf(const wchar_t * __restrict str, { static const mbstate_t initial; mbstate_t mbs; - FILE f; + FILE f = FAKE_FILE; char *mbstr; size_t mlen; int r; @@ -80,15 +80,10 @@ vswscanf(const wchar_t * __restrict str, free(mbstr); return (EOF); } - f._file = -1; f._flags = __SRD; f._bf._base = f._p = (unsigned char *)mbstr; f._bf._size = f._r = mlen; f._read = eofread; - f._ub._base = NULL; - f._lb._base = NULL; - f._orientation = 0; - memset(&f._mbstate, 0, sizeof(mbstate_t)); r = __vfwscanf(&f, fmt, ap); free(mbstr); Modified: stable/8/lib/libc/stdio/xprintf.c ============================================================================== --- stable/8/lib/libc/stdio/xprintf.c Tue Oct 12 11:05:32 2010 (r213719) +++ stable/8/lib/libc/stdio/xprintf.c Tue Oct 12 13:13:20 2010 (r213720) @@ -48,6 +48,7 @@ #include #include "un-namespace.h" +#include "local.h" #include "printf.h" #include "fvwrite.h" @@ -575,7 +576,7 @@ static int __v3printf(FILE *fp, const char *fmt, int pct, va_list ap) { int ret; - FILE fake; + FILE fake = FAKE_FILE; unsigned char buf[BUFSIZ]; /* copy the important variables */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 15:26:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFB71106566B; Tue, 12 Oct 2010 15:26:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD7A68FC18; Tue, 12 Oct 2010 15:26:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CFQDP7051618; Tue, 12 Oct 2010 15:26:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CFQDJl051615; Tue, 12 Oct 2010 15:26:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121526.o9CFQDJl051615@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 15:26: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: r213721 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 15:26:14 -0000 Author: jhb Date: Tue Oct 12 15:26:13 2010 New Revision: 213721 URL: http://svn.freebsd.org/changeset/base/213721 Log: MFC 212974: Comment nit, set TDF_NEEDRESCHED after the comment describing why it is done rather than before. 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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Tue Oct 12 13:13:20 2010 (r213720) +++ stable/8/sys/kern/sched_ule.c Tue Oct 12 15:26:13 2010 (r213721) @@ -2409,12 +2409,12 @@ sched_affinity(struct thread *td) } if (!TD_IS_RUNNING(td)) return; - td->td_flags |= TDF_NEEDRESCHED; /* * Force a switch before returning to userspace. If the * target thread is not running locally send an ipi to force * the issue. */ + td->td_flags |= TDF_NEEDRESCHED; if (td != curthread) ipi_selected(1 << ts->ts_cpu, IPI_PREEMPT); #endif From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 15:26:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D30FF1065674; Tue, 12 Oct 2010 15:26:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0EDF8FC16; Tue, 12 Oct 2010 15:26:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CFQb3B051660; Tue, 12 Oct 2010 15:26:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CFQbaj051658; Tue, 12 Oct 2010 15:26:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121526.o9CFQbaj051658@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 15:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213722 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 15:26:37 -0000 Author: jhb Date: Tue Oct 12 15:26:37 2010 New Revision: 213722 URL: http://svn.freebsd.org/changeset/base/213722 Log: MFC 212974: Comment nit, set TDF_NEEDRESCHED after the comment describing why it is done rather than before. Modified: stable/7/sys/kern/sched_ule.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/sched_ule.c ============================================================================== --- stable/7/sys/kern/sched_ule.c Tue Oct 12 15:26:13 2010 (r213721) +++ stable/7/sys/kern/sched_ule.c Tue Oct 12 15:26:37 2010 (r213722) @@ -2556,12 +2556,12 @@ sched_affinity(struct thread *td) } if (!TD_IS_RUNNING(td)) return; - td->td_flags |= TDF_NEEDRESCHED; /* * Force a switch before returning to userspace. If the * target thread is not running locally send an ipi to force * the issue. */ + td->td_flags |= TDF_NEEDRESCHED; if (td != curthread) ipi_selected(1 << ts->ts_cpu, IPI_PREEMPT); #endif From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 15:48:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B61210656C0; Tue, 12 Oct 2010 15:48:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 393128FC21; Tue, 12 Oct 2010 15:48:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CFmFv4052158; Tue, 12 Oct 2010 15:48:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CFmFw2052156; Tue, 12 Oct 2010 15:48:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121548.o9CFmFw2052156@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 15:48:15 +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: r213723 - stable/8/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 15:48:15 -0000 Author: jhb Date: Tue Oct 12 15:48:14 2010 New Revision: 213723 URL: http://svn.freebsd.org/changeset/base/213723 Log: MFC 213271: Account for unlocking a spin mutex in the lock profiling code in the !SMP case. Modified: stable/8/sys/sys/mutex.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sys/mutex.h ============================================================================== --- stable/8/sys/sys/mutex.h Tue Oct 12 15:26:37 2010 (r213722) +++ stable/8/sys/sys/mutex.h Tue Oct 12 15:48:14 2010 (r213723) @@ -251,8 +251,11 @@ void _thread_lock_flags(struct thread *, #define _rel_spin_lock(mp) do { \ if (mtx_recursed((mp))) \ (mp)->mtx_recurse--; \ - else \ + else { \ + LOCKSTAT_PROFILE_RELEASE_LOCK(LS_MTX_SPIN_UNLOCK_RELEASE, \ + mp); \ (mp)->mtx_lock = MTX_UNOWNED; \ + } \ spinlock_exit(); \ } while (0) #endif /* SMP */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 15:48:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F34541065698; Tue, 12 Oct 2010 15:48:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E105E8FC24; Tue, 12 Oct 2010 15:48:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CFmRZe052199; Tue, 12 Oct 2010 15:48:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CFmR7Q052197; Tue, 12 Oct 2010 15:48:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121548.o9CFmR7Q052197@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 15:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213724 - stable/7/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 15:48:28 -0000 Author: jhb Date: Tue Oct 12 15:48:27 2010 New Revision: 213724 URL: http://svn.freebsd.org/changeset/base/213724 Log: MFC 213271: Account for unlocking a spin mutex in the lock profiling code in the !SMP case. Modified: stable/7/sys/sys/mutex.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sys/mutex.h ============================================================================== --- stable/7/sys/sys/mutex.h Tue Oct 12 15:48:14 2010 (r213723) +++ stable/7/sys/sys/mutex.h Tue Oct 12 15:48:27 2010 (r213724) @@ -247,8 +247,10 @@ void _thread_lock_flags(struct thread *, #define _rel_spin_lock(mp) do { \ if (mtx_recursed((mp))) \ (mp)->mtx_recurse--; \ - else \ + else { \ + lock_profile_release_lock(&(mp)->lock_object); \ (mp)->mtx_lock = MTX_UNOWNED; \ + } \ spinlock_exit(); \ } while (0) #endif /* SMP */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 15:58:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01291106564A; Tue, 12 Oct 2010 15:58:53 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E379F8FC18; Tue, 12 Oct 2010 15:58:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CFwq5d052500; Tue, 12 Oct 2010 15:58:52 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CFwqJi052497; Tue, 12 Oct 2010 15:58:52 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201010121558.o9CFwqJi052497@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 12 Oct 2010 15:58:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213725 - head/sys/fs/devfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 15:58:53 -0000 Author: jh Date: Tue Oct 12 15:58:52 2010 New Revision: 213725 URL: http://svn.freebsd.org/changeset/base/213725 Log: Format prototypes to follow style(9) more closely. Discussed with: kib, phk Modified: head/sys/fs/devfs/devfs.h head/sys/fs/devfs/devfs_int.h Modified: head/sys/fs/devfs/devfs.h ============================================================================== --- head/sys/fs/devfs/devfs.h Tue Oct 12 15:48:27 2010 (r213724) +++ head/sys/fs/devfs/devfs.h Tue Oct 12 15:58:52 2010 (r213725) @@ -178,22 +178,25 @@ extern unsigned devfs_rule_depth; #define DEVFS_DEL_VNLOCKED 0x01 #define DEVFS_DEL_NORECURSE 0x02 -void devfs_rules_apply(struct devfs_mount *dm, struct devfs_dirent *de); -void devfs_rules_cleanup (struct devfs_mount *dm); -int devfs_rules_ioctl(struct devfs_mount *dm, u_long cmd, caddr_t data, struct thread *td); -int devfs_allocv(struct devfs_dirent *de, struct mount *mp, int lockmode, - struct vnode **vpp); -char *devfs_fqpn(char *, struct devfs_mount *, struct devfs_dirent *, - struct componentname *); -void devfs_delete(struct devfs_mount *dm, struct devfs_dirent *de, int flags); -void devfs_dirent_free(struct devfs_dirent *de); -void devfs_populate (struct devfs_mount *dm); -void devfs_cleanup (struct devfs_mount *dm); -void devfs_unmount_final(struct devfs_mount *mp); -struct devfs_dirent *devfs_newdirent (char *name, int namelen); -struct devfs_dirent *devfs_parent_dirent(struct devfs_dirent *de); -struct devfs_dirent *devfs_vmkdir (struct devfs_mount *, char *name, int namelen, struct devfs_dirent *dotdot, u_int inode); -struct devfs_dirent *devfs_find(struct devfs_dirent *dd, const char *name, int namelen, int type); +void devfs_rules_apply(struct devfs_mount *, struct devfs_dirent *); +void devfs_rules_cleanup(struct devfs_mount *); +int devfs_rules_ioctl(struct devfs_mount *, u_long, caddr_t, + struct thread *); +int devfs_allocv(struct devfs_dirent *, struct mount *, int, + struct vnode **); +char *devfs_fqpn(char *, struct devfs_mount *, struct devfs_dirent *, + struct componentname *); +void devfs_delete(struct devfs_mount *, struct devfs_dirent *, int); +void devfs_dirent_free(struct devfs_dirent *); +void devfs_populate(struct devfs_mount *); +void devfs_cleanup(struct devfs_mount *); +void devfs_unmount_final(struct devfs_mount *); +struct devfs_dirent *devfs_newdirent(char *, int); +struct devfs_dirent *devfs_parent_dirent(struct devfs_dirent *); +struct devfs_dirent *devfs_vmkdir(struct devfs_mount *, char *, int, + struct devfs_dirent *, u_int); +struct devfs_dirent *devfs_find(struct devfs_dirent *, const char *, int, + int); #endif /* _KERNEL */ Modified: head/sys/fs/devfs/devfs_int.h ============================================================================== --- head/sys/fs/devfs/devfs_int.h Tue Oct 12 15:48:27 2010 (r213724) +++ head/sys/fs/devfs/devfs_int.h Tue Oct 12 15:58:52 2010 (r213725) @@ -71,12 +71,12 @@ struct cdev_priv { #define cdev2priv(c) member2struct(cdev_priv, cdp_c, c) -struct cdev *devfs_alloc(int); -int devfs_dev_exists(const char *); -void devfs_free(struct cdev *); -void devfs_create(struct cdev *dev); -void devfs_destroy(struct cdev *dev); -void devfs_destroy_cdevpriv(struct cdev_privdata *p); +struct cdev *devfs_alloc(int); +int devfs_dev_exists(const char *); +void devfs_free(struct cdev *); +void devfs_create(struct cdev *); +void devfs_destroy(struct cdev *); +void devfs_destroy_cdevpriv(struct cdev_privdata *); int devfs_dir_find(const char *); void devfs_dir_ref_de(struct devfs_mount *, struct devfs_dirent *); From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 16:08:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ED44106566C; Tue, 12 Oct 2010 16:08:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B9FA8FC08; Tue, 12 Oct 2010 16:08:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CG8K3r052789; Tue, 12 Oct 2010 16:08:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CG8KWa052786; Tue, 12 Oct 2010 16:08:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121608.o9CG8KWa052786@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 16:08: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: r213726 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 16:08:20 -0000 Author: jhb Date: Tue Oct 12 16:08:20 2010 New Revision: 213726 URL: http://svn.freebsd.org/changeset/base/213726 Log: MFC 213028,213328: - Expand scope of tun/tap softc locks to cover more softc fields and driver-maintained ifnet fields (such as if_drv_flags). - Use soft locks as the mutex that protects each interface's knote list rather than using the global knote list lock. Also, use the softc for kn_hook instead of the cdev. - Use mtx_sleep() instead of tsleep() when blocking in the read routines. This fixes a lost wakeup race. - Remove D_NEEDGIANT now that the cdevsw routines use the softc lock where locking is needed. - Lock IFQ when calculating the result for FIONREAD in tap(4). tun(4) already did this. - Remove remaining spl calls. Modified: stable/8/sys/net/if_tap.c stable/8/sys/net/if_tun.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/net/if_tap.c ============================================================================== --- stable/8/sys/net/if_tap.c Tue Oct 12 15:58:52 2010 (r213725) +++ stable/8/sys/net/if_tap.c Tue Oct 12 16:08:20 2010 (r213726) @@ -132,7 +132,7 @@ static struct filterops tap_write_filter static struct cdevsw tap_cdevsw = { .d_version = D_VERSION, - .d_flags = D_PSEUDO | D_NEEDGIANT | D_NEEDMINOR, + .d_flags = D_PSEUDO | D_NEEDMINOR, .d_open = tapopen, .d_close = tapclose, .d_read = tapread, @@ -209,7 +209,6 @@ static void tap_destroy(struct tap_softc *tp) { struct ifnet *ifp = tp->tap_ifp; - int s; /* Unlocked read. */ KASSERT(!(tp->tap_flags & TAP_OPEN), @@ -217,10 +216,8 @@ tap_destroy(struct tap_softc *tp) knlist_destroy(&tp->tap_rsel.si_note); destroy_dev(tp->tap_dev); - s = splimp(); ether_ifdetach(ifp); if_free_type(ifp, IFT_ETHER); - splx(s); mtx_destroy(&tp->tap_mtx); free(tp, M_TAP); @@ -398,7 +395,7 @@ tapcreate(struct cdev *dev) struct tap_softc *tp = NULL; unsigned short macaddr_hi; uint32_t macaddr_mid; - int unit, s; + int unit; char *name = NULL; u_char eaddr[6]; @@ -442,22 +439,20 @@ tapcreate(struct cdev *dev) ifp->if_ioctl = tapifioctl; ifp->if_mtu = ETHERMTU; ifp->if_flags = (IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST); - ifp->if_snd.ifq_maxlen = ifqmaxlen; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_capabilities |= IFCAP_LINKSTATE; ifp->if_capenable |= IFCAP_LINKSTATE; dev->si_drv1 = tp; tp->tap_dev = dev; - s = splimp(); ether_ifattach(ifp, eaddr); - splx(s); mtx_lock(&tp->tap_mtx); tp->tap_flags |= TAP_INITED; mtx_unlock(&tp->tap_mtx); - knlist_init_mtx(&tp->tap_rsel.si_note, NULL); + knlist_init_mtx(&tp->tap_rsel.si_note, &tp->tap_mtx); TAPDEBUG("interface %s is created. minor = %#x\n", ifp->if_xname, dev2unit(dev)); @@ -474,7 +469,7 @@ tapopen(struct cdev *dev, int flag, int { struct tap_softc *tp = NULL; struct ifnet *ifp = NULL; - int error, s; + int error; if (tapuopen == 0) { error = priv_check(td, PRIV_NET_TAP); @@ -497,15 +492,13 @@ tapopen(struct cdev *dev, int flag, int tp->tap_pid = td->td_proc->p_pid; tp->tap_flags |= TAP_OPEN; ifp = tp->tap_ifp; - mtx_unlock(&tp->tap_mtx); - s = splimp(); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (tapuponopen) ifp->if_flags |= IFF_UP; if_link_state_change(ifp, LINK_STATE_UP); - splx(s); + mtx_unlock(&tp->tap_mtx); TAPDEBUG("%s is open. minor = %#x\n", ifp->if_xname, dev2unit(dev)); @@ -524,9 +517,9 @@ tapclose(struct cdev *dev, int foo, int struct ifaddr *ifa; struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; - int s; /* junk all pending output */ + mtx_lock(&tp->tap_mtx); IF_DRAIN(&ifp->if_snd); /* @@ -534,28 +527,26 @@ tapclose(struct cdev *dev, int foo, int * interface, if we are in VMnet mode. just close the device. */ - mtx_lock(&tp->tap_mtx); if (((tp->tap_flags & TAP_VMNET) == 0) && (ifp->if_flags & IFF_UP)) { mtx_unlock(&tp->tap_mtx); - s = splimp(); if_down(ifp); + mtx_lock(&tp->tap_mtx); if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + mtx_unlock(&tp->tap_mtx); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { rtinit(ifa, (int)RTM_DELETE, 0); } if_purgeaddrs(ifp); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + mtx_lock(&tp->tap_mtx); } - splx(s); - } else - mtx_unlock(&tp->tap_mtx); + } if_link_state_change(ifp, LINK_STATE_DOWN); funsetown(&tp->tap_sigio); selwakeuppri(&tp->tap_rsel, PZERO+1); - KNOTE_UNLOCKED(&tp->tap_rsel.si_note, 0); + KNOTE_LOCKED(&tp->tap_rsel.si_note, 0); - mtx_lock(&tp->tap_mtx); tp->tap_flags &= ~TAP_OPEN; tp->tap_pid = 0; mtx_unlock(&tp->tap_mtx); @@ -580,8 +571,10 @@ tapifinit(void *xtp) TAPDEBUG("initializing %s\n", ifp->if_xname); + mtx_lock(&tp->tap_mtx); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + mtx_unlock(&tp->tap_mtx); /* attempt to start output */ tapifstart(ifp); @@ -599,7 +592,7 @@ tapifioctl(struct ifnet *ifp, u_long cmd struct tap_softc *tp = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; struct ifstat *ifs = NULL; - int s, dummy; + int dummy; switch (cmd) { case SIOCSIFFLAGS: /* XXX -- just like vmnet does */ @@ -612,7 +605,6 @@ tapifioctl(struct ifnet *ifp, u_long cmd break; case SIOCGIFSTATUS: - s = splimp(); ifs = (struct ifstat *)data; dummy = strlen(ifs->ascii); mtx_lock(&tp->tap_mtx); @@ -621,14 +613,10 @@ tapifioctl(struct ifnet *ifp, u_long cmd sizeof(ifs->ascii) - dummy, "\tOpened by PID %d\n", tp->tap_pid); mtx_unlock(&tp->tap_mtx); - splx(s); break; default: - s = splimp(); - dummy = ether_ioctl(ifp, cmd, data); - splx(s); - return (dummy); + return (ether_ioctl(ifp, cmd, data)); /* NOT REACHED */ } @@ -645,7 +633,6 @@ static void tapifstart(struct ifnet *ifp) { struct tap_softc *tp = ifp->if_softc; - int s; TAPDEBUG("%s starting\n", ifp->if_xname); @@ -657,32 +644,28 @@ tapifstart(struct ifnet *ifp) mtx_lock(&tp->tap_mtx); if (((tp->tap_flags & TAP_VMNET) == 0) && ((tp->tap_flags & TAP_READY) != TAP_READY)) { - struct mbuf *m = NULL; - - mtx_unlock(&tp->tap_mtx); + struct mbuf *m; /* Unlocked read. */ TAPDEBUG("%s not ready, tap_flags = 0x%x\n", ifp->if_xname, tp->tap_flags); - s = splimp(); - do { + for (;;) { IF_DEQUEUE(&ifp->if_snd, m); - if (m != NULL) + if (m != NULL) { m_freem(m); - ifp->if_oerrors ++; - } while (m != NULL); - splx(s); + ifp->if_oerrors++; + } else + break; + } + mtx_unlock(&tp->tap_mtx); return; } - mtx_unlock(&tp->tap_mtx); - s = splimp(); ifp->if_drv_flags |= IFF_DRV_OACTIVE; - if (ifp->if_snd.ifq_len != 0) { - mtx_lock(&tp->tap_mtx); + if (!IFQ_IS_EMPTY(&ifp->if_snd)) { if (tp->tap_flags & TAP_RWAIT) { tp->tap_flags &= ~TAP_RWAIT; wakeup(tp); @@ -691,16 +674,16 @@ tapifstart(struct ifnet *ifp) if ((tp->tap_flags & TAP_ASYNC) && (tp->tap_sigio != NULL)) { mtx_unlock(&tp->tap_mtx); pgsigio(&tp->tap_sigio, SIGIO, 0); - } else - mtx_unlock(&tp->tap_mtx); + mtx_lock(&tp->tap_mtx); + } selwakeuppri(&tp->tap_rsel, PZERO+1); - KNOTE_UNLOCKED(&tp->tap_rsel.si_note, 0); + KNOTE_LOCKED(&tp->tap_rsel.si_note, 0); ifp->if_opackets ++; /* obytes are counted in ether_output */ } ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - splx(s); + mtx_unlock(&tp->tap_mtx); } /* tapifstart */ @@ -715,7 +698,6 @@ tapioctl(struct cdev *dev, u_long cmd, c struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; struct tapinfo *tapp = NULL; - int s; int f; #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD4) @@ -724,19 +706,21 @@ tapioctl(struct cdev *dev, u_long cmd, c switch (cmd) { case TAPSIFINFO: - s = splimp(); tapp = (struct tapinfo *)data; + mtx_lock(&tp->tap_mtx); ifp->if_mtu = tapp->mtu; ifp->if_type = tapp->type; ifp->if_baudrate = tapp->baudrate; - splx(s); + mtx_unlock(&tp->tap_mtx); break; case TAPGIFINFO: tapp = (struct tapinfo *)data; + mtx_lock(&tp->tap_mtx); tapp->mtu = ifp->if_mtu; tapp->type = ifp->if_type; tapp->baudrate = ifp->if_baudrate; + mtx_unlock(&tp->tap_mtx); break; case TAPSDEBUG: @@ -757,26 +741,26 @@ tapioctl(struct cdev *dev, u_long cmd, c break; case FIOASYNC: - s = splimp(); mtx_lock(&tp->tap_mtx); if (*(int *)data) tp->tap_flags |= TAP_ASYNC; else tp->tap_flags &= ~TAP_ASYNC; mtx_unlock(&tp->tap_mtx); - splx(s); break; case FIONREAD: - s = splimp(); - if (ifp->if_snd.ifq_head) { - struct mbuf *mb = ifp->if_snd.ifq_head; + if (!IFQ_IS_EMPTY(&ifp->if_snd)) { + struct mbuf *mb; - for(*(int *)data = 0;mb != NULL;mb = mb->m_next) + IFQ_LOCK(&ifp->if_snd); + IFQ_POLL_NOLOCK(&ifp->if_snd, mb); + for (*(int *)data = 0; mb != NULL; + mb = mb->m_next) *(int *)data += mb->m_len; + IFQ_UNLOCK(&ifp->if_snd); } else *(int *)data = 0; - splx(s); break; case FIOSETOWN: @@ -797,10 +781,6 @@ tapioctl(struct cdev *dev, u_long cmd, c /* VMware/VMnet port ioctl's */ - case SIOCGIFFLAGS: /* get ifnet flags */ - bcopy(&ifp->if_flags, data, sizeof(ifp->if_flags)); - break; - #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD4) case _IO('V', 0): @@ -814,9 +794,9 @@ tapioctl(struct cdev *dev, u_long cmd, c f &= ~IFF_CANTCHANGE; f |= IFF_UP; - s = splimp(); + mtx_lock(&tp->tap_mtx); ifp->if_flags = f | (ifp->if_flags & IFF_CANTCHANGE); - splx(s); + mtx_unlock(&tp->tap_mtx); break; case OSIOCGIFADDR: /* get MAC address of the remote side */ @@ -851,7 +831,7 @@ tapread(struct cdev *dev, struct uio *ui struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; struct mbuf *m = NULL; - int error = 0, len, s; + int error = 0, len; TAPDEBUG("%s reading, minor = %#x\n", ifp->if_xname, dev2unit(dev)); @@ -867,26 +847,27 @@ tapread(struct cdev *dev, struct uio *ui } tp->tap_flags &= ~TAP_RWAIT; - mtx_unlock(&tp->tap_mtx); /* sleep until we get a packet */ do { - s = splimp(); IF_DEQUEUE(&ifp->if_snd, m); - splx(s); if (m == NULL) { - if (flag & O_NONBLOCK) + if (flag & O_NONBLOCK) { + mtx_unlock(&tp->tap_mtx); return (EWOULDBLOCK); + } - mtx_lock(&tp->tap_mtx); tp->tap_flags |= TAP_RWAIT; - mtx_unlock(&tp->tap_mtx); - error = tsleep(tp,PCATCH|(PZERO+1),"taprd",0); - if (error) + error = mtx_sleep(tp, &tp->tap_mtx, PCATCH | (PZERO + 1), + "taprd", 0); + if (error) { + mtx_unlock(&tp->tap_mtx); return (error); + } } } while (m == NULL); + mtx_unlock(&tp->tap_mtx); /* feed packet to bpf */ BPF_MTAP(ifp, m); @@ -982,14 +963,14 @@ tappoll(struct cdev *dev, int events, st { struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; - int s, revents = 0; + int revents = 0; TAPDEBUG("%s polling, minor = %#x\n", ifp->if_xname, dev2unit(dev)); - s = splimp(); if (events & (POLLIN | POLLRDNORM)) { - if (ifp->if_snd.ifq_len > 0) { + IFQ_LOCK(&ifp->if_snd); + if (!IFQ_IS_EMPTY(&ifp->if_snd)) { TAPDEBUG("%s have data in queue. len = %d, " \ "minor = %#x\n", ifp->if_xname, ifp->if_snd.ifq_len, dev2unit(dev)); @@ -1001,12 +982,12 @@ tappoll(struct cdev *dev, int events, st selrecord(td, &tp->tap_rsel); } + IFQ_UNLOCK(&ifp->if_snd); } if (events & (POLLOUT | POLLWRNORM)) revents |= (events & (POLLOUT | POLLWRNORM)); - splx(s); return (revents); } /* tappoll */ @@ -1019,11 +1000,9 @@ tappoll(struct cdev *dev, int events, st static int tapkqfilter(struct cdev *dev, struct knote *kn) { - int s; struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; - s = splimp(); switch (kn->kn_filter) { case EVFILT_READ: TAPDEBUG("%s kqfilter: EVFILT_READ, minor = %#x\n", @@ -1040,13 +1019,11 @@ tapkqfilter(struct cdev *dev, struct kno default: TAPDEBUG("%s kqfilter: invalid filter, minor = %#x\n", ifp->if_xname, dev2unit(dev)); - splx(s); return (EINVAL); /* NOT REACHED */ } - splx(s); - kn->kn_hook = (caddr_t) dev; + kn->kn_hook = tp; knlist_add(&tp->tap_rsel.si_note, kn, 0); return (0); @@ -1061,12 +1038,11 @@ tapkqfilter(struct cdev *dev, struct kno static int tapkqread(struct knote *kn, long hint) { - int ret, s; - struct cdev *dev = (struct cdev *)(kn->kn_hook); - struct tap_softc *tp = dev->si_drv1; + int ret; + struct tap_softc *tp = kn->kn_hook; + struct cdev *dev = tp->tap_dev; struct ifnet *ifp = tp->tap_ifp; - s = splimp(); if ((kn->kn_data = ifp->if_snd.ifq_len) > 0) { TAPDEBUG("%s have data in queue. len = %d, minor = %#x\n", ifp->if_xname, ifp->if_snd.ifq_len, dev2unit(dev)); @@ -1076,7 +1052,6 @@ tapkqread(struct knote *kn, long hint) ifp->if_xname, dev2unit(dev)); ret = 0; } - splx(s); return (ret); } /* tapkqread */ @@ -1090,13 +1065,10 @@ tapkqread(struct knote *kn, long hint) static int tapkqwrite(struct knote *kn, long hint) { - int s; - struct tap_softc *tp = ((struct cdev *) kn->kn_hook)->si_drv1; + struct tap_softc *tp = kn->kn_hook; struct ifnet *ifp = tp->tap_ifp; - s = splimp(); kn->kn_data = ifp->if_mtu; - splx(s); return (1); } /* tapkqwrite */ @@ -1105,7 +1077,7 @@ tapkqwrite(struct knote *kn, long hint) static void tapkqdetach(struct knote *kn) { - struct tap_softc *tp = ((struct cdev *) kn->kn_hook)->si_drv1; + struct tap_softc *tp = kn->kn_hook; knlist_remove(&tp->tap_rsel.si_note, kn, 0); } /* tapkqdetach */ Modified: stable/8/sys/net/if_tun.c ============================================================================== --- stable/8/sys/net/if_tun.c Tue Oct 12 15:58:52 2010 (r213725) +++ stable/8/sys/net/if_tun.c Tue Oct 12 16:08:20 2010 (r213726) @@ -165,7 +165,7 @@ static struct filterops tun_write_filter static struct cdevsw tun_cdevsw = { .d_version = D_VERSION, - .d_flags = D_PSEUDO | D_NEEDGIANT | D_NEEDMINOR, + .d_flags = D_PSEUDO | D_NEEDMINOR, .d_open = tunopen, .d_close = tunclose, .d_read = tunread, @@ -344,13 +344,13 @@ tunstart(struct ifnet *ifp) tp->tun_flags &= ~TUN_RWAIT; wakeup(tp); } + selwakeuppri(&tp->tun_rsel, PZERO + 1); + KNOTE_LOCKED(&tp->tun_rsel.si_note, 0); if (tp->tun_flags & TUN_ASYNC && tp->tun_sigio) { mtx_unlock(&tp->tun_mtx); pgsigio(&tp->tun_sigio, SIGIO, 0); } else mtx_unlock(&tp->tun_mtx); - selwakeuppri(&tp->tun_rsel, PZERO + 1); - KNOTE_UNLOCKED(&tp->tun_rsel.si_note, 0); } /* XXX: should return an error code so it can fail. */ @@ -385,7 +385,7 @@ tuncreate(const char *name, struct cdev IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_snd.ifq_drv_maxlen = 0; IFQ_SET_READY(&ifp->if_snd); - knlist_init_mtx(&sc->tun_rsel.si_note, NULL); + knlist_init_mtx(&sc->tun_rsel.si_note, &sc->tun_mtx); ifp->if_capabilities |= IFCAP_LINKSTATE; ifp->if_capenable |= IFCAP_LINKSTATE; @@ -426,10 +426,10 @@ tunopen(struct cdev *dev, int flag, int tp->tun_pid = td->td_proc->p_pid; tp->tun_flags |= TUN_OPEN; - mtx_unlock(&tp->tun_mtx); ifp = TUN2IFP(tp); if_link_state_change(ifp, LINK_STATE_UP); TUNDEBUG(ifp, "open\n"); + mtx_unlock(&tp->tun_mtx); return (0); } @@ -443,7 +443,6 @@ tunclose(struct cdev *dev, int foo, int { struct tun_softc *tp; struct ifnet *ifp; - int s; tp = dev->si_drv1; ifp = TUN2IFP(tp); @@ -451,27 +450,25 @@ tunclose(struct cdev *dev, int foo, int mtx_lock(&tp->tun_mtx); tp->tun_flags &= ~TUN_OPEN; tp->tun_pid = 0; - mtx_unlock(&tp->tun_mtx); /* * junk all pending output */ CURVNET_SET(ifp->if_vnet); - s = splimp(); IFQ_PURGE(&ifp->if_snd); - splx(s); if (ifp->if_flags & IFF_UP) { - s = splimp(); + mtx_unlock(&tp->tun_mtx); if_down(ifp); - splx(s); + mtx_lock(&tp->tun_mtx); } /* Delete all addresses and routes which reference this interface. */ if (ifp->if_drv_flags & IFF_DRV_RUNNING) { struct ifaddr *ifa; - s = splimp(); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + mtx_unlock(&tp->tun_mtx); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { /* deal w/IPv4 PtP destination; unlocked read */ if (ifa->ifa_addr->sa_family == AF_INET) { @@ -482,16 +479,14 @@ tunclose(struct cdev *dev, int foo, int } } if_purgeaddrs(ifp); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - splx(s); + mtx_lock(&tp->tun_mtx); } if_link_state_change(ifp, LINK_STATE_DOWN); CURVNET_RESTORE(); - mtx_lock(&tp->tun_mtx); funsetown(&tp->tun_sigio); selwakeuppri(&tp->tun_rsel, PZERO + 1); - KNOTE_UNLOCKED(&tp->tun_rsel.si_note, 0); + KNOTE_LOCKED(&tp->tun_rsel.si_note, 0); TUNDEBUG (ifp, "closed\n"); cv_broadcast(&tp->tun_cv); @@ -502,14 +497,15 @@ tunclose(struct cdev *dev, int foo, int static int tuninit(struct ifnet *ifp) { -#ifdef INET struct tun_softc *tp = ifp->if_softc; +#ifdef INET struct ifaddr *ifa; #endif int error = 0; TUNDEBUG(ifp, "tuninit\n"); + mtx_lock(&tp->tun_mtx); ifp->if_flags |= IFF_UP; ifp->if_drv_flags |= IFF_DRV_RUNNING; getmicrotime(&ifp->if_lastchange); @@ -521,18 +517,17 @@ tuninit(struct ifnet *ifp) struct sockaddr_in *si; si = (struct sockaddr_in *)ifa->ifa_addr; - mtx_lock(&tp->tun_mtx); if (si->sin_addr.s_addr) tp->tun_flags |= TUN_IASET; si = (struct sockaddr_in *)ifa->ifa_dstaddr; if (si && si->sin_addr.s_addr) tp->tun_flags |= TUN_DSTADDR; - mtx_unlock(&tp->tun_mtx); } } if_addr_runlock(ifp); #endif + mtx_unlock(&tp->tun_mtx); return (error); } @@ -545,9 +540,8 @@ tunifioctl(struct ifnet *ifp, u_long cmd struct ifreq *ifr = (struct ifreq *)data; struct tun_softc *tp = ifp->if_softc; struct ifstat *ifs; - int error = 0, s; + int error = 0; - s = splimp(); switch(cmd) { case SIOCGIFSTATUS: ifs = (struct ifstat *)data; @@ -576,7 +570,6 @@ tunifioctl(struct ifnet *ifp, u_long cmd default: error = EINVAL; } - splx(s); return (error); } @@ -682,7 +675,6 @@ tunoutput( static int tunioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { - int s; int error; struct tun_softc *tp = dev->si_drv1; struct tuninfo *tunp; @@ -697,15 +689,19 @@ tunioctl(struct cdev *dev, u_long cmd, c if (error) return (error); } + mtx_lock(&tp->tun_mtx); TUN2IFP(tp)->if_mtu = tunp->mtu; TUN2IFP(tp)->if_type = tunp->type; TUN2IFP(tp)->if_baudrate = tunp->baudrate; + mtx_unlock(&tp->tun_mtx); break; case TUNGIFINFO: tunp = (struct tuninfo *)data; + mtx_lock(&tp->tun_mtx); tunp->mtu = TUN2IFP(tp)->if_mtu; tunp->type = TUN2IFP(tp)->if_type; tunp->baudrate = TUN2IFP(tp)->if_baudrate; + mtx_unlock(&tp->tun_mtx); break; case TUNSDEBUG: tundebug = *(int *)data; @@ -732,7 +728,6 @@ tunioctl(struct cdev *dev, u_long cmd, c mtx_unlock(&tp->tun_mtx); break; case TUNGIFHEAD: - /* Could be unlocked read? */ mtx_lock(&tp->tun_mtx); *(int *)data = (tp->tun_flags & TUN_IFHEAD) ? 1 : 0; mtx_unlock(&tp->tun_mtx); @@ -745,9 +740,11 @@ tunioctl(struct cdev *dev, u_long cmd, c switch (*(int *)data & ~IFF_MULTICAST) { case IFF_POINTOPOINT: case IFF_BROADCAST: + mtx_lock(&tp->tun_mtx); TUN2IFP(tp)->if_flags &= ~(IFF_BROADCAST|IFF_POINTOPOINT|IFF_MULTICAST); TUN2IFP(tp)->if_flags |= *(int *)data; + mtx_unlock(&tp->tun_mtx); break; default: return(EINVAL); @@ -769,17 +766,15 @@ tunioctl(struct cdev *dev, u_long cmd, c mtx_unlock(&tp->tun_mtx); break; case FIONREAD: - s = splimp(); if (!IFQ_IS_EMPTY(&TUN2IFP(tp)->if_snd)) { struct mbuf *mb; IFQ_LOCK(&TUN2IFP(tp)->if_snd); IFQ_POLL_NOLOCK(&TUN2IFP(tp)->if_snd, mb); - for( *(int *)data = 0; mb != 0; mb = mb->m_next) + for (*(int *)data = 0; mb != NULL; mb = mb->m_next) *(int *)data += mb->m_len; IFQ_UNLOCK(&TUN2IFP(tp)->if_snd); } else *(int *)data = 0; - splx(s); break; case FIOSETOWN: return (fsetown(*(int *)data, &tp->tun_sigio)); @@ -813,7 +808,7 @@ tunread(struct cdev *dev, struct uio *ui struct tun_softc *tp = dev->si_drv1; struct ifnet *ifp = TUN2IFP(tp); struct mbuf *m; - int error=0, len, s; + int error=0, len; TUNDEBUG (ifp, "read\n"); mtx_lock(&tp->tun_mtx); @@ -824,27 +819,24 @@ tunread(struct cdev *dev, struct uio *ui } tp->tun_flags &= ~TUN_RWAIT; - mtx_unlock(&tp->tun_mtx); - s = splimp(); do { IFQ_DEQUEUE(&ifp->if_snd, m); if (m == NULL) { if (flag & O_NONBLOCK) { - splx(s); + mtx_unlock(&tp->tun_mtx); return (EWOULDBLOCK); } - mtx_lock(&tp->tun_mtx); tp->tun_flags |= TUN_RWAIT; - mtx_unlock(&tp->tun_mtx); - if ((error = tsleep(tp, PCATCH | (PZERO + 1), - "tunread", 0)) != 0) { - splx(s); + error = mtx_sleep(tp, &tp->tun_mtx, PCATCH | (PZERO + 1), + "tunread", 0); + if (error != 0) { + mtx_unlock(&tp->tun_mtx); return (error); } } } while (m == NULL); - splx(s); + mtx_unlock(&tp->tun_mtx); while (m && uio->uio_resid > 0 && error == 0) { len = min(uio->uio_resid, m->m_len); @@ -957,13 +949,11 @@ tunwrite(struct cdev *dev, struct uio *u static int tunpoll(struct cdev *dev, int events, struct thread *td) { - int s; struct tun_softc *tp = dev->si_drv1; struct ifnet *ifp = TUN2IFP(tp); int revents = 0; struct mbuf *m; - s = splimp(); TUNDEBUG(ifp, "tunpoll\n"); if (events & (POLLIN | POLLRDNORM)) { @@ -981,7 +971,6 @@ tunpoll(struct cdev *dev, int events, st if (events & (POLLOUT | POLLWRNORM)) revents |= events & (POLLOUT | POLLWRNORM); - splx(s); return (revents); } @@ -991,11 +980,9 @@ tunpoll(struct cdev *dev, int events, st static int tunkqfilter(struct cdev *dev, struct knote *kn) { - int s; struct tun_softc *tp = dev->si_drv1; struct ifnet *ifp = TUN2IFP(tp); - s = splimp(); switch(kn->kn_filter) { case EVFILT_READ: TUNDEBUG(ifp, "%s kqfilter: EVFILT_READ, minor = %#x\n", @@ -1012,12 +999,10 @@ tunkqfilter(struct cdev *dev, struct kno default: TUNDEBUG(ifp, "%s kqfilter: invalid filter, minor = %#x\n", ifp->if_xname, dev2unit(dev)); - splx(s); return(EINVAL); } - splx(s); - kn->kn_hook = (caddr_t) dev; + kn->kn_hook = tp; knlist_add(&tp->tun_rsel.si_note, kn, 0); return (0); @@ -1029,12 +1014,11 @@ tunkqfilter(struct cdev *dev, struct kno static int tunkqread(struct knote *kn, long hint) { - int ret, s; - struct cdev *dev = (struct cdev *)(kn->kn_hook); - struct tun_softc *tp = dev->si_drv1; + int ret; + struct tun_softc *tp = kn->kn_hook; + struct cdev *dev = tp->tun_dev; struct ifnet *ifp = TUN2IFP(tp); - s = splimp(); if ((kn->kn_data = ifp->if_snd.ifq_len) > 0) { TUNDEBUG(ifp, "%s have data in the queue. Len = %d, minor = %#x\n", @@ -1046,7 +1030,6 @@ tunkqread(struct knote *kn, long hint) dev2unit(dev)); ret = 0; } - splx(s); return (ret); } @@ -1057,13 +1040,10 @@ tunkqread(struct knote *kn, long hint) static int tunkqwrite(struct knote *kn, long hint) { - int s; - struct tun_softc *tp = ((struct cdev *)kn->kn_hook)->si_drv1; + struct tun_softc *tp = kn->kn_hook; struct ifnet *ifp = TUN2IFP(tp); - s = splimp(); kn->kn_data = ifp->if_mtu; - splx(s); return (1); } @@ -1071,7 +1051,7 @@ tunkqwrite(struct knote *kn, long hint) static void tunkqdetach(struct knote *kn) { - struct tun_softc *tp = ((struct cdev *)kn->kn_hook)->si_drv1; + struct tun_softc *tp = kn->kn_hook; knlist_remove(&tp->tun_rsel.si_note, kn, 0); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 16:09:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F3801065675; Tue, 12 Oct 2010 16:09:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BE528FC08; Tue, 12 Oct 2010 16:09:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CG997L052845; Tue, 12 Oct 2010 16:09:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CG99aX052842; Tue, 12 Oct 2010 16:09:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121609.o9CG99aX052842@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 16:09:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213727 - stable/7/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 16:09:09 -0000 Author: jhb Date: Tue Oct 12 16:09:08 2010 New Revision: 213727 URL: http://svn.freebsd.org/changeset/base/213727 Log: MFC 213028,213328: - Expand scope of tun/tap softc locks to cover more softc fields and driver-maintained ifnet fields (such as if_drv_flags). - Use soft locks as the mutex that protects each interface's knote list rather than using the global knote list lock. Also, use the softc for kn_hook instead of the cdev. - Use mtx_sleep() instead of tsleep() when blocking in the read routines. This fixes a lost wakeup race. - Remove D_NEEDGIANT now that the cdevsw routines use the softc lock where locking is needed. - Lock IFQ when calculating the result for FIONREAD in tap(4). tun(4) already did this. - Remove remaining spl calls. Modified: stable/7/sys/net/if_tap.c stable/7/sys/net/if_tun.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net/if_tap.c ============================================================================== --- stable/7/sys/net/if_tap.c Tue Oct 12 16:08:20 2010 (r213726) +++ stable/7/sys/net/if_tap.c Tue Oct 12 16:09:08 2010 (r213727) @@ -132,7 +132,7 @@ static struct filterops tap_write_filter static struct cdevsw tap_cdevsw = { .d_version = D_VERSION, - .d_flags = D_PSEUDO | D_NEEDGIANT, + .d_flags = D_PSEUDO, .d_open = tapopen, .d_close = tapclose, .d_read = tapread, @@ -209,7 +209,6 @@ static void tap_destroy(struct tap_softc *tp) { struct ifnet *ifp = tp->tap_ifp; - int s; /* Unlocked read. */ KASSERT(!(tp->tap_flags & TAP_OPEN), @@ -217,10 +216,8 @@ tap_destroy(struct tap_softc *tp) knlist_destroy(&tp->tap_rsel.si_note); destroy_dev(tp->tap_dev); - s = splimp(); ether_ifdetach(ifp); if_free_type(ifp, IFT_ETHER); - splx(s); mtx_destroy(&tp->tap_mtx); free(tp, M_TAP); @@ -399,7 +396,7 @@ tapcreate(struct cdev *dev) struct tap_softc *tp = NULL; unsigned short macaddr_hi; uint32_t macaddr_mid; - int unit, s; + int unit; char *name = NULL; u_char eaddr[6]; @@ -443,20 +440,18 @@ tapcreate(struct cdev *dev) ifp->if_ioctl = tapifioctl; ifp->if_mtu = ETHERMTU; ifp->if_flags = (IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST); - ifp->if_snd.ifq_maxlen = ifqmaxlen; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); dev->si_drv1 = tp; tp->tap_dev = dev; - s = splimp(); ether_ifattach(ifp, eaddr); - splx(s); mtx_lock(&tp->tap_mtx); tp->tap_flags |= TAP_INITED; mtx_unlock(&tp->tap_mtx); - knlist_init_mtx(&tp->tap_rsel.si_note, NULL); + knlist_init_mtx(&tp->tap_rsel.si_note, &tp->tap_mtx); TAPDEBUG("interface %s is created. minor = %#x\n", ifp->if_xname, minor(dev)); @@ -473,7 +468,7 @@ tapopen(struct cdev *dev, int flag, int { struct tap_softc *tp = NULL; struct ifnet *ifp = NULL; - int error, s; + int error; if (tapuopen == 0) { error = priv_check(td, PRIV_NET_TAP); @@ -496,14 +491,12 @@ tapopen(struct cdev *dev, int flag, int tp->tap_pid = td->td_proc->p_pid; tp->tap_flags |= TAP_OPEN; ifp = tp->tap_ifp; - mtx_unlock(&tp->tap_mtx); - s = splimp(); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if (tapuponopen) ifp->if_flags |= IFF_UP; - splx(s); + mtx_unlock(&tp->tap_mtx); TAPDEBUG("%s is open. minor = %#x\n", ifp->if_xname, minor(dev)); @@ -522,9 +515,9 @@ tapclose(struct cdev *dev, int foo, int struct ifaddr *ifa; struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; - int s; /* junk all pending output */ + mtx_lock(&tp->tap_mtx); IF_DRAIN(&ifp->if_snd); /* @@ -532,27 +525,25 @@ tapclose(struct cdev *dev, int foo, int * interface, if we are in VMnet mode. just close the device. */ - mtx_lock(&tp->tap_mtx); if (((tp->tap_flags & TAP_VMNET) == 0) && (ifp->if_flags & IFF_UP)) { mtx_unlock(&tp->tap_mtx); - s = splimp(); if_down(ifp); + mtx_lock(&tp->tap_mtx); if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + mtx_unlock(&tp->tap_mtx); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { rtinit(ifa, (int)RTM_DELETE, 0); } if_purgeaddrs(ifp); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + mtx_lock(&tp->tap_mtx); } - splx(s); - } else - mtx_unlock(&tp->tap_mtx); + } funsetown(&tp->tap_sigio); selwakeuppri(&tp->tap_rsel, PZERO+1); - KNOTE_UNLOCKED(&tp->tap_rsel.si_note, 0); + KNOTE_LOCKED(&tp->tap_rsel.si_note, 0); - mtx_lock(&tp->tap_mtx); tp->tap_flags &= ~TAP_OPEN; tp->tap_pid = 0; mtx_unlock(&tp->tap_mtx); @@ -577,8 +568,10 @@ tapifinit(void *xtp) TAPDEBUG("initializing %s\n", ifp->if_xname); + mtx_lock(&tp->tap_mtx); ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + mtx_unlock(&tp->tap_mtx); /* attempt to start output */ tapifstart(ifp); @@ -596,7 +589,7 @@ tapifioctl(struct ifnet *ifp, u_long cmd struct tap_softc *tp = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; struct ifstat *ifs = NULL; - int s, dummy; + int dummy; switch (cmd) { case SIOCSIFFLAGS: /* XXX -- just like vmnet does */ @@ -609,7 +602,6 @@ tapifioctl(struct ifnet *ifp, u_long cmd break; case SIOCGIFSTATUS: - s = splimp(); ifs = (struct ifstat *)data; dummy = strlen(ifs->ascii); mtx_lock(&tp->tap_mtx); @@ -618,14 +610,10 @@ tapifioctl(struct ifnet *ifp, u_long cmd sizeof(ifs->ascii) - dummy, "\tOpened by PID %d\n", tp->tap_pid); mtx_unlock(&tp->tap_mtx); - splx(s); break; default: - s = splimp(); - dummy = ether_ioctl(ifp, cmd, data); - splx(s); - return (dummy); + return (ether_ioctl(ifp, cmd, data)); /* NOT REACHED */ } @@ -642,7 +630,6 @@ static void tapifstart(struct ifnet *ifp) { struct tap_softc *tp = ifp->if_softc; - int s; TAPDEBUG("%s starting\n", ifp->if_xname); @@ -654,32 +641,28 @@ tapifstart(struct ifnet *ifp) mtx_lock(&tp->tap_mtx); if (((tp->tap_flags & TAP_VMNET) == 0) && ((tp->tap_flags & TAP_READY) != TAP_READY)) { - struct mbuf *m = NULL; - - mtx_unlock(&tp->tap_mtx); + struct mbuf *m; /* Unlocked read. */ TAPDEBUG("%s not ready, tap_flags = 0x%x\n", ifp->if_xname, tp->tap_flags); - s = splimp(); - do { + for (;;) { IF_DEQUEUE(&ifp->if_snd, m); - if (m != NULL) + if (m != NULL) { m_freem(m); - ifp->if_oerrors ++; - } while (m != NULL); - splx(s); + ifp->if_oerrors++; + } else + break; + } + mtx_unlock(&tp->tap_mtx); return; } - mtx_unlock(&tp->tap_mtx); - s = splimp(); ifp->if_drv_flags |= IFF_DRV_OACTIVE; - if (ifp->if_snd.ifq_len != 0) { - mtx_lock(&tp->tap_mtx); + if (!IFQ_IS_EMPTY(&ifp->if_snd)) { if (tp->tap_flags & TAP_RWAIT) { tp->tap_flags &= ~TAP_RWAIT; wakeup(tp); @@ -688,16 +671,16 @@ tapifstart(struct ifnet *ifp) if ((tp->tap_flags & TAP_ASYNC) && (tp->tap_sigio != NULL)) { mtx_unlock(&tp->tap_mtx); pgsigio(&tp->tap_sigio, SIGIO, 0); - } else - mtx_unlock(&tp->tap_mtx); + mtx_lock(&tp->tap_mtx); + } selwakeuppri(&tp->tap_rsel, PZERO+1); - KNOTE_UNLOCKED(&tp->tap_rsel.si_note, 0); + KNOTE_LOCKED(&tp->tap_rsel.si_note, 0); ifp->if_opackets ++; /* obytes are counted in ether_output */ } ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - splx(s); + mtx_unlock(&tp->tap_mtx); } /* tapifstart */ @@ -712,7 +695,6 @@ tapioctl(struct cdev *dev, u_long cmd, c struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; struct tapinfo *tapp = NULL; - int s; int f; #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD4) @@ -721,19 +703,21 @@ tapioctl(struct cdev *dev, u_long cmd, c switch (cmd) { case TAPSIFINFO: - s = splimp(); tapp = (struct tapinfo *)data; + mtx_lock(&tp->tap_mtx); ifp->if_mtu = tapp->mtu; ifp->if_type = tapp->type; ifp->if_baudrate = tapp->baudrate; - splx(s); + mtx_unlock(&tp->tap_mtx); break; case TAPGIFINFO: tapp = (struct tapinfo *)data; + mtx_lock(&tp->tap_mtx); tapp->mtu = ifp->if_mtu; tapp->type = ifp->if_type; tapp->baudrate = ifp->if_baudrate; + mtx_unlock(&tp->tap_mtx); break; case TAPSDEBUG: @@ -754,26 +738,26 @@ tapioctl(struct cdev *dev, u_long cmd, c break; case FIOASYNC: - s = splimp(); mtx_lock(&tp->tap_mtx); if (*(int *)data) tp->tap_flags |= TAP_ASYNC; else tp->tap_flags &= ~TAP_ASYNC; mtx_unlock(&tp->tap_mtx); - splx(s); break; case FIONREAD: - s = splimp(); - if (ifp->if_snd.ifq_head) { - struct mbuf *mb = ifp->if_snd.ifq_head; + if (!IFQ_IS_EMPTY(&ifp->if_snd)) { + struct mbuf *mb; - for(*(int *)data = 0;mb != NULL;mb = mb->m_next) + IFQ_LOCK(&ifp->if_snd); + IFQ_POLL_NOLOCK(&ifp->if_snd, mb); + for (*(int *)data = 0; mb != NULL; + mb = mb->m_next) *(int *)data += mb->m_len; + IFQ_UNLOCK(&ifp->if_snd); } else *(int *)data = 0; - splx(s); break; case FIOSETOWN: @@ -794,10 +778,6 @@ tapioctl(struct cdev *dev, u_long cmd, c /* VMware/VMnet port ioctl's */ - case SIOCGIFFLAGS: /* get ifnet flags */ - bcopy(&ifp->if_flags, data, sizeof(ifp->if_flags)); - break; - #if defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD4) case _IO('V', 0): @@ -811,9 +791,9 @@ tapioctl(struct cdev *dev, u_long cmd, c f &= ~IFF_CANTCHANGE; f |= IFF_UP; - s = splimp(); + mtx_lock(&tp->tap_mtx); ifp->if_flags = f | (ifp->if_flags & IFF_CANTCHANGE); - splx(s); + mtx_unlock(&tp->tap_mtx); break; case OSIOCGIFADDR: /* get MAC address of the remote side */ @@ -848,7 +828,7 @@ tapread(struct cdev *dev, struct uio *ui struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; struct mbuf *m = NULL; - int error = 0, len, s; + int error = 0, len; TAPDEBUG("%s reading, minor = %#x\n", ifp->if_xname, minor(dev)); @@ -864,26 +844,27 @@ tapread(struct cdev *dev, struct uio *ui } tp->tap_flags &= ~TAP_RWAIT; - mtx_unlock(&tp->tap_mtx); /* sleep until we get a packet */ do { - s = splimp(); IF_DEQUEUE(&ifp->if_snd, m); - splx(s); if (m == NULL) { - if (flag & O_NONBLOCK) + if (flag & O_NONBLOCK) { + mtx_unlock(&tp->tap_mtx); return (EWOULDBLOCK); + } - mtx_lock(&tp->tap_mtx); tp->tap_flags |= TAP_RWAIT; - mtx_unlock(&tp->tap_mtx); - error = tsleep(tp,PCATCH|(PZERO+1),"taprd",0); - if (error) + error = mtx_sleep(tp, &tp->tap_mtx, PCATCH | (PZERO + 1), + "taprd", 0); + if (error) { + mtx_unlock(&tp->tap_mtx); return (error); + } } } while (m == NULL); + mtx_unlock(&tp->tap_mtx); /* feed packet to bpf */ BPF_MTAP(ifp, m); @@ -979,14 +960,14 @@ tappoll(struct cdev *dev, int events, st { struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; - int s, revents = 0; + int revents = 0; TAPDEBUG("%s polling, minor = %#x\n", ifp->if_xname, minor(dev)); - s = splimp(); if (events & (POLLIN | POLLRDNORM)) { - if (ifp->if_snd.ifq_len > 0) { + IFQ_LOCK(&ifp->if_snd); + if (!IFQ_IS_EMPTY(&ifp->if_snd)) { TAPDEBUG("%s have data in queue. len = %d, " \ "minor = %#x\n", ifp->if_xname, ifp->if_snd.ifq_len, minor(dev)); @@ -998,12 +979,12 @@ tappoll(struct cdev *dev, int events, st selrecord(td, &tp->tap_rsel); } + IFQ_UNLOCK(&ifp->if_snd); } if (events & (POLLOUT | POLLWRNORM)) revents |= (events & (POLLOUT | POLLWRNORM)); - splx(s); return (revents); } /* tappoll */ @@ -1016,11 +997,9 @@ tappoll(struct cdev *dev, int events, st static int tapkqfilter(struct cdev *dev, struct knote *kn) { - int s; struct tap_softc *tp = dev->si_drv1; struct ifnet *ifp = tp->tap_ifp; - s = splimp(); switch (kn->kn_filter) { case EVFILT_READ: TAPDEBUG("%s kqfilter: EVFILT_READ, minor = %#x\n", @@ -1037,13 +1016,11 @@ tapkqfilter(struct cdev *dev, struct kno default: TAPDEBUG("%s kqfilter: invalid filter, minor = %#x\n", ifp->if_xname, minor(dev)); - splx(s); return (EINVAL); /* NOT REACHED */ } - splx(s); - kn->kn_hook = (caddr_t) dev; + kn->kn_hook = tp; knlist_add(&tp->tap_rsel.si_note, kn, 0); return (0); @@ -1058,12 +1035,11 @@ tapkqfilter(struct cdev *dev, struct kno static int tapkqread(struct knote *kn, long hint) { - int ret, s; - struct cdev *dev = (struct cdev *)(kn->kn_hook); - struct tap_softc *tp = dev->si_drv1; + int ret; + struct tap_softc *tp = kn->kn_hook; + struct cdev *dev = tp->tap_dev; struct ifnet *ifp = tp->tap_ifp; - s = splimp(); if ((kn->kn_data = ifp->if_snd.ifq_len) > 0) { TAPDEBUG("%s have data in queue. len = %d, minor = %#x\n", ifp->if_xname, ifp->if_snd.ifq_len, minor(dev)); @@ -1073,7 +1049,6 @@ tapkqread(struct knote *kn, long hint) ifp->if_xname, minor(dev)); ret = 0; } - splx(s); return (ret); } /* tapkqread */ @@ -1087,13 +1062,10 @@ tapkqread(struct knote *kn, long hint) static int tapkqwrite(struct knote *kn, long hint) { - int s; - struct tap_softc *tp = ((struct cdev *) kn->kn_hook)->si_drv1; + struct tap_softc *tp = kn->kn_hook; struct ifnet *ifp = tp->tap_ifp; - s = splimp(); kn->kn_data = ifp->if_mtu; - splx(s); return (1); } /* tapkqwrite */ @@ -1102,7 +1074,7 @@ tapkqwrite(struct knote *kn, long hint) static void tapkqdetach(struct knote *kn) { - struct tap_softc *tp = ((struct cdev *) kn->kn_hook)->si_drv1; + struct tap_softc *tp = kn->kn_hook; knlist_remove(&tp->tap_rsel.si_note, kn, 0); } /* tapkqdetach */ Modified: stable/7/sys/net/if_tun.c ============================================================================== --- stable/7/sys/net/if_tun.c Tue Oct 12 16:08:20 2010 (r213726) +++ stable/7/sys/net/if_tun.c Tue Oct 12 16:09:08 2010 (r213727) @@ -162,7 +162,7 @@ static struct filterops tun_write_filter static struct cdevsw tun_cdevsw = { .d_version = D_VERSION, - .d_flags = D_PSEUDO | D_NEEDGIANT, + .d_flags = D_PSEUDO, .d_open = tunopen, .d_close = tunclose, .d_read = tunread, @@ -333,13 +333,13 @@ tunstart(struct ifnet *ifp) tp->tun_flags &= ~TUN_RWAIT; wakeup(tp); } + selwakeuppri(&tp->tun_rsel, PZERO + 1); + KNOTE_LOCKED(&tp->tun_rsel.si_note, 0); if (tp->tun_flags & TUN_ASYNC && tp->tun_sigio) { mtx_unlock(&tp->tun_mtx); pgsigio(&tp->tun_sigio, SIGIO, 0); } else mtx_unlock(&tp->tun_mtx); - selwakeuppri(&tp->tun_rsel, PZERO + 1); - KNOTE_UNLOCKED(&tp->tun_rsel.si_note, 0); } /* XXX: should return an error code so it can fail. */ @@ -373,7 +373,7 @@ tuncreate(const char *name, struct cdev IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_snd.ifq_drv_maxlen = 0; IFQ_SET_READY(&ifp->if_snd); - knlist_init_mtx(&sc->tun_rsel.si_note, NULL); + knlist_init_mtx(&sc->tun_rsel.si_note, &sc->tun_mtx); if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(u_int32_t)); @@ -412,9 +412,9 @@ tunopen(struct cdev *dev, int flag, int tp->tun_pid = td->td_proc->p_pid; tp->tun_flags |= TUN_OPEN; - mtx_unlock(&tp->tun_mtx); ifp = TUN2IFP(tp); TUNDEBUG(ifp, "open\n"); + mtx_unlock(&tp->tun_mtx); return (0); } @@ -428,7 +428,6 @@ tunclose(struct cdev *dev, int foo, int { struct tun_softc *tp; struct ifnet *ifp; - int s; tp = dev->si_drv1; ifp = TUN2IFP(tp); @@ -440,22 +439,20 @@ tunclose(struct cdev *dev, int foo, int /* * junk all pending output */ - s = splimp(); IFQ_PURGE(&ifp->if_snd); - splx(s); - mtx_unlock(&tp->tun_mtx); if (ifp->if_flags & IFF_UP) { - s = splimp(); + mtx_unlock(&tp->tun_mtx); if_down(ifp); - splx(s); + mtx_lock(&tp->tun_mtx); } /* Delete all addresses and routes which reference this interface. */ if (ifp->if_drv_flags & IFF_DRV_RUNNING) { struct ifaddr *ifa; - s = splimp(); + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + mtx_unlock(&tp->tun_mtx); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { /* deal w/IPv4 PtP destination; unlocked read */ if (ifa->ifa_addr->sa_family == AF_INET) { @@ -466,14 +463,14 @@ tunclose(struct cdev *dev, int foo, int } } if_purgeaddrs(ifp); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - splx(s); + mtx_lock(&tp->tun_mtx); } funsetown(&tp->tun_sigio); selwakeuppri(&tp->tun_rsel, PZERO + 1); - KNOTE_UNLOCKED(&tp->tun_rsel.si_note, 0); + KNOTE_LOCKED(&tp->tun_rsel.si_note, 0); TUNDEBUG (ifp, "closed\n"); + mtx_unlock(&tp->tun_mtx); return (0); } @@ -481,11 +478,14 @@ static int tuninit(struct ifnet *ifp) { struct tun_softc *tp = ifp->if_softc; +#ifdef INET struct ifaddr *ifa; +#endif int error = 0; TUNDEBUG(ifp, "tuninit\n"); + mtx_lock(&tp->tun_mtx); ifp->if_flags |= IFF_UP; ifp->if_drv_flags |= IFF_DRV_RUNNING; getmicrotime(&ifp->if_lastchange); @@ -496,17 +496,16 @@ tuninit(struct ifnet *ifp) struct sockaddr_in *si; si = (struct sockaddr_in *)ifa->ifa_addr; - mtx_lock(&tp->tun_mtx); if (si->sin_addr.s_addr) tp->tun_flags |= TUN_IASET; si = (struct sockaddr_in *)ifa->ifa_dstaddr; if (si && si->sin_addr.s_addr) tp->tun_flags |= TUN_DSTADDR; - mtx_unlock(&tp->tun_mtx); } } #endif + mtx_unlock(&tp->tun_mtx); return (error); } @@ -519,9 +518,8 @@ tunifioctl(struct ifnet *ifp, u_long cmd struct ifreq *ifr = (struct ifreq *)data; struct tun_softc *tp = ifp->if_softc; struct ifstat *ifs; - int error = 0, s; + int error = 0; - s = splimp(); switch(cmd) { case SIOCGIFSTATUS: ifs = (struct ifstat *)data; @@ -550,7 +548,6 @@ tunifioctl(struct ifnet *ifp, u_long cmd default: error = EINVAL; } - splx(s); return (error); } @@ -656,7 +653,6 @@ tunoutput( static int tunioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { - int s; int error; struct tun_softc *tp = dev->si_drv1; struct tuninfo *tunp; @@ -671,15 +667,19 @@ tunioctl(struct cdev *dev, u_long cmd, c if (error) return (error); } + mtx_lock(&tp->tun_mtx); TUN2IFP(tp)->if_mtu = tunp->mtu; TUN2IFP(tp)->if_type = tunp->type; TUN2IFP(tp)->if_baudrate = tunp->baudrate; + mtx_unlock(&tp->tun_mtx); break; case TUNGIFINFO: tunp = (struct tuninfo *)data; + mtx_lock(&tp->tun_mtx); tunp->mtu = TUN2IFP(tp)->if_mtu; tunp->type = TUN2IFP(tp)->if_type; tunp->baudrate = TUN2IFP(tp)->if_baudrate; + mtx_unlock(&tp->tun_mtx); break; case TUNSDEBUG: tundebug = *(int *)data; @@ -706,7 +706,6 @@ tunioctl(struct cdev *dev, u_long cmd, c mtx_unlock(&tp->tun_mtx); break; case TUNGIFHEAD: - /* Could be unlocked read? */ mtx_lock(&tp->tun_mtx); *(int *)data = (tp->tun_flags & TUN_IFHEAD) ? 1 : 0; mtx_unlock(&tp->tun_mtx); @@ -719,9 +718,11 @@ tunioctl(struct cdev *dev, u_long cmd, c switch (*(int *)data & ~IFF_MULTICAST) { case IFF_POINTOPOINT: case IFF_BROADCAST: + mtx_lock(&tp->tun_mtx); TUN2IFP(tp)->if_flags &= ~(IFF_BROADCAST|IFF_POINTOPOINT|IFF_MULTICAST); TUN2IFP(tp)->if_flags |= *(int *)data; + mtx_unlock(&tp->tun_mtx); break; default: return(EINVAL); @@ -743,17 +744,15 @@ tunioctl(struct cdev *dev, u_long cmd, c mtx_unlock(&tp->tun_mtx); break; case FIONREAD: - s = splimp(); if (!IFQ_IS_EMPTY(&TUN2IFP(tp)->if_snd)) { struct mbuf *mb; IFQ_LOCK(&TUN2IFP(tp)->if_snd); IFQ_POLL_NOLOCK(&TUN2IFP(tp)->if_snd, mb); - for( *(int *)data = 0; mb != 0; mb = mb->m_next) + for (*(int *)data = 0; mb != NULL; mb = mb->m_next) *(int *)data += mb->m_len; IFQ_UNLOCK(&TUN2IFP(tp)->if_snd); } else *(int *)data = 0; - splx(s); break; case FIOSETOWN: return (fsetown(*(int *)data, &tp->tun_sigio)); @@ -787,7 +786,7 @@ tunread(struct cdev *dev, struct uio *ui struct tun_softc *tp = dev->si_drv1; struct ifnet *ifp = TUN2IFP(tp); struct mbuf *m; - int error=0, len, s; + int error=0, len; TUNDEBUG (ifp, "read\n"); mtx_lock(&tp->tun_mtx); @@ -798,27 +797,24 @@ tunread(struct cdev *dev, struct uio *ui } tp->tun_flags &= ~TUN_RWAIT; - mtx_unlock(&tp->tun_mtx); - s = splimp(); do { IFQ_DEQUEUE(&ifp->if_snd, m); if (m == NULL) { if (flag & O_NONBLOCK) { - splx(s); + mtx_unlock(&tp->tun_mtx); return (EWOULDBLOCK); } - mtx_lock(&tp->tun_mtx); tp->tun_flags |= TUN_RWAIT; - mtx_unlock(&tp->tun_mtx); - if ((error = tsleep(tp, PCATCH | (PZERO + 1), - "tunread", 0)) != 0) { - splx(s); + error = mtx_sleep(tp, &tp->tun_mtx, PCATCH | (PZERO + 1), + "tunread", 0); + if (error != 0) { + mtx_unlock(&tp->tun_mtx); return (error); } } } while (m == NULL); - splx(s); + mtx_unlock(&tp->tun_mtx); while (m && uio->uio_resid > 0 && error == 0) { len = min(uio->uio_resid, m->m_len); @@ -929,13 +925,11 @@ tunwrite(struct cdev *dev, struct uio *u static int tunpoll(struct cdev *dev, int events, struct thread *td) { - int s; struct tun_softc *tp = dev->si_drv1; struct ifnet *ifp = TUN2IFP(tp); int revents = 0; struct mbuf *m; - s = splimp(); TUNDEBUG(ifp, "tunpoll\n"); if (events & (POLLIN | POLLRDNORM)) { @@ -953,7 +947,6 @@ tunpoll(struct cdev *dev, int events, st if (events & (POLLOUT | POLLWRNORM)) revents |= events & (POLLOUT | POLLWRNORM); - splx(s); return (revents); } @@ -963,11 +956,9 @@ tunpoll(struct cdev *dev, int events, st static int tunkqfilter(struct cdev *dev, struct knote *kn) { - int s; struct tun_softc *tp = dev->si_drv1; struct ifnet *ifp = TUN2IFP(tp); - s = splimp(); switch(kn->kn_filter) { case EVFILT_READ: TUNDEBUG(ifp, "%s kqfilter: EVFILT_READ, minor = %#x\n", @@ -984,12 +975,10 @@ tunkqfilter(struct cdev *dev, struct kno default: TUNDEBUG(ifp, "%s kqfilter: invalid filter, minor = %#x\n", ifp->if_xname, minor(dev)); - splx(s); return(EINVAL); } - splx(s); - kn->kn_hook = (caddr_t) dev; + kn->kn_hook = tp; knlist_add(&tp->tun_rsel.si_note, kn, 0); return (0); @@ -1001,12 +990,11 @@ tunkqfilter(struct cdev *dev, struct kno static int tunkqread(struct knote *kn, long hint) { - int ret, s; - struct cdev *dev = (struct cdev *)(kn->kn_hook); - struct tun_softc *tp = dev->si_drv1; + int ret; + struct tun_softc *tp = kn->kn_hook; + struct cdev *dev = tp->tun_dev; struct ifnet *ifp = TUN2IFP(tp); - s = splimp(); if ((kn->kn_data = ifp->if_snd.ifq_len) > 0) { TUNDEBUG(ifp, "%s have data in the queue. Len = %d, minor = %#x\n", @@ -1018,7 +1006,6 @@ tunkqread(struct knote *kn, long hint) minor(dev)); ret = 0; } - splx(s); return (ret); } @@ -1029,13 +1016,10 @@ tunkqread(struct knote *kn, long hint) static int tunkqwrite(struct knote *kn, long hint) { - int s; - struct tun_softc *tp = ((struct cdev *)kn->kn_hook)->si_drv1; + struct tun_softc *tp = kn->kn_hook; struct ifnet *ifp = TUN2IFP(tp); - s = splimp(); kn->kn_data = ifp->if_mtu; - splx(s); return (1); } @@ -1043,7 +1027,7 @@ tunkqwrite(struct knote *kn, long hint) static void tunkqdetach(struct knote *kn) { - struct tun_softc *tp = ((struct cdev *)kn->kn_hook)->si_drv1; + struct tun_softc *tp = kn->kn_hook; knlist_remove(&tp->tun_rsel.si_note, kn, 0); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 16:23:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72CC910656A6; Tue, 12 Oct 2010 16:23:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60A748FC21; Tue, 12 Oct 2010 16:23:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CGNo0Q053330; Tue, 12 Oct 2010 16:23:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CGNooX053328; Tue, 12 Oct 2010 16:23:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121623.o9CGNooX053328@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 16:23: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: r213728 - stable/8/sys/dev/ral X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 16:23:50 -0000 Author: jhb Date: Tue Oct 12 16:23:50 2010 New Revision: 213728 URL: http://svn.freebsd.org/changeset/base/213728 Log: MFC 213268: If rt2560_bbp_init() fails, don't drop the lock as the callers of rt2560_init_locked() expect the lock to be held on return. Modified: stable/8/sys/dev/ral/rt2560.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ral/rt2560.c ============================================================================== --- stable/8/sys/dev/ral/rt2560.c Tue Oct 12 16:09:08 2010 (r213727) +++ stable/8/sys/dev/ral/rt2560.c Tue Oct 12 16:23:50 2010 (r213728) @@ -2667,8 +2667,7 @@ rt2560_init_locked(struct rt2560_softc * RAL_WRITE(sc, RT2560_CSR1, RT2560_HOST_READY); if (rt2560_bbp_init(sc) != 0) { - rt2560_stop(sc); - RAL_UNLOCK(sc); + rt2560_stop_locked(sc); return; } From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 16:52:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94939106564A; Tue, 12 Oct 2010 16:52:13 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 822528FC17; Tue, 12 Oct 2010 16:52:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CGqDjZ054009; Tue, 12 Oct 2010 16:52:13 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CGqDWd054006; Tue, 12 Oct 2010 16:52:13 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201010121652.o9CGqDWd054006@svn.freebsd.org> From: Bernhard Schmidt Date: Tue, 12 Oct 2010 16:52:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213729 - head/sys/dev/iwi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 16:52:13 -0000 Author: bschmidt Date: Tue Oct 12 16:52:13 2010 New Revision: 213729 URL: http://svn.freebsd.org/changeset/base/213729 Log: Fix monitor mode which is implemented by doing a firmware scan. This is a port of stable/6, seems like the code got lost during the background scan changes in r170530. Pointed out by: danfe MFC after: 2 weeks Modified: head/sys/dev/iwi/if_iwi.c head/sys/dev/iwi/if_iwivar.h Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Tue Oct 12 16:23:50 2010 (r213728) +++ head/sys/dev/iwi/if_iwi.c Tue Oct 12 16:52:13 2010 (r213729) @@ -180,6 +180,7 @@ static void iwi_release_fw_dma(struct iw static int iwi_config(struct iwi_softc *); static int iwi_get_firmware(struct iwi_softc *, enum ieee80211_opmode); static void iwi_put_firmware(struct iwi_softc *); +static void iwi_monitor_scan(void *, int); static int iwi_scanchan(struct iwi_softc *, unsigned long, int); static void iwi_scan_start(struct ieee80211com *); static void iwi_scan_end(struct ieee80211com *); @@ -292,6 +293,7 @@ iwi_attach(device_t dev) TASK_INIT(&sc->sc_restarttask, 0, iwi_restart, sc); TASK_INIT(&sc->sc_disassoctask, 0, iwi_disassoc, sc); TASK_INIT(&sc->sc_wmetask, 0, iwi_update_wme, sc); + TASK_INIT(&sc->sc_monitortask, 0, iwi_monitor_scan, sc); callout_init_mtx(&sc->sc_wdtimer, &sc->sc_mtx, 0); callout_init_mtx(&sc->sc_rftimer, &sc->sc_mtx, 0); @@ -460,6 +462,7 @@ iwi_detach(device_t dev) ieee80211_draintask(ic, &sc->sc_radiofftask); ieee80211_draintask(ic, &sc->sc_restarttask); ieee80211_draintask(ic, &sc->sc_disassoctask); + ieee80211_draintask(ic, &sc->sc_monitortask); iwi_stop(sc); @@ -988,7 +991,8 @@ iwi_newstate(struct ieee80211vap *vap, e * This is all totally bogus and needs to be redone. */ iwi_auth_and_assoc(sc, vap); - } + } else if (vap->iv_opmode == IEEE80211_M_MONITOR) + ieee80211_runtask(ic, &sc->sc_monitortask); break; case IEEE80211_S_ASSOC: /* @@ -1407,6 +1411,18 @@ iwi_notification_intr(struct iwi_softc * IWI_STATE_END(sc, IWI_FW_SCANNING); + /* + * Monitor mode works by doing a passive scan to set + * the channel and enable rx. Because we don't want + * to abort a scan lest the firmware crash we scan + * for a short period of time and automatically restart + * the scan when notified the sweep has completed. + */ + if (vap->iv_opmode == IEEE80211_M_MONITOR) { + ieee80211_runtask(ic, &sc->sc_monitortask); + break; + } + if (scan->status == IWI_SCAN_COMPLETED) { /* NB: don't need to defer, net80211 does it for us */ ieee80211_scan_next(vap); @@ -2557,6 +2573,11 @@ iwi_config(struct iwi_softc *sc) config.answer_pbreq = (ic->ic_opmode == IEEE80211_M_IBSS) ? 1 : 0; config.disable_unicast_decryption = 1; config.disable_multicast_decryption = 1; + if (ic->ic_opmode == IEEE80211_M_MONITOR) { + config.allow_invalid_frames = 1; + config.allow_beacon_and_probe_resp = 1; + config.allow_mgt = 1; + } DPRINTF(("Configuring adapter\n")); error = iwi_cmd(sc, IWI_CMD_SET_CONFIG, &config, sizeof config); if (error != 0) @@ -2642,6 +2663,17 @@ scan_band(const struct ieee80211_channel return IEEE80211_IS_CHAN_5GHZ(c) ? IWI_CHAN_5GHZ : IWI_CHAN_2GHZ; } +static void +iwi_monitor_scan(void *arg, int npending) +{ + struct iwi_softc *sc = arg; + IWI_LOCK_DECL; + + IWI_LOCK(sc); + (void) iwi_scanchan(sc, 2000, 0); + IWI_UNLOCK(sc); +} + /* * Start a scan on the current channel or all channels. */ Modified: head/sys/dev/iwi/if_iwivar.h ============================================================================== --- head/sys/dev/iwi/if_iwivar.h Tue Oct 12 16:23:50 2010 (r213728) +++ head/sys/dev/iwi/if_iwivar.h Tue Oct 12 16:52:13 2010 (r213729) @@ -193,6 +193,7 @@ struct iwi_softc { struct task sc_restarttask; /* restart adapter processing */ struct task sc_disassoctask; struct task sc_wmetask; /* set wme parameters */ + struct task sc_monitortask; unsigned int sc_softled : 1, /* enable LED gpio status */ sc_ledstate: 1, /* LED on/off state */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 17:04:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6ADBA1065694; Tue, 12 Oct 2010 17:04:22 +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 3E9CD8FC0C; Tue, 12 Oct 2010 17:04:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CH4M73054349; Tue, 12 Oct 2010 17:04:22 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CH4Mde054347; Tue, 12 Oct 2010 17:04:22 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010121704.o9CH4Mde054347@svn.freebsd.org> From: Andriy Gapon Date: Tue, 12 Oct 2010 17:04:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213730 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 17:04:22 -0000 Author: avg Date: Tue Oct 12 17:04:21 2010 New Revision: 213730 URL: http://svn.freebsd.org/changeset/base/213730 Log: zfs + sendfile: do not produce partially valid pages for vnode's tail Since r212650 and before this change sendfile(2) could produce a partially valid page for a trailing portion of a ZFS vnode. vm_fault() always wants to see a fully valid page even if it's the last page that partially extends beyond vnode's end. Otherwise it calls vop_getpages() to bring in the page. In the case of ZFS this means that the data is read from the page into the same page and this breaks checks in ZFS mappedread() - a thread that set VPO_BUSY on the page in vm_fault() will get blocked forever waiting for it to be cleared. Many thanks to Kai and Jeremy for reproducing the issue and providing important debugging information and help. Reported by: Kai Gallasch , Jeremy Chadwick Tested by: Kai Gallasch , Jeremy Chadwick Reviewed by: kib MFC after: 3 days To-Do: apply the same treatment to tmpfs + sendfile Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Oct 12 16:52:13 2010 (r213729) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Oct 12 17:04:21 2010 (r213730) @@ -489,6 +489,8 @@ again: * but it pessimize performance of sendfile/UFS, that's * why I handle this special case in ZFS code. */ + KASSERT(off == 0, + ("unexpected offset in mappedread for sendfile")); if ((m->oflags & VPO_BUSY) != 0) { /* * Reference the page before unlocking and @@ -509,14 +511,15 @@ again: } if (error == 0) { va = zfs_map_page(m, &sf); - error = dmu_read(os, zp->z_id, start + off, - bytes, (void *)(va + off), + error = dmu_read(os, zp->z_id, start, bytes, va, DMU_READ_PREFETCH); + if (bytes != PAGE_SIZE) + bzero(va + bytes, PAGE_SIZE - bytes); zfs_unmap_page(sf); } VM_OBJECT_LOCK(obj); if (error == 0) - vm_page_set_valid(m, off, bytes); + m->valid = VM_PAGE_BITS_ALL; vm_page_wakeup(m); if (error == 0) { uio->uio_resid -= bytes; From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 17:09:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38DAE1065672; Tue, 12 Oct 2010 17:09:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26A1A8FC15; Tue, 12 Oct 2010 17:09:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CH9Y1r054514; Tue, 12 Oct 2010 17:09:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CH9YOf054512; Tue, 12 Oct 2010 17:09:34 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121709.o9CH9YOf054512@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 17:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213731 - stable/7/contrib/csup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 17:09:34 -0000 Author: jhb Date: Tue Oct 12 17:09:33 2010 New Revision: 213731 URL: http://svn.freebsd.org/changeset/base/213731 Log: MFC 194070: Remove semicolon that should not have been there. Modified: stable/7/contrib/csup/rcsfile.c Directory Properties: stable/7/contrib/csup/ (props changed) Modified: stable/7/contrib/csup/rcsfile.c ============================================================================== --- stable/7/contrib/csup/rcsfile.c Tue Oct 12 17:04:21 2010 (r213730) +++ stable/7/contrib/csup/rcsfile.c Tue Oct 12 17:09:33 2010 (r213731) @@ -730,7 +730,7 @@ rcsfile_print(struct rcsfile *rf) lprintf(1, "Strict!\n"); if (rf->comment != NULL) lprintf(1, "comment: '%s'\n", rf->comment); - if (rf->expand != EXPAND_DEFAULT); + if (rf->expand != EXPAND_DEFAULT) lprintf(1, "expand: '%s'\n", keyword_encode_expand(rf->expand)); /* Print all deltas. */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 17:12:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 575841065670; Tue, 12 Oct 2010 17:12:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 451DD8FC1C; Tue, 12 Oct 2010 17:12:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CHCDrm054635; Tue, 12 Oct 2010 17:12:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CHCDV9054633; Tue, 12 Oct 2010 17:12:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121712.o9CHCDV9054633@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 17:12: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: r213732 - stable/8/contrib/csup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 17:12:13 -0000 Author: jhb Date: Tue Oct 12 17:12:13 2010 New Revision: 213732 URL: http://svn.freebsd.org/changeset/base/213732 Log: MFC 213300: If an RCS file is truncated, rcsfile_getdelta() will return NULL. Instead of faulting, check for NULL. However, returning an error would cause csup to just abort the entire update. Instead, break out of the loop and return ok. The attempts to update the file will trigger a MD5 failure which will cause csup to download the entire file as a fixup. Modified: stable/8/contrib/csup/rcsparse.c Directory Properties: stable/8/contrib/csup/ (props changed) Modified: stable/8/contrib/csup/rcsparse.c ============================================================================== --- stable/8/contrib/csup/rcsparse.c Tue Oct 12 17:09:33 2010 (r213731) +++ stable/8/contrib/csup/rcsparse.c Tue Oct 12 17:12:13 2010 (r213732) @@ -318,6 +318,14 @@ parse_deltatexts(struct rcsfile *rf, yys d = rcsfile_getdelta(rf, revnum); free(revnum); + /* + * XXX: The RCS file is corrupt, but lie and say it is ok. + * If it is actually broken, then the MD5 mismatch will + * trigger a fixup. + */ + if (d == NULL) + return (0); + /* log string */ asserttoken(sp, KEYWORD); asserttoken(sp, STRING); From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 17:12:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0C0510656A9; Tue, 12 Oct 2010 17:12:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEA308FC3F; Tue, 12 Oct 2010 17:12:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CHCMQD054674; Tue, 12 Oct 2010 17:12:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CHCMHs054672; Tue, 12 Oct 2010 17:12:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121712.o9CHCMHs054672@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 17:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213733 - stable/7/contrib/csup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 17:12:23 -0000 Author: jhb Date: Tue Oct 12 17:12:22 2010 New Revision: 213733 URL: http://svn.freebsd.org/changeset/base/213733 Log: MFC 213300: If an RCS file is truncated, rcsfile_getdelta() will return NULL. Instead of faulting, check for NULL. However, returning an error would cause csup to just abort the entire update. Instead, break out of the loop and return ok. The attempts to update the file will trigger a MD5 failure which will cause csup to download the entire file as a fixup. Modified: stable/7/contrib/csup/rcsparse.c Directory Properties: stable/7/contrib/csup/ (props changed) Modified: stable/7/contrib/csup/rcsparse.c ============================================================================== --- stable/7/contrib/csup/rcsparse.c Tue Oct 12 17:12:13 2010 (r213732) +++ stable/7/contrib/csup/rcsparse.c Tue Oct 12 17:12:22 2010 (r213733) @@ -318,6 +318,14 @@ parse_deltatexts(struct rcsfile *rf, yys d = rcsfile_getdelta(rf, revnum); free(revnum); + /* + * XXX: The RCS file is corrupt, but lie and say it is ok. + * If it is actually broken, then the MD5 mismatch will + * trigger a fixup. + */ + if (d == NULL) + return (0); + /* log string */ asserttoken(sp, KEYWORD); asserttoken(sp, STRING); From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 17:12:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B11C1065698; Tue, 12 Oct 2010 17:12:35 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88C938FC4D; Tue, 12 Oct 2010 17:12:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CHCZx2054715; Tue, 12 Oct 2010 17:12:35 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CHCZKK054713; Tue, 12 Oct 2010 17:12:35 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201010121712.o9CHCZKK054713@svn.freebsd.org> From: Bernhard Schmidt Date: Tue, 12 Oct 2010 17:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213734 - stable/7/sys/dev/iwi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 17:12:35 -0000 Author: bschmidt Date: Tue Oct 12 17:12:35 2010 New Revision: 213734 URL: http://svn.freebsd.org/changeset/base/213734 Log: When bringing the interface down we clear the command queue but do not reset the sc_cmd_cur and sc_cmd_next indices. If there are still pending commands while clearing the queue those two indices are off by at least one. This leads to no commands being sent to the firmware until the queue overruns. Fix this by also resetting the indices. This is a direct commit as the code does not exist in head. Modified: stable/7/sys/dev/iwi/if_iwi.c Modified: stable/7/sys/dev/iwi/if_iwi.c ============================================================================== --- stable/7/sys/dev/iwi/if_iwi.c Tue Oct 12 17:12:22 2010 (r213733) +++ stable/7/sys/dev/iwi/if_iwi.c Tue Oct 12 17:12:35 2010 (r213734) @@ -3267,6 +3267,7 @@ iwi_stop(void *priv) ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); memset(sc->sc_cmd, 0, sizeof(sc->sc_cmd)); + sc->sc_cmd_cur = sc->sc_cmd_next = 0; sc->sc_tx_timer = 0; sc->sc_rfkill_timer = 0; sc->sc_state_timer = 0; From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 17:16:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BD9A106566C; Tue, 12 Oct 2010 17:16:51 +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 8A6648FC1B; Tue, 12 Oct 2010 17:16:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CHGpPe054835; Tue, 12 Oct 2010 17:16:51 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CHGp9W054833; Tue, 12 Oct 2010 17:16:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010121716.o9CHGp9W054833@svn.freebsd.org> From: Andriy Gapon Date: Tue, 12 Oct 2010 17:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213735 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 17:16:51 -0000 Author: avg Date: Tue Oct 12 17:16:51 2010 New Revision: 213735 URL: http://svn.freebsd.org/changeset/base/213735 Log: tmpfs + sendfile: do not produce partially valid pages for vnode's tail See r213730 for details of analogous change in ZFS. MFC after: 3 days Modified: head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Tue Oct 12 17:12:35 2010 (r213734) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Tue Oct 12 17:16:51 2010 (r213735) @@ -538,6 +538,8 @@ lookupvpg: VM_OBJECT_UNLOCK(vobj); return (error); } else if (m != NULL && uio->uio_segflg == UIO_NOCOPY) { + KASSERT(offset == 0, + ("unexpected offset in tmpfs_mappedread for sendfile")); if ((m->oflags & VPO_BUSY) != 0) { /* * Reference the page before unlocking and sleeping so @@ -553,9 +555,10 @@ lookupvpg: sched_pin(); sf = sf_buf_alloc(m, SFB_CPUPRIVATE); ma = (char *)sf_buf_kva(sf); - error = tmpfs_nocacheread_buf(tobj, idx, offset, tlen, - ma + offset); + error = tmpfs_nocacheread_buf(tobj, idx, 0, tlen, ma); if (error == 0) { + if (tlen != PAGE_SIZE) + bzero(ma + tlen, PAGE_SIZE - tlen); uio->uio_offset += tlen; uio->uio_resid -= tlen; } @@ -563,7 +566,7 @@ lookupvpg: sched_unpin(); VM_OBJECT_LOCK(vobj); if (error == 0) - vm_page_set_valid(m, offset, tlen); + m->valid = VM_PAGE_BITS_ALL; vm_page_wakeup(m); VM_OBJECT_UNLOCK(vobj); return (error); From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 17:40:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81EC2106564A; Tue, 12 Oct 2010 17:40: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 64C508FC15; Tue, 12 Oct 2010 17:40:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CHejDA055342; Tue, 12 Oct 2010 17:40:45 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CHejUr055340; Tue, 12 Oct 2010 17:40:45 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010121740.o9CHejUr055340@svn.freebsd.org> From: Andriy Gapon Date: Tue, 12 Oct 2010 17:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213736 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 17:40:45 -0000 Author: avg Date: Tue Oct 12 17:40:45 2010 New Revision: 213736 URL: http://svn.freebsd.org/changeset/base/213736 Log: generic_stop_cpus: prevent parallel execution This is based on the same approach as used in panic(). In theory parallel execution of generic_stop_cpus() could lead to two CPUs stopping each other and everyone else, and thus a total system halt. Also, in theory, we should have some smarter locking here, because two (or more CPUs) could be stopping unrelated sets of CPUs. But in practice, it seems, this function is only used to stop "all other" CPUs. Additionally, I took this opportunity to make amd64-specific suspend_cpus() function use generic_stop_cpus() instead of rolling out essentially duplicate code. This code is based on code by Sandvine Incorporated. Suggested by: mdf Reviewed by: jhb, jkim (earlier version) MFC after: 2 weeks Modified: head/sys/kern/subr_smp.c Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Tue Oct 12 17:16:51 2010 (r213735) +++ head/sys/kern/subr_smp.c Tue Oct 12 17:40:45 2010 (r213736) @@ -198,22 +198,32 @@ forward_signal(struct thread *td) * 0: NA * 1: ok * - * XXX FIXME: this is not MP-safe, needs a lock to prevent multiple CPUs - * from executing at same time. */ static int generic_stop_cpus(cpumask_t map, u_int type) { + static volatile u_int stopping_cpu = NOCPU; int i; - KASSERT(type == IPI_STOP || type == IPI_STOP_HARD, + KASSERT( +#if defined(__amd64__) + type == IPI_STOP || type == IPI_STOP_HARD || type == IPI_SUSPEND, +#else + type == IPI_STOP || type == IPI_STOP_HARD, +#endif ("%s: invalid stop type", __func__)); if (!smp_started) - return 0; + return (0); CTR2(KTR_SMP, "stop_cpus(%x) with %u type", map, type); + if (stopping_cpu != PCPU_GET(cpuid)) + while (atomic_cmpset_int(&stopping_cpu, NOCPU, + PCPU_GET(cpuid)) == 0) + while (stopping_cpu != NOCPU) + cpu_spinwait(); /* spin */ + /* send the stop IPI to all CPUs in map */ ipi_selected(map, type); @@ -230,7 +240,8 @@ generic_stop_cpus(cpumask_t map, u_int t #endif } - return 1; + stopping_cpu = NOCPU; + return (1); } int @@ -248,50 +259,11 @@ stop_cpus_hard(cpumask_t map) } #if defined(__amd64__) -/* - * When called the executing CPU will send an IPI to all other CPUs - * requesting that they halt execution. - * - * Usually (but not necessarily) called with 'other_cpus' as its arg. - * - * - Signals all CPUs in map to suspend. - * - Waits for each to suspend. - * - * Returns: - * -1: error - * 0: NA - * 1: ok - * - * XXX FIXME: this is not MP-safe, needs a lock to prevent multiple CPUs - * from executing at same time. - */ int suspend_cpus(cpumask_t map) { - int i; - if (!smp_started) - return (0); - - CTR1(KTR_SMP, "suspend_cpus(%x)", map); - - /* send the suspend IPI to all CPUs in map */ - ipi_selected(map, IPI_SUSPEND); - - i = 0; - while ((stopped_cpus & map) != map) { - /* spin */ - cpu_spinwait(); - i++; -#ifdef DIAGNOSTIC - if (i == 100000) { - printf("timeout suspending cpus\n"); - break; - } -#endif - } - - return (1); + return (generic_stop_cpus(map, IPI_SUSPEND)); } #endif From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 17:53:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16AE4106566C; Tue, 12 Oct 2010 17:53:02 +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 043738FC1C; Tue, 12 Oct 2010 17:53:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CHr1iD055609; Tue, 12 Oct 2010 17:53:01 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CHr1X3055607; Tue, 12 Oct 2010 17:53:01 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010121753.o9CHr1X3055607@svn.freebsd.org> From: Andriy Gapon Date: Tue, 12 Oct 2010 17:53:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213737 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 17:53:02 -0000 Author: avg Date: Tue Oct 12 17:53:01 2010 New Revision: 213737 URL: http://svn.freebsd.org/changeset/base/213737 Log: acpi_ec: changes in communication with hardware Short description of the changes: - attempt to retry some commands for which it is possible (read, query) - always make a short sleep before checking EC status in polled mode - periodically poll EC status in interrupt mode - change logic for detecting broken interrupt delivery and falling back to polled mode - check that EC is ready for input before starting a new command, wait if necessary This commit is based on the original patch by David Naylor. PR: kern/150517 Submitted by: David Naylor Reviewed by: jkim MFC after: 3 weeks Modified: head/sys/dev/acpica/acpi_ec.c Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Tue Oct 12 17:40:45 2010 (r213736) +++ head/sys/dev/acpica/acpi_ec.c Tue Oct 12 17:53:01 2010 (r213737) @@ -153,7 +153,7 @@ struct acpi_ec_softc { int ec_glkhandle; int ec_burstactive; int ec_sci_pend; - u_int ec_gencount; + volatile u_int ec_gencount; int ec_suspending; }; @@ -165,7 +165,7 @@ struct acpi_ec_softc { #define EC_LOCK_TIMEOUT 1000 /* Default delay in microseconds between each run of the status polling loop. */ -#define EC_POLL_DELAY 5 +#define EC_POLL_DELAY 50 /* Total time in ms spent waiting for a response from EC. */ #define EC_TIMEOUT 750 @@ -599,12 +599,32 @@ acpi_ec_write_method(device_t dev, u_int return (0); } +static ACPI_STATUS +EcCheckStatus(struct acpi_ec_softc *sc, const char *msg, EC_EVENT event) +{ + ACPI_STATUS status; + EC_STATUS ec_status; + + status = AE_NO_HARDWARE_RESPONSE; + ec_status = EC_GET_CSR(sc); + if (sc->ec_burstactive && !(ec_status & EC_FLAG_BURST_MODE)) { + CTR1(KTR_ACPI, "ec burst disabled in waitevent (%s)", msg); + sc->ec_burstactive = FALSE; + } + if (EVENT_READY(event, ec_status)) { + CTR2(KTR_ACPI, "ec %s wait ready, status %#x", msg, ec_status); + status = AE_OK; + } + return (status); +} + static void EcGpeQueryHandler(void *Context) { struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; UINT8 Data; ACPI_STATUS Status; + int retry; char qxx[5]; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -625,7 +645,16 @@ EcGpeQueryHandler(void *Context) * that may arise from running the query from causing another query * to be queued, we clear the pending flag only after running it. */ - Status = EcCommand(sc, EC_COMMAND_QUERY); + for (retry = 0; retry < 2; retry++) { + Status = EcCommand(sc, EC_COMMAND_QUERY); + if (ACPI_SUCCESS(Status)) + break; + if (EcCheckStatus(sc, "retr_check", + EC_EVENT_INPUT_BUFFER_EMPTY) == AE_OK) + continue; + else + break; + } sc->ec_sci_pend = FALSE; if (ACPI_FAILURE(Status)) { EcUnlock(sc); @@ -678,7 +707,7 @@ EcGpeHandler(void *Context) * address and then data values.) */ atomic_add_int(&sc->ec_gencount, 1); - wakeup(&sc->ec_gencount); + wakeup(&sc); /* * If the EC_SCI bit of the status register is set, queue a query handler. @@ -789,68 +818,27 @@ EcSpaceHandler(UINT32 Function, ACPI_PHY } static ACPI_STATUS -EcCheckStatus(struct acpi_ec_softc *sc, const char *msg, EC_EVENT event) -{ - ACPI_STATUS status; - EC_STATUS ec_status; - - status = AE_NO_HARDWARE_RESPONSE; - ec_status = EC_GET_CSR(sc); - if (sc->ec_burstactive && !(ec_status & EC_FLAG_BURST_MODE)) { - CTR1(KTR_ACPI, "ec burst disabled in waitevent (%s)", msg); - sc->ec_burstactive = FALSE; - } - if (EVENT_READY(event, ec_status)) { - CTR2(KTR_ACPI, "ec %s wait ready, status %#x", msg, ec_status); - status = AE_OK; - } - return (status); -} - -static ACPI_STATUS EcWaitEvent(struct acpi_ec_softc *sc, EC_EVENT Event, u_int gen_count) { + static int no_intr = 0; ACPI_STATUS Status; - int count, i, slp_ival; + int count, i, need_poll, slp_ival; ACPI_SERIAL_ASSERT(ec); Status = AE_NO_HARDWARE_RESPONSE; - int need_poll = cold || rebooting || ec_polled_mode || sc->ec_suspending; - /* - * The main CPU should be much faster than the EC. So the status should - * be "not ready" when we start waiting. But if the main CPU is really - * slow, it's possible we see the current "ready" response. Since that - * can't be distinguished from the previous response in polled mode, - * this is a potential issue. We really should have interrupts enabled - * during boot so there is no ambiguity in polled mode. - * - * If this occurs, we add an additional delay before actually entering - * the status checking loop, hopefully to allow the EC to go to work - * and produce a non-stale status. - */ - if (need_poll) { - static int once; - - if (EcCheckStatus(sc, "pre-check", Event) == AE_OK) { - if (!once) { - device_printf(sc->ec_dev, - "warning: EC done before starting event wait\n"); - once = 1; - } - AcpiOsStall(10); - } - } + need_poll = cold || rebooting || ec_polled_mode || sc->ec_suspending; /* Wait for event by polling or GPE (interrupt). */ if (need_poll) { count = (ec_timeout * 1000) / EC_POLL_DELAY; if (count == 0) count = 1; + DELAY(10); for (i = 0; i < count; i++) { Status = EcCheckStatus(sc, "poll", Event); if (Status == AE_OK) break; - AcpiOsStall(EC_POLL_DELAY); + DELAY(EC_POLL_DELAY); } } else { slp_ival = hz / 1000; @@ -869,34 +857,37 @@ EcWaitEvent(struct acpi_ec_softc *sc, EC * EC query). */ for (i = 0; i < count; i++) { - if (gen_count != sc->ec_gencount) { - /* - * Record new generation count. It's possible the GPE was - * just to notify us that a query is needed and we need to - * wait for a second GPE to signal the completion of the - * event we are actually waiting for. - */ - gen_count = sc->ec_gencount; - Status = EcCheckStatus(sc, "sleep", Event); - if (Status == AE_OK) - break; + if (gen_count == sc->ec_gencount) + tsleep(&sc, 0, "ecgpe", slp_ival); + /* + * Record new generation count. It's possible the GPE was + * just to notify us that a query is needed and we need to + * wait for a second GPE to signal the completion of the + * event we are actually waiting for. + */ + Status = EcCheckStatus(sc, "sleep", Event); + if (Status == AE_OK) { + if (gen_count == sc->ec_gencount) + no_intr++; + else + no_intr = 0; + break; } - tsleep(&sc->ec_gencount, PZERO, "ecgpe", slp_ival); + gen_count = sc->ec_gencount; } /* * We finished waiting for the GPE and it never arrived. Try to * read the register once and trust whatever value we got. This is - * the best we can do at this point. Then, force polled mode on - * since this system doesn't appear to generate GPEs. + * the best we can do at this point. */ - if (Status != AE_OK) { + if (Status != AE_OK) Status = EcCheckStatus(sc, "sleep_end", Event); - device_printf(sc->ec_dev, - "wait timed out (%sresponse), forcing polled mode\n", - Status == AE_OK ? "" : "no "); - ec_polled_mode = TRUE; - } + } + if (!need_poll && no_intr > 10) { + device_printf(sc->ec_dev, + "not getting interrupts, switched to polled mode\n"); + ec_polled_mode = 1; } if (Status != AE_OK) CTR0(KTR_ACPI, "error: ec wait timed out"); @@ -933,6 +924,14 @@ EcCommand(struct acpi_ec_softc *sc, EC_C return (AE_BAD_PARAMETER); } + /* + * Ensure empty input buffer before issuing command. + * Use generation count of zero to force a quick check. + */ + status = EcWaitEvent(sc, EC_EVENT_INPUT_BUFFER_EMPTY, 0); + if (ACPI_FAILURE(status)) + return (status); + /* Run the command and wait for the chosen event. */ CTR1(KTR_ACPI, "ec running command %#x", cmd); gen_count = sc->ec_gencount; @@ -955,24 +954,31 @@ EcRead(struct acpi_ec_softc *sc, UINT8 A { ACPI_STATUS status; u_int gen_count; + int retry; ACPI_SERIAL_ASSERT(ec); CTR1(KTR_ACPI, "ec read from %#x", Address); - status = EcCommand(sc, EC_COMMAND_READ); - if (ACPI_FAILURE(status)) - return (status); + for (retry = 0; retry < 2; retry++) { + status = EcCommand(sc, EC_COMMAND_READ); + if (ACPI_FAILURE(status)) + return (status); - gen_count = sc->ec_gencount; - EC_SET_DATA(sc, Address); - status = EcWaitEvent(sc, EC_EVENT_OUTPUT_BUFFER_FULL, gen_count); - if (ACPI_FAILURE(status)) { - device_printf(sc->ec_dev, "EcRead: failed waiting to get data\n"); - return (status); + gen_count = sc->ec_gencount; + EC_SET_DATA(sc, Address); + status = EcWaitEvent(sc, EC_EVENT_OUTPUT_BUFFER_FULL, gen_count); + if (ACPI_FAILURE(status)) { + if (EcCheckStatus(sc, "retr_check", + EC_EVENT_INPUT_BUFFER_EMPTY) == AE_OK) + continue; + else + break; + } + *Data = EC_GET_DATA(sc); + return (AE_OK); } - *Data = EC_GET_DATA(sc); - - return (AE_OK); + device_printf(sc->ec_dev, "EcRead: failed waiting to get data\n"); + return (status); } static ACPI_STATUS @@ -992,7 +998,7 @@ EcWrite(struct acpi_ec_softc *sc, UINT8 EC_SET_DATA(sc, Address); status = EcWaitEvent(sc, EC_EVENT_INPUT_BUFFER_EMPTY, gen_count); if (ACPI_FAILURE(status)) { - device_printf(sc->ec_dev, "EcRead: failed waiting for sent address\n"); + device_printf(sc->ec_dev, "EcWrite: failed waiting for sent address\n"); return (status); } From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 17:56:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3A06106566B; Tue, 12 Oct 2010 17:56:58 +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 84CB08FC13; Tue, 12 Oct 2010 17:56:57 +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 UAA23734; Tue, 12 Oct 2010 20:56:56 +0300 (EEST) (envelope-from avg@freebsd.org) Message-ID: <4CB4A167.5010105@freebsd.org> Date: Tue, 12 Oct 2010 20:56:55 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20100920 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201010121753.o9CHr1X3055607@svn.freebsd.org> In-Reply-To: <201010121753.o9CHr1X3055607@svn.freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r213737 - head/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 17:56:58 -0000 on 12/10/2010 20:53 Andriy Gapon said the following: > Author: avg > Date: Tue Oct 12 17:53:01 2010 > New Revision: 213737 > URL: http://svn.freebsd.org/changeset/base/213737 > > Log: > acpi_ec: changes in communication with hardware > > Short description of the changes: > - attempt to retry some commands for which it is possible (read, query) > - always make a short sleep before checking EC status in polled mode > - periodically poll EC status in interrupt mode > - change logic for detecting broken interrupt delivery and falling back > to polled mode > - check that EC is ready for input before starting a new command, wait > if necessary > > This commit is based on the original patch by David Naylor. > > PR: kern/150517 > Submitted by: David Naylor There also should have been: Tested by: David Naylor , kuba guzik , Nicolas > Reviewed by: jkim > MFC after: 3 weeks > > Modified: > head/sys/dev/acpica/acpi_ec.c > > Modified: head/sys/dev/acpica/acpi_ec.c > ============================================================================== > --- head/sys/dev/acpica/acpi_ec.c Tue Oct 12 17:40:45 2010 (r213736) > +++ head/sys/dev/acpica/acpi_ec.c Tue Oct 12 17:53:01 2010 (r213737) > @@ -153,7 +153,7 @@ struct acpi_ec_softc { > int ec_glkhandle; > int ec_burstactive; > int ec_sci_pend; > - u_int ec_gencount; > + volatile u_int ec_gencount; > int ec_suspending; > }; > > @@ -165,7 +165,7 @@ struct acpi_ec_softc { > #define EC_LOCK_TIMEOUT 1000 > > /* Default delay in microseconds between each run of the status polling loop. */ > -#define EC_POLL_DELAY 5 > +#define EC_POLL_DELAY 50 > > /* Total time in ms spent waiting for a response from EC. */ > #define EC_TIMEOUT 750 > @@ -599,12 +599,32 @@ acpi_ec_write_method(device_t dev, u_int > return (0); > } > > +static ACPI_STATUS > +EcCheckStatus(struct acpi_ec_softc *sc, const char *msg, EC_EVENT event) > +{ > + ACPI_STATUS status; > + EC_STATUS ec_status; > + > + status = AE_NO_HARDWARE_RESPONSE; > + ec_status = EC_GET_CSR(sc); > + if (sc->ec_burstactive && !(ec_status & EC_FLAG_BURST_MODE)) { > + CTR1(KTR_ACPI, "ec burst disabled in waitevent (%s)", msg); > + sc->ec_burstactive = FALSE; > + } > + if (EVENT_READY(event, ec_status)) { > + CTR2(KTR_ACPI, "ec %s wait ready, status %#x", msg, ec_status); > + status = AE_OK; > + } > + return (status); > +} > + > static void > EcGpeQueryHandler(void *Context) > { > struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; > UINT8 Data; > ACPI_STATUS Status; > + int retry; > char qxx[5]; > > ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); > @@ -625,7 +645,16 @@ EcGpeQueryHandler(void *Context) > * that may arise from running the query from causing another query > * to be queued, we clear the pending flag only after running it. > */ > - Status = EcCommand(sc, EC_COMMAND_QUERY); > + for (retry = 0; retry < 2; retry++) { > + Status = EcCommand(sc, EC_COMMAND_QUERY); > + if (ACPI_SUCCESS(Status)) > + break; > + if (EcCheckStatus(sc, "retr_check", > + EC_EVENT_INPUT_BUFFER_EMPTY) == AE_OK) > + continue; > + else > + break; > + } > sc->ec_sci_pend = FALSE; > if (ACPI_FAILURE(Status)) { > EcUnlock(sc); > @@ -678,7 +707,7 @@ EcGpeHandler(void *Context) > * address and then data values.) > */ > atomic_add_int(&sc->ec_gencount, 1); > - wakeup(&sc->ec_gencount); > + wakeup(&sc); > > /* > * If the EC_SCI bit of the status register is set, queue a query handler. > @@ -789,68 +818,27 @@ EcSpaceHandler(UINT32 Function, ACPI_PHY > } > > static ACPI_STATUS > -EcCheckStatus(struct acpi_ec_softc *sc, const char *msg, EC_EVENT event) > -{ > - ACPI_STATUS status; > - EC_STATUS ec_status; > - > - status = AE_NO_HARDWARE_RESPONSE; > - ec_status = EC_GET_CSR(sc); > - if (sc->ec_burstactive && !(ec_status & EC_FLAG_BURST_MODE)) { > - CTR1(KTR_ACPI, "ec burst disabled in waitevent (%s)", msg); > - sc->ec_burstactive = FALSE; > - } > - if (EVENT_READY(event, ec_status)) { > - CTR2(KTR_ACPI, "ec %s wait ready, status %#x", msg, ec_status); > - status = AE_OK; > - } > - return (status); > -} > - > -static ACPI_STATUS > EcWaitEvent(struct acpi_ec_softc *sc, EC_EVENT Event, u_int gen_count) > { > + static int no_intr = 0; > ACPI_STATUS Status; > - int count, i, slp_ival; > + int count, i, need_poll, slp_ival; > > ACPI_SERIAL_ASSERT(ec); > Status = AE_NO_HARDWARE_RESPONSE; > - int need_poll = cold || rebooting || ec_polled_mode || sc->ec_suspending; > - /* > - * The main CPU should be much faster than the EC. So the status should > - * be "not ready" when we start waiting. But if the main CPU is really > - * slow, it's possible we see the current "ready" response. Since that > - * can't be distinguished from the previous response in polled mode, > - * this is a potential issue. We really should have interrupts enabled > - * during boot so there is no ambiguity in polled mode. > - * > - * If this occurs, we add an additional delay before actually entering > - * the status checking loop, hopefully to allow the EC to go to work > - * and produce a non-stale status. > - */ > - if (need_poll) { > - static int once; > - > - if (EcCheckStatus(sc, "pre-check", Event) == AE_OK) { > - if (!once) { > - device_printf(sc->ec_dev, > - "warning: EC done before starting event wait\n"); > - once = 1; > - } > - AcpiOsStall(10); > - } > - } > + need_poll = cold || rebooting || ec_polled_mode || sc->ec_suspending; > > /* Wait for event by polling or GPE (interrupt). */ > if (need_poll) { > count = (ec_timeout * 1000) / EC_POLL_DELAY; > if (count == 0) > count = 1; > + DELAY(10); > for (i = 0; i < count; i++) { > Status = EcCheckStatus(sc, "poll", Event); > if (Status == AE_OK) > break; > - AcpiOsStall(EC_POLL_DELAY); > + DELAY(EC_POLL_DELAY); > } > } else { > slp_ival = hz / 1000; > @@ -869,34 +857,37 @@ EcWaitEvent(struct acpi_ec_softc *sc, EC > * EC query). > */ > for (i = 0; i < count; i++) { > - if (gen_count != sc->ec_gencount) { > - /* > - * Record new generation count. It's possible the GPE was > - * just to notify us that a query is needed and we need to > - * wait for a second GPE to signal the completion of the > - * event we are actually waiting for. > - */ > - gen_count = sc->ec_gencount; > - Status = EcCheckStatus(sc, "sleep", Event); > - if (Status == AE_OK) > - break; > + if (gen_count == sc->ec_gencount) > + tsleep(&sc, 0, "ecgpe", slp_ival); > + /* > + * Record new generation count. It's possible the GPE was > + * just to notify us that a query is needed and we need to > + * wait for a second GPE to signal the completion of the > + * event we are actually waiting for. > + */ > + Status = EcCheckStatus(sc, "sleep", Event); > + if (Status == AE_OK) { > + if (gen_count == sc->ec_gencount) > + no_intr++; > + else > + no_intr = 0; > + break; > } > - tsleep(&sc->ec_gencount, PZERO, "ecgpe", slp_ival); > + gen_count = sc->ec_gencount; > } > > /* > * We finished waiting for the GPE and it never arrived. Try to > * read the register once and trust whatever value we got. This is > - * the best we can do at this point. Then, force polled mode on > - * since this system doesn't appear to generate GPEs. > + * the best we can do at this point. > */ > - if (Status != AE_OK) { > + if (Status != AE_OK) > Status = EcCheckStatus(sc, "sleep_end", Event); > - device_printf(sc->ec_dev, > - "wait timed out (%sresponse), forcing polled mode\n", > - Status == AE_OK ? "" : "no "); > - ec_polled_mode = TRUE; > - } > + } > + if (!need_poll && no_intr > 10) { > + device_printf(sc->ec_dev, > + "not getting interrupts, switched to polled mode\n"); > + ec_polled_mode = 1; > } > if (Status != AE_OK) > CTR0(KTR_ACPI, "error: ec wait timed out"); > @@ -933,6 +924,14 @@ EcCommand(struct acpi_ec_softc *sc, EC_C > return (AE_BAD_PARAMETER); > } > > + /* > + * Ensure empty input buffer before issuing command. > + * Use generation count of zero to force a quick check. > + */ > + status = EcWaitEvent(sc, EC_EVENT_INPUT_BUFFER_EMPTY, 0); > + if (ACPI_FAILURE(status)) > + return (status); > + > /* Run the command and wait for the chosen event. */ > CTR1(KTR_ACPI, "ec running command %#x", cmd); > gen_count = sc->ec_gencount; > @@ -955,24 +954,31 @@ EcRead(struct acpi_ec_softc *sc, UINT8 A > { > ACPI_STATUS status; > u_int gen_count; > + int retry; > > ACPI_SERIAL_ASSERT(ec); > CTR1(KTR_ACPI, "ec read from %#x", Address); > > - status = EcCommand(sc, EC_COMMAND_READ); > - if (ACPI_FAILURE(status)) > - return (status); > + for (retry = 0; retry < 2; retry++) { > + status = EcCommand(sc, EC_COMMAND_READ); > + if (ACPI_FAILURE(status)) > + return (status); > > - gen_count = sc->ec_gencount; > - EC_SET_DATA(sc, Address); > - status = EcWaitEvent(sc, EC_EVENT_OUTPUT_BUFFER_FULL, gen_count); > - if (ACPI_FAILURE(status)) { > - device_printf(sc->ec_dev, "EcRead: failed waiting to get data\n"); > - return (status); > + gen_count = sc->ec_gencount; > + EC_SET_DATA(sc, Address); > + status = EcWaitEvent(sc, EC_EVENT_OUTPUT_BUFFER_FULL, gen_count); > + if (ACPI_FAILURE(status)) { > + if (EcCheckStatus(sc, "retr_check", > + EC_EVENT_INPUT_BUFFER_EMPTY) == AE_OK) > + continue; > + else > + break; > + } > + *Data = EC_GET_DATA(sc); > + return (AE_OK); > } > - *Data = EC_GET_DATA(sc); > - > - return (AE_OK); > + device_printf(sc->ec_dev, "EcRead: failed waiting to get data\n"); > + return (status); > } > > static ACPI_STATUS > @@ -992,7 +998,7 @@ EcWrite(struct acpi_ec_softc *sc, UINT8 > EC_SET_DATA(sc, Address); > status = EcWaitEvent(sc, EC_EVENT_INPUT_BUFFER_EMPTY, gen_count); > if (ACPI_FAILURE(status)) { > - device_printf(sc->ec_dev, "EcRead: failed waiting for sent address\n"); > + device_printf(sc->ec_dev, "EcWrite: failed waiting for sent address\n"); > return (status); > } > -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 18:20:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29D90106564A; Tue, 12 Oct 2010 18:20:39 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 149BC8FC17; Tue, 12 Oct 2010 18:20:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CIKdmo056348; Tue, 12 Oct 2010 18:20:39 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CIKc0Y056317; Tue, 12 Oct 2010 18:20:38 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010121820.o9CIKc0Y056317@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 12 Oct 2010 18:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213738 - in head: bin/sh tools/regression/bin/sh tools/regression/bin/sh/builtins tools/regression/bin/sh/errors tools/regression/bin/sh/execution tools/regression/bin/sh/expansion too... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 18:20:39 -0000 Author: obrien Date: Tue Oct 12 18:20:38 2010 New Revision: 213738 URL: http://svn.freebsd.org/changeset/base/213738 Log: Allow one to regression test 'sh' changes without having to install a potentially bad /bin/sh first. Modified: head/bin/sh/Makefile head/tools/regression/bin/sh/Makefile head/tools/regression/bin/sh/builtins/command8.0 head/tools/regression/bin/sh/builtins/exec1.0 head/tools/regression/bin/sh/builtins/exec2.0 head/tools/regression/bin/sh/builtins/fc1.0 head/tools/regression/bin/sh/builtins/fc2.0 head/tools/regression/bin/sh/builtins/trap1.0 head/tools/regression/bin/sh/builtins/var-assign.0 head/tools/regression/bin/sh/builtins/var-assign2.0 head/tools/regression/bin/sh/errors/assignment-error1.0 head/tools/regression/bin/sh/errors/backquote-error1.0 head/tools/regression/bin/sh/errors/backquote-error2.0 head/tools/regression/bin/sh/errors/option-error.0 head/tools/regression/bin/sh/errors/redirection-error.0 head/tools/regression/bin/sh/errors/redirection-error2.2 head/tools/regression/bin/sh/errors/redirection-error3.0 head/tools/regression/bin/sh/execution/fork1.0 head/tools/regression/bin/sh/execution/fork2.0 head/tools/regression/bin/sh/execution/func1.0 head/tools/regression/bin/sh/execution/redir2.0 head/tools/regression/bin/sh/expansion/question1.0 head/tools/regression/bin/sh/expansion/set-u1.0 head/tools/regression/bin/sh/parameters/mail1.0 head/tools/regression/bin/sh/parameters/mail2.0 head/tools/regression/bin/sh/parameters/pwd1.0 head/tools/regression/bin/sh/parameters/pwd2.0 head/tools/regression/bin/sh/regress.sh head/tools/regression/bin/sh/regress.t Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Tue Oct 12 17:53:01 2010 (r213737) +++ head/bin/sh/Makefile Tue Oct 12 18:20:38 2010 (r213738) @@ -62,4 +62,7 @@ syntax.c syntax.h: mksyntax token.h: mktokens sh ${.CURDIR}/mktokens +regress: + cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh + .include Modified: head/tools/regression/bin/sh/Makefile ============================================================================== --- head/tools/regression/bin/sh/Makefile Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/Makefile Tue Oct 12 18:20:38 2010 (r213738) @@ -1,4 +1,7 @@ # $FreeBSD$ +# Allow one to specify the 'sh' to regress. +SH?= /bin/sh + all: - sh regress.sh + env SH=${SH} ${SH} regress.sh Modified: head/tools/regression/bin/sh/builtins/command8.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/command8.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/builtins/command8.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -22,7 +22,7 @@ set -e set -- ${SPECIAL} for cmd in "$@" do - sh -c "v=:; while \$v; do v=false; command ${cmd}; done" >/dev/null + ${SH} -c "v=:; while \$v; do v=false; command ${cmd}; done" >/dev/null done while :; do Modified: head/tools/regression/bin/sh/builtins/exec1.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/exec1.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/builtins/exec1.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -12,7 +12,7 @@ failure() { ) [ $? = 0 ] || failure $LINENO ( - exec sh -c 'exit 42' + exec ${SH} -c 'exit 42' echo bad ) [ $? = 42 ] || failure $LINENO Modified: head/tools/regression/bin/sh/builtins/exec2.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/exec2.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/builtins/exec2.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -12,7 +12,7 @@ failure() { ) [ $? = 0 ] || failure $LINENO ( - exec -- sh -c 'exit 42' + exec -- ${SH} -c 'exit 42' echo bad ) [ $? = 42 ] || failure $LINENO Modified: head/tools/regression/bin/sh/builtins/fc1.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/fc1.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/builtins/fc1.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -8,7 +8,7 @@ T=$(mktemp -d sh-test.XXXXXX) cd $T mkfifo input output error -HISTFILE=/dev/null sh +m -i output 2>error & +HISTFILE=/dev/null ${SH} +m -i output 2>error & { # Syntax error echo ')' >&3 Modified: head/tools/regression/bin/sh/builtins/fc2.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/fc2.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/builtins/fc2.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -8,7 +8,7 @@ T=$(mktemp -d sh-test.XXXXXX) cd $T mkfifo input output error -HISTFILE=/dev/null sh +m -i output 2>error & +HISTFILE=/dev/null ${SH} +m -i output 2>error & exec 3>input { # Command not found, containing slash Modified: head/tools/regression/bin/sh/builtins/trap1.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/trap1.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/builtins/trap1.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -4,11 +4,11 @@ test "$(trap 'echo trapped' EXIT; :)" = test "$(trap 'echo trapped' EXIT; /usr/bin/true)" = trapped || exit 1 -result=$(sh -c 'trap "echo trapped" EXIT; /usr/bin/false') +result=$(${SH} -c 'trap "echo trapped" EXIT; /usr/bin/false') test $? -eq 1 || exit 1 test "$result" = trapped || exit 1 -result=$(sh -c 'trap "echo trapped" EXIT; exec /usr/bin/false') +result=$(${SH} -c 'trap "echo trapped" EXIT; exec /usr/bin/false') test $? -eq 1 || exit 1 test -z "$result" || exit 1 Modified: head/tools/regression/bin/sh/builtins/var-assign.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/var-assign.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/builtins/var-assign.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -44,12 +44,12 @@ set -e set -- ${SPECIAL} for cmd in "$@" do - sh -c "VAR=1; VAR=0 ${cmd}; exit \${VAR}" >/dev/null 2>&1 + ${SH} -c "VAR=1; VAR=0 ${cmd}; exit \${VAR}" >/dev/null 2>&1 done # For other built-ins and utilites they do not. set -- ${UTILS} for cmd in "$@" do - sh -c "VAR=0; VAR=1 ${cmd}; exit \${VAR}" >/dev/null 2>&1 + ${SH} -c "VAR=0; VAR=1 ${cmd}; exit \${VAR}" >/dev/null 2>&1 done Modified: head/tools/regression/bin/sh/builtins/var-assign2.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/var-assign2.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/builtins/var-assign2.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -45,11 +45,11 @@ set -e set -- ${SPECIAL} for cmd in "$@" do - sh -c "VAR=0; VAR=1 command ${cmd}; exit \${VAR}" >/dev/null 2>&1 + ${SH} -c "VAR=0; VAR=1 command ${cmd}; exit \${VAR}" >/dev/null 2>&1 done set -- ${UTILS} for cmd in "$@" do - sh -c "VAR=0; VAR=1 command ${cmd}; exit \${VAR}" >/dev/null 2>&1 + ${SH} -c "VAR=0; VAR=1 command ${cmd}; exit \${VAR}" >/dev/null 2>&1 done Modified: head/tools/regression/bin/sh/errors/assignment-error1.0 ============================================================================== --- head/tools/regression/bin/sh/errors/assignment-error1.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/errors/assignment-error1.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -16,15 +16,15 @@ SPECIAL="break,\ unset foo" # If there is no command word, the shell must abort on an assignment error. -sh -c "readonly a=0; a=2; exit 0" 2>/dev/null && exit 1 +${SH} -c "readonly a=0; a=2; exit 0" 2>/dev/null && exit 1 # Special built-in utilities must abort on an assignment error. set -- ${SPECIAL} for cmd in "$@" do - sh -c "readonly a=0; a=2 ${cmd}; exit 0" 2>/dev/null && exit 1 + ${SH} -c "readonly a=0; a=2 ${cmd}; exit 0" 2>/dev/null && exit 1 done # Other utilities must not abort; we currently still execute them. -sh -c 'readonly a=0; a=1 true; exit $a' 2>/dev/null || exit 1 -sh -c 'readonly a=0; a=1 command :; exit $a' 2>/dev/null || exit 1 +${SH} -c 'readonly a=0; a=1 true; exit $a' 2>/dev/null || exit 1 +${SH} -c 'readonly a=0; a=1 command :; exit $a' 2>/dev/null || exit 1 Modified: head/tools/regression/bin/sh/errors/backquote-error1.0 ============================================================================== --- head/tools/regression/bin/sh/errors/backquote-error1.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/errors/backquote-error1.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -1,4 +1,4 @@ # $FreeBSD$ -echo 'echo `for` echo ".BAD"CODE.' | sh +m -i 2>&1 | grep -q BADCODE && exit 1 +echo 'echo `for` echo ".BAD"CODE.' | ${SH} +m -i 2>&1 | grep -q BADCODE && exit 1 exit 0 Modified: head/tools/regression/bin/sh/errors/backquote-error2.0 ============================================================================== --- head/tools/regression/bin/sh/errors/backquote-error2.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/errors/backquote-error2.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -1,7 +1,7 @@ # $FreeBSD$ -sh -c 'echo `echo .BA"DCODE.` +${SH} -c 'echo `echo .BA"DCODE.` echo ".BAD"CODE.' 2>&1 | grep -q BADCODE && exit 1 -echo '`"`' | sh -n 2>/dev/null && exit 1 -echo '`'"'"'`' | sh -n 2>/dev/null && exit 1 +echo '`"`' | ${SH} -n 2>/dev/null && exit 1 +echo '`'"'"'`' | ${SH} -n 2>/dev/null && exit 1 exit 0 Modified: head/tools/regression/bin/sh/errors/option-error.0 ============================================================================== --- head/tools/regression/bin/sh/errors/option-error.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/errors/option-error.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -35,12 +35,12 @@ UTILS="alias -y,\ set -- ${SPECIAL} for cmd in "$@" do - sh -c "${cmd}; exit 0" 2>/dev/null && exit 1 + ${SH} -c "${cmd}; exit 0" 2>/dev/null && exit 1 done # Other utilities must not abort. set -- ${UTILS} for cmd in "$@" do - sh -c "${cmd}; exit 0" 2>/dev/null || exit 1 + ${SH} -c "${cmd}; exit 0" 2>/dev/null || exit 1 done Modified: head/tools/regression/bin/sh/errors/redirection-error.0 ============================================================================== --- head/tools/regression/bin/sh/errors/redirection-error.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/errors/redirection-error.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -42,12 +42,12 @@ UTILS="alias,\ set -- ${SPECIAL} for cmd in "$@" do - sh -c "${cmd} > /; exit 0" 2>/dev/null && exit 1 + ${SH} -c "${cmd} > /; exit 0" 2>/dev/null && exit 1 done # Other utilities must not abort. set -- ${UTILS} for cmd in "$@" do - sh -c "${cmd} > /; exit 0" 2>/dev/null || exit 1 + ${SH} -c "${cmd} > /; exit 0" 2>/dev/null || exit 1 done Modified: head/tools/regression/bin/sh/errors/redirection-error2.2 ============================================================================== --- head/tools/regression/bin/sh/errors/redirection-error2.2 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/errors/redirection-error2.2 Tue Oct 12 18:20:38 2010 (r213738) @@ -1,4 +1,4 @@ # $FreeBSD$ # sh should fail gracefully on this bad redirect -sh -c 'echo 1 >&$a' 2>/dev/null +${SH} -c 'echo 1 >&$a' 2>/dev/null Modified: head/tools/regression/bin/sh/errors/redirection-error3.0 ============================================================================== --- head/tools/regression/bin/sh/errors/redirection-error3.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/errors/redirection-error3.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -44,11 +44,11 @@ UTILS="alias,\ set -- ${SPECIAL} for cmd in "$@" do - sh -c "command ${cmd} > /; exit 0" 2>/dev/null || exit 1 + ${SH} -c "command ${cmd} > /; exit 0" 2>/dev/null || exit 1 done set -- ${UTILS} for cmd in "$@" do - sh -c "command ${cmd} > /; exit 0" 2>/dev/null || exit 1 + ${SH} -c "command ${cmd} > /; exit 0" 2>/dev/null || exit 1 done Modified: head/tools/regression/bin/sh/execution/fork1.0 ============================================================================== --- head/tools/regression/bin/sh/execution/fork1.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/execution/fork1.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -1,7 +1,7 @@ # $FreeBSD$ -result=$(sh -c 'ps -p $$ -o comm=') +result=$(${SH} -c 'ps -p $$ -o comm=') test "$result" = "ps" || exit 1 -result=$(sh -c 'ps -p $$ -o comm=; :') +result=$(${SH} -c 'ps -p $$ -o comm=; :') test "$result" = "sh" || exit 1 Modified: head/tools/regression/bin/sh/execution/fork2.0 ============================================================================== --- head/tools/regression/bin/sh/execution/fork2.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/execution/fork2.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -1,9 +1,9 @@ # $FreeBSD$ -result=$(sh -c '(/bin/sleep 1)& sleep 0.1; ps -p $! -o comm=; kill $!') +result=$(${SH} -c '(/bin/sleep 1)& sleep 0.1; ps -p $! -o comm=; kill $!') test "$result" = sleep || exit 1 -result=$(sh -c '{ trap "echo trapped" EXIT; (/usr/bin/true); } & wait') +result=$(${SH} -c '{ trap "echo trapped" EXIT; (/usr/bin/true); } & wait') test "$result" = trapped || exit 1 exit 0 Modified: head/tools/regression/bin/sh/execution/func1.0 ============================================================================== --- head/tools/regression/bin/sh/execution/func1.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/execution/func1.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -1,4 +1,4 @@ # $FreeBSD$ -MALLOC_OPTIONS=J sh -c 'g() { g() { :; }; :; }; g' && -MALLOC_OPTIONS=J sh -c 'g() { unset -f g; :; }; g' +MALLOC_OPTIONS=J ${SH} -c 'g() { g() { :; }; :; }; g' && +MALLOC_OPTIONS=J ${SH} -c 'g() { unset -f g; :; }; g' Modified: head/tools/regression/bin/sh/execution/redir2.0 ============================================================================== --- head/tools/regression/bin/sh/execution/redir2.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/execution/redir2.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -10,7 +10,7 @@ brokenpipe=0 mkfifo fifo1 fifo2 { { - exec sh -c 'exec &1 | grep -q abcdefg || exit 1 -sh -c 'unset foo; echo ${foo?}' 2>/dev/null && exit 1 -sh -c 'foo=; echo ${foo:?}' 2>/dev/null && exit 1 -sh -c 'foo=; echo ${foo?}' >/dev/null || exit 1 -sh -c 'foo=1; echo ${foo:?}' >/dev/null || exit 1 -sh -c 'echo ${!?}' 2>/dev/null && exit 1 -sh -c ':& echo ${!?}' >/dev/null || exit 1 -sh -c 'echo ${#?}' >/dev/null || exit 1 -sh -c 'echo ${*?}' 2>/dev/null && exit 1 -sh -c 'echo ${*?}' sh x >/dev/null || exit 1 -sh -c 'echo ${1?}' 2>/dev/null && exit 1 -sh -c 'echo ${1?}' sh x >/dev/null || exit 1 -sh -c 'echo ${2?}' sh x 2>/dev/null && exit 1 -sh -c 'echo ${2?}' sh x y >/dev/null || exit 1 +${SH} -c 'unset foo; echo ${foo?}' 2>/dev/null && exit 1 +${SH} -c 'foo=; echo ${foo:?}' 2>/dev/null && exit 1 +${SH} -c 'foo=; echo ${foo?}' >/dev/null || exit 1 +${SH} -c 'foo=1; echo ${foo:?}' >/dev/null || exit 1 +${SH} -c 'echo ${!?}' 2>/dev/null && exit 1 +${SH} -c ':& echo ${!?}' >/dev/null || exit 1 +${SH} -c 'echo ${#?}' >/dev/null || exit 1 +${SH} -c 'echo ${*?}' 2>/dev/null && exit 1 +${SH} -c 'echo ${*?}' ${SH} x >/dev/null || exit 1 +${SH} -c 'echo ${1?}' 2>/dev/null && exit 1 +${SH} -c 'echo ${1?}' ${SH} x >/dev/null || exit 1 +${SH} -c 'echo ${2?}' ${SH} x 2>/dev/null && exit 1 +${SH} -c 'echo ${2?}' ${SH} x y >/dev/null || exit 1 exit 0 Modified: head/tools/regression/bin/sh/expansion/set-u1.0 ============================================================================== --- head/tools/regression/bin/sh/expansion/set-u1.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/expansion/set-u1.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -1,29 +1,29 @@ # $FreeBSD$ -sh -uc 'unset foo; echo $foo' 2>/dev/null && exit 1 -sh -uc 'foo=; echo $foo' >/dev/null || exit 1 -sh -uc 'foo=1; echo $foo' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo $foo' 2>/dev/null && exit 1 +${SH} -uc 'foo=; echo $foo' >/dev/null || exit 1 +${SH} -uc 'foo=1; echo $foo' >/dev/null || exit 1 # -/+/= are unaffected by set -u -sh -uc 'unset foo; echo ${foo-}' >/dev/null || exit 1 -sh -uc 'unset foo; echo ${foo+}' >/dev/null || exit 1 -sh -uc 'unset foo; echo ${foo=}' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo ${foo-}' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo ${foo+}' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo ${foo=}' >/dev/null || exit 1 # length/trimming are affected -sh -uc 'unset foo; echo ${#foo}' 2>/dev/null && exit 1 -sh -uc 'foo=; echo ${#foo}' >/dev/null || exit 1 -sh -uc 'unset foo; echo ${foo#?}' 2>/dev/null && exit 1 -sh -uc 'foo=1; echo ${foo#?}' >/dev/null || exit 1 -sh -uc 'unset foo; echo ${foo##?}' 2>/dev/null && exit 1 -sh -uc 'foo=1; echo ${foo##?}' >/dev/null || exit 1 -sh -uc 'unset foo; echo ${foo%?}' 2>/dev/null && exit 1 -sh -uc 'foo=1; echo ${foo%?}' >/dev/null || exit 1 -sh -uc 'unset foo; echo ${foo%%?}' 2>/dev/null && exit 1 -sh -uc 'foo=1; echo ${foo%%?}' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo ${#foo}' 2>/dev/null && exit 1 +${SH} -uc 'foo=; echo ${#foo}' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo ${foo#?}' 2>/dev/null && exit 1 +${SH} -uc 'foo=1; echo ${foo#?}' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo ${foo##?}' 2>/dev/null && exit 1 +${SH} -uc 'foo=1; echo ${foo##?}' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo ${foo%?}' 2>/dev/null && exit 1 +${SH} -uc 'foo=1; echo ${foo%?}' >/dev/null || exit 1 +${SH} -uc 'unset foo; echo ${foo%%?}' 2>/dev/null && exit 1 +${SH} -uc 'foo=1; echo ${foo%%?}' >/dev/null || exit 1 -sh -uc 'echo $!' 2>/dev/null && exit 1 -sh -uc ':& echo $!' >/dev/null || exit 1 -sh -uc 'echo $#' >/dev/null || exit 1 -sh -uc 'echo $1' 2>/dev/null && exit 1 -sh -uc 'echo $1' sh x >/dev/null || exit 1 -sh -uc 'echo $2' sh x 2>/dev/null && exit 1 -sh -uc 'echo $2' sh x y >/dev/null || exit 1 +${SH} -uc 'echo $!' 2>/dev/null && exit 1 +${SH} -uc ':& echo $!' >/dev/null || exit 1 +${SH} -uc 'echo $#' >/dev/null || exit 1 +${SH} -uc 'echo $1' 2>/dev/null && exit 1 +${SH} -uc 'echo $1' ${SH} x >/dev/null || exit 1 +${SH} -uc 'echo $2' ${SH} x 2>/dev/null && exit 1 +${SH} -uc 'echo $2' ${SH} x y >/dev/null || exit 1 exit 0 Modified: head/tools/regression/bin/sh/parameters/mail1.0 ============================================================================== --- head/tools/regression/bin/sh/parameters/mail1.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/parameters/mail1.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -4,7 +4,7 @@ goodfile=/var/empty/sh-test-goodfile mailfile=/var/empty/sh-test-mailfile T=$(mktemp sh-test.XXXXXX) || exit -MAIL=$mailfile ktrace -i -f "$T" sh -c "[ -s $goodfile ]" 2>/dev/null +MAIL=$mailfile ktrace -i -f "$T" ${SH} -c "[ -s $goodfile ]" 2>/dev/null if ! grep -q $goodfile "$T"; then # ktrace problem rc=0 Modified: head/tools/regression/bin/sh/parameters/mail2.0 ============================================================================== --- head/tools/regression/bin/sh/parameters/mail2.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/parameters/mail2.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -4,7 +4,7 @@ goodfile=/var/empty/sh-test-goodfile mailfile=/var/empty/sh-test-mailfile T=$(mktemp sh-test.XXXXXX) || exit -ENV=$goodfile MAIL=$mailfile ktrace -i -f "$T" sh +m -i /dev/null 2>&1 +ENV=$goodfile MAIL=$mailfile ktrace -i -f "$T" ${SH} +m -i /dev/null 2>&1 if ! grep -q $goodfile "$T"; then # ktrace problem rc=0 Modified: head/tools/regression/bin/sh/parameters/pwd1.0 ============================================================================== --- head/tools/regression/bin/sh/parameters/pwd1.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/parameters/pwd1.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -3,9 +3,9 @@ cd / || exit 3 failures=0 -[ "$(PWD=foo sh -c 'pwd')" = / ] || : $((failures += 1)) -[ "$(PWD=/var/empty sh -c 'pwd')" = / ] || : $((failures += 1)) -[ "$(PWD=/var/empty/foo sh -c 'pwd')" = / ] || : $((failures += 1)) -[ "$(PWD=/bin/ls sh -c 'pwd')" = / ] || : $((failures += 1)) +[ "$(PWD=foo ${SH} -c 'pwd')" = / ] || : $((failures += 1)) +[ "$(PWD=/var/empty ${SH} -c 'pwd')" = / ] || : $((failures += 1)) +[ "$(PWD=/var/empty/foo ${SH} -c 'pwd')" = / ] || : $((failures += 1)) +[ "$(PWD=/bin/ls ${SH} -c 'pwd')" = / ] || : $((failures += 1)) exit $((failures != 0)) Modified: head/tools/regression/bin/sh/parameters/pwd2.0 ============================================================================== --- head/tools/regression/bin/sh/parameters/pwd2.0 Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/parameters/pwd2.0 Tue Oct 12 18:20:38 2010 (r213738) @@ -12,13 +12,13 @@ cd link [ "$PWD" = "$TP/link" ] [ "$(pwd)" = "$TP/link" ] [ "$(pwd -P)" = "$TP/test1" ] -[ "$(sh -c pwd)" = "$TP/link" ] -[ "$(sh -c pwd\ -P)" = "$TP/test1" ] +[ "$(${SH} -c pwd)" = "$TP/link" ] +[ "$(${SH} -c pwd\ -P)" = "$TP/test1" ] cd .. [ "$(pwd)" = "$TP" ] cd -P link [ "$PWD" = "$TP/test1" ] [ "$(pwd)" = "$TP/test1" ] [ "$(pwd -P)" = "$TP/test1" ] -[ "$(sh -c pwd)" = "$TP/test1" ] -[ "$(sh -c pwd\ -P)" = "$TP/test1" ] +[ "$(${SH} -c pwd)" = "$TP/test1" ] +[ "$(${SH} -c pwd\ -P)" = "$TP/test1" ] Modified: head/tools/regression/bin/sh/regress.sh ============================================================================== --- head/tools/regression/bin/sh/regress.sh Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/regress.sh Tue Oct 12 18:20:38 2010 (r213738) @@ -1,12 +1,18 @@ # $FreeBSD$ +if [ -z "${SH}" ]; then + echo '${SH} is not set, please correct and re-run.' + exit 1 +fi +export SH=${SH} + COUNTER=1 do_test() { local c c=${COUNTER} COUNTER=$((COUNTER+1)) - sh $1 > tmp.stdout 2> tmp.stderr + ${SH} $1 > tmp.stdout 2> tmp.stderr if [ $? -ne $2 ]; then echo "not ok ${c} - ${1} # wrong exit status" rm tmp.stdout tmp.stderr Modified: head/tools/regression/bin/sh/regress.t ============================================================================== --- head/tools/regression/bin/sh/regress.t Tue Oct 12 17:53:01 2010 (r213737) +++ head/tools/regression/bin/sh/regress.t Tue Oct 12 18:20:38 2010 (r213738) @@ -1,6 +1,12 @@ #!/bin/sh # $FreeBSD$ +if [ -z "${SH}" ]; then + echo '${SH} is not set, please correct and re-run.' + exit 1 +fi +export SH=${SH} + cd `dirname $0` -sh regress.sh +${SH} regress.sh From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 18:36:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CB65106566B; Tue, 12 Oct 2010 18:36:04 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4C158FC1A; Tue, 12 Oct 2010 18:36:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CIa3fQ056852; Tue, 12 Oct 2010 18:36:03 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CIa356056848; Tue, 12 Oct 2010 18:36:03 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201010121836.o9CIa356056848@svn.freebsd.org> From: Matthew D Fleming Date: Tue, 12 Oct 2010 18:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213739 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 18:36:04 -0000 Author: mdf Date: Tue Oct 12 18:36:03 2010 New Revision: 213739 URL: http://svn.freebsd.org/changeset/base/213739 Log: Re-expose and briefly document taskqueue_run(9). The function is used in at least one 3rd party driver. Requested by: jhb Modified: head/share/man/man9/taskqueue.9 head/sys/kern/subr_taskqueue.c head/sys/sys/taskqueue.h Modified: head/share/man/man9/taskqueue.9 ============================================================================== --- head/share/man/man9/taskqueue.9 Tue Oct 12 18:20:38 2010 (r213738) +++ head/share/man/man9/taskqueue.9 Tue Oct 12 18:36:03 2010 (r213739) @@ -67,6 +67,8 @@ struct task { .Fn taskqueue_drain "struct taskqueue *queue" "struct task *task" .Ft int .Fn taskqueue_member "struct taskqueue *queue" "struct thread *td" +.Ft void +.Fn taskqueue_run "struct taskqueue *queue" "struct task **tpp" .Fn TASK_INIT "struct task *task" "int priority" "task_fn_t *func" "void *context" .Fn TASKQUEUE_DECLARE "name" .Fn TASKQUEUE_DEFINE "name" "taskqueue_enqueue_fn enqueue" "void *context" "init" @@ -178,6 +180,19 @@ and .No 0 otherwise. .Pp +The +.Fn taskqueue_run +function will run all pending tasks in the specified +.Fa queue . +Normally this function is only used internally. +The +.Fa tpp +argument is a pointer to a +.Vt struct task * +that is used to record the currently running task. +The lifetime of this pointer must match that of the +.Fa queue . +.Pp A convenience macro, .Fn TASK_INIT "task" "priority" "func" "context" is provided to initialise a Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Tue Oct 12 18:20:38 2010 (r213738) +++ head/sys/kern/subr_taskqueue.c Tue Oct 12 18:36:03 2010 (r213739) @@ -63,8 +63,6 @@ struct taskqueue { #define TQ_FLAGS_BLOCKED (1 << 1) #define TQ_FLAGS_PENDING (1 << 2) -static void taskqueue_run(struct taskqueue *, struct task **); - static __inline void TQ_LOCK(struct taskqueue *tq) { @@ -216,7 +214,7 @@ taskqueue_unblock(struct taskqueue *queu TQ_UNLOCK(queue); } -static void +void taskqueue_run(struct taskqueue *queue, struct task **tpp) { struct task *task; Modified: head/sys/sys/taskqueue.h ============================================================================== --- head/sys/sys/taskqueue.h Tue Oct 12 18:20:38 2010 (r213738) +++ head/sys/sys/taskqueue.h Tue Oct 12 18:36:03 2010 (r213739) @@ -56,6 +56,7 @@ int taskqueue_start_threads(struct taskq int taskqueue_enqueue(struct taskqueue *queue, struct task *task); void taskqueue_drain(struct taskqueue *queue, struct task *task); void taskqueue_free(struct taskqueue *queue); +void taskqueue_run(struct taskqueue *queue, struct task **tpp); void taskqueue_block(struct taskqueue *queue); void taskqueue_unblock(struct taskqueue *queue); int taskqueue_member(struct taskqueue *queue, struct thread *td); From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 19:00:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D18CB10656D5; Tue, 12 Oct 2010 19:00:18 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0ACB8FC22; Tue, 12 Oct 2010 19:00:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CJ0IDP058657; Tue, 12 Oct 2010 19:00:18 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CJ0IYJ058655; Tue, 12 Oct 2010 19:00:18 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201010121900.o9CJ0IYJ058655@svn.freebsd.org> From: Joel Dahl Date: Tue, 12 Oct 2010 19:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213740 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 19:00:19 -0000 Author: joel (doc committer) Date: Tue Oct 12 19:00:18 2010 New Revision: 213740 URL: http://svn.freebsd.org/changeset/base/213740 Log: Document the fact that bwn works really well on the laptop I'm using right now (HP 6715b). Modified: head/share/man/man4/bwn.4 Modified: head/share/man/man4/bwn.4 ============================================================================== --- head/share/man/man4/bwn.4 Tue Oct 12 18:36:03 2010 (r213739) +++ head/share/man/man4/bwn.4 Tue Oct 12 19:00:18 2010 (r213740) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 14, 2010 +.Dd October 12, 2010 .Dt BWN 4 .Os .Sh NAME @@ -83,6 +83,7 @@ driver supports Broadcom BCM43xx based w .It "Buffalo WLI-CB-G54S BCM4318 CardBus b/g" .It "Dell Wireless 1470 BCM4318 Mini PCI b/g" .It "Dell Truemobile 1400 BCM4309 Mini PCI b/g" +.It "HP Compaq 6715b BCM4312 PCI b/g" .It "HP nx6125 BCM4319 PCI b/g" .It "Linksys WPC54G Ver 3 BCM4318 CardBus b/g" .It "Linksys WPC54GS Ver 2 BCM4318 CardBus b/g" From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 19:07:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBF86106566B; Tue, 12 Oct 2010 19:07:36 +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 B8A4D8FC18; Tue, 12 Oct 2010 19:07:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CJ7aNM058885; Tue, 12 Oct 2010 19:07:36 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CJ7a7H058882; Tue, 12 Oct 2010 19:07:36 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201010121907.o9CJ7a7H058882@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 12 Oct 2010 19:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213741 - in stable/8/tools/tools: ath/common mcgrab mctest termcap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 19:07:36 -0000 Author: gnn Date: Tue Oct 12 19:07:36 2010 New Revision: 213741 URL: http://svn.freebsd.org/changeset/base/213741 Log: MFC 204310: Moved mcgrab(1) into a separate directory -- our .mk infrastructure doesn't currently have support for building multiple programs in a single makefile. While here, fixed manpages and makefiles (missing dependencies). Added: stable/8/tools/tools/mcgrab/ - copied from r204310, head/tools/tools/mcgrab/ Deleted: stable/8/tools/tools/mctest/mcgrab.1 stable/8/tools/tools/mctest/mcgrab.cc Modified: stable/8/tools/tools/mctest/Makefile stable/8/tools/tools/mctest/mctest.1 Directory Properties: stable/8/tools/tools/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/umastat/ (props changed) stable/8/tools/tools/vimage/ (props changed) Modified: stable/8/tools/tools/mctest/Makefile ============================================================================== --- stable/8/tools/tools/mctest/Makefile Tue Oct 12 19:00:18 2010 (r213740) +++ stable/8/tools/tools/mctest/Makefile Tue Oct 12 19:07:36 2010 (r213741) @@ -1,11 +1,7 @@ -# # $FreeBSD$ -# -# A Makefile that builds both the mctest program and its manual page. PROG_CXX= mctest -PROG_CXX= mcgrab - -LDADD+= -lpthread +DPADD= ${LIBPTHREAD} +LDADD= -lpthread .include Modified: stable/8/tools/tools/mctest/mctest.1 ============================================================================== --- stable/8/tools/tools/mctest/mctest.1 Tue Oct 12 19:00:18 2010 (r213740) +++ stable/8/tools/tools/mctest/mctest.1 Tue Oct 12 19:07:36 2010 (r213741) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd April 3, 2008 -.Dt mctest 1 +.Dt MCTEST 1 .Os .Sh NAME .Nm mctest @@ -40,29 +40,34 @@ .Op Fl t Ar inter-packet gap .Op Fl M Ar number of clients (source only) .Op Fl m Ar my client number (sink only) -.Op Fl r +.Op Fl r .Sh DESCRIPTION -The +The .Nm -command implements a multicast test which involved a source -and a sink. The source sends packets to a pre-configured -multicast address over the interface given as a command line -argument. The sink listens for multicast packets, records -the time at which they're received and then reflects them back -over unicast to the source. When the source has captured all +command implements a multicast test which involves a source +and a sink. +The source sends packets to a pre-configured +multicast address over the interface given as a command line +argument. +The sink listens for multicast packets, records +the time at which they are received and then reflects them back +over unicast to the source. +When the source has captured all the reflected packets it prints out the round trip time of each. .Pp The source prints out the round trip time of packets sent to the -sinks. The sink prints out the time between the packets received. +sinks. +The sink prints out the time between the packets received. .Pp The options are as follows: -.Bl -tag -width ".Fl d Ar argument" +.Bl -tag -width ".Fl i Ar interface" .It Fl i Ar interface -Network interface, which can be found with ifconfig(1). +Network interface, which can be found with +.Xr ifconfig 8 . .It Fl g Ar group -Multicast group +Multicast group. .It Fl b Ar base port -Port on which to listen +Port on which to listen. .It Fl s Ar size Packet size in bytes. .It Fl n Ar number @@ -70,14 +75,15 @@ Number of packets. .It Fl t Ar gap Inter-packet gap in nanoseconds. .It Fl M Ar clients -The number of clients that are listening +The number of clients that are listening. .It Fl m Ar my number The client's number 0, 1, etc. .It Fl r This version of .Nm -is the receiver aka the sink. This option MUST -only be used with one copy of the program at a time. +is the receiver aka the sink. +This option MUST +only be used with one copy of the program at a time. .El .Sh EXAMPLES The following is an example of a typical usage @@ -92,14 +98,15 @@ Sink .Pp Send 100 packets of 1024 bytes, with an inter-packet gap of 1 nanosecond. .Pp -Gaps are measured with +Gaps are measured with .Xr nanosleep 2 , and so are not accurate down to nanoseconds -but depend on the setting of kern.hz. +but depend on the setting of +.Va kern.hz . .Sh SEE ALSO -.Xr ifconfig 8 , .Xr netstat 1 , -.Xr nanosleep 2 . +.Xr nanosleep 2 , +.Xr ifconfig 8 .Sh HISTORY The .Nm @@ -110,4 +117,5 @@ This manual page was written by .An George V. Neville-Neil Aq gnn@FreeBSD.org . .Sh BUGS -Should be reported to the author or to net@freebsd.org. +Should be reported to the author or to +.Aq net@FreeBSD.org . From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 19:20:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAE9B106566C for ; Tue, 12 Oct 2010 19:20:07 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (unknown [IPv6:2001:ba8:0:1d5:216:d4ff:fe0d:d845]) by mx1.freebsd.org (Postfix) with ESMTP id 4B3768FC1C for ; Tue, 12 Oct 2010 19:20:07 +0000 (UTC) Received: from uucp by gromit.grondar.org with UUCP (Exim 4.72) (envelope-from ) id 1P5kOM-0003Zs-Eq for svn-src-all@freebsd.org; Tue, 12 Oct 2010 20:20:06 +0100 Received: from localhost ([127.0.0.1] helo=groundzero.grondar.org) by groundzero.grondar.org with esmtp (Exim 4.72 (FreeBSD)) (envelope-from ) id 1P5kMC-0004CU-Ik; Tue, 12 Oct 2010 20:17:52 +0100 Message-Id: To: Alexander Leidinger In-reply-to: <20101011102943.57005on1chxhv44k@webmail.leidinger.net> References: <201010081742.o98HgAbO001604@svn.freebsd.org> <20101010113524.00004725@unknown> <20101011102801.10542rdhqicnige8@webmail.leidinger.net> <20101011102943.57005on1chxhv44k@webmail.leidinger.net> From: Mark Murray Date: Tue, 12 Oct 2010 20:17:52 +0100 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r213585 - head/tools/build/mk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 19:20:07 -0000 Alexander Leidinger writes: > >> src/usr.sbin/mailwrapper/Makefile > > > > What am I doing wrong? > > I did not do a correct copy&paste... put the result is the same. > > > ---snip--- > > % grep rmail /usr/src/usr.sbin/mailwrapper > > % grep rmail /usr/src/usr.sbin/mailwrapper/Makefile My foul-up, sorry. It looks like I managed to not properly undo a local commit. I'll be committing the relevant bits shortly (properly this time!) Sorry about that! M -- Mark R V Murray Cert APS(Open) Dip Phys(Open) BSc Open(Open) BSc(Hons)(Open) Pi: 132511160 From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 19:22:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6A1B1065672; Tue, 12 Oct 2010 19:22:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D54BB8FC12; Tue, 12 Oct 2010 19:22:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CJM3Rp059294; Tue, 12 Oct 2010 19:22:03 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CJM3Ta059292; Tue, 12 Oct 2010 19:22:03 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010121922.o9CJM3Ta059292@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 12 Oct 2010 19:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213742 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 19:22:04 -0000 Author: yongari Date: Tue Oct 12 19:22:03 2010 New Revision: 213742 URL: http://svn.freebsd.org/changeset/base/213742 Log: Fix a regression introduced in r213495. r213495 disabled mini receive producer ring only for BCM5700. It was believed that BCM5700 with external SSRAM is the only controller that supports mini ring but it seems all BCM570[0-4] requires to disable mini receive producer ring. Otherwise, it caused unexpected RX DMA error or watchdog timeouts. Reported by: marius, Steve Kargl troutmask dot apl dot washington dot edu> Tested by: marius, Steve Kargl troutmask dot apl dot washington dot edu> Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Oct 12 19:07:36 2010 (r213741) +++ head/sys/dev/bge/if_bge.c Tue Oct 12 19:22:03 2010 (r213742) @@ -1655,7 +1655,7 @@ bge_blockinit(struct bge_softc *sc) } /* Disable the mini receive producer ring RCB. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5700) { + if (BGE_IS_5700_FAMILY(sc)) { rcb = &sc->bge_ldata.bge_info.bge_mini_rx_rcb; rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0, BGE_RCB_FLAG_RING_DISABLED); From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 19:24:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8E56106564A; Tue, 12 Oct 2010 19:24:29 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7F598FC1A; Tue, 12 Oct 2010 19:24:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CJOTfO059432; Tue, 12 Oct 2010 19:24:29 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CJOTB9059430; Tue, 12 Oct 2010 19:24:29 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201010121924.o9CJOTB9059430@svn.freebsd.org> From: Matthew D Fleming Date: Tue, 12 Oct 2010 19:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213743 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 19:24:29 -0000 Author: mdf Date: Tue Oct 12 19:24:29 2010 New Revision: 213743 URL: http://svn.freebsd.org/changeset/base/213743 Log: Always set cm_complete_data before calling mps_config_complete(). Reviewed by: ken Modified: head/sys/dev/mps/mps.c Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Tue Oct 12 19:22:03 2010 (r213742) +++ head/sys/dev/mps/mps.c Tue Oct 12 19:24:29 2010 (r213743) @@ -1562,9 +1562,9 @@ mps_read_config_page(struct mps_softc *s cm->cm_flags = MPS_CM_FLAGS_SGE_SIMPLE | MPS_CM_FLAGS_DATAIN; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; + cm->cm_complete_data = params; if (params->callback != NULL) { cm->cm_complete = mps_config_complete; - cm->cm_complete_data = params; return (mps_map_command(sc, cm)); } else { cm->cm_complete = NULL; From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 19:24:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 648591065695; Tue, 12 Oct 2010 19:24:42 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38C9B8FC0A; Tue, 12 Oct 2010 19:24:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CJOgwB059489; Tue, 12 Oct 2010 19:24:42 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CJOgwn059485; Tue, 12 Oct 2010 19:24:42 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010121924.o9CJOgwn059485@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 12 Oct 2010 19:24:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213744 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 19:24:42 -0000 Author: obrien Date: Tue Oct 12 19:24:41 2010 New Revision: 213744 URL: http://svn.freebsd.org/changeset/base/213744 Log: If DEBUG is 3 or greater, disable STATICization of functions. Also correct the documented location of the trace file. Modified: head/bin/sh/Makefile head/bin/sh/shell.h head/bin/sh/show.c Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Tue Oct 12 19:24:29 2010 (r213743) +++ head/bin/sh/Makefile Tue Oct 12 19:24:41 2010 (r213744) @@ -21,7 +21,7 @@ LDADD= -ll -ledit -ltermcap LFLAGS= -8 # 8-bit lex scanner for arithmetic CFLAGS+=-DSHELL -I. -I${.CURDIR} # for debug: -# CFLAGS+= -g -DDEBUG=2 +# CFLAGS+= -g -DDEBUG=3 WARNS?= 2 WFORMAT=0 Modified: head/bin/sh/shell.h ============================================================================== --- head/bin/sh/shell.h Tue Oct 12 19:24:29 2010 (r213743) +++ head/bin/sh/shell.h Tue Oct 12 19:24:41 2010 (r213744) @@ -43,8 +43,9 @@ * JOBS -> 1 if you have Berkeley job control, 0 otherwise. * define DEBUG=1 to compile in debugging (set global "debug" to turn on) * define DEBUG=2 to compile in and turn on debugging. + * define DEBUG=3 to also build all functions as public * - * When debugging is on, debugging info will be written to $HOME/trace and + * When debugging is on, debugging info will be written to ./trace and * a quit signal will generate a core dump. */ @@ -61,7 +62,11 @@ typedef intmax_t arith_t; #define strtoarith_t(nptr, endptr, base) strtoimax(nptr, endptr, base) typedef void *pointer; +#if DEBUG >= 3 +#define STATIC +#else #define STATIC static +#endif #define MKINIT /* empty */ #include Modified: head/bin/sh/show.c ============================================================================== --- head/bin/sh/show.c Tue Oct 12 19:24:29 2010 (r213743) +++ head/bin/sh/show.c Tue Oct 12 19:24:41 2010 (r213744) @@ -274,7 +274,7 @@ indent(int amount, char *pfx, FILE *fp) FILE *tracefile; -#if DEBUG == 2 +#if DEBUG >= 2 int debug = 1; #else int debug = 0; From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 19:28:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4463010656A4; Tue, 12 Oct 2010 19:28:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3139A8FC1C; Tue, 12 Oct 2010 19:28:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CJSL4D059625; Tue, 12 Oct 2010 19:28:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CJSLWA059623; Tue, 12 Oct 2010 19:28:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121928.o9CJSLWA059623@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 19:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213745 - stable/8/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 19:28:21 -0000 Author: jhb Date: Tue Oct 12 19:28:20 2010 New Revision: 213745 URL: http://svn.freebsd.org/changeset/base/213745 Log: MFC 213226: Rewrite the i386 memory probe: - Check for SMAP data from the loader first. If it exists, don't bother doing any VM86 calls at all. This will be more friendly for non-BIOS boot environments such as EFI, etc. - Move the base memory setup into a new basemem_setup() routine instead of duplicating it. - Simplify the XEN case by removing all of the VM86/SMAP parsing code rather than just jumping over it. - Adjust some comments to better explain the code flow. Modified: stable/8/sys/i386/i386/machdep.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/i386/i386/machdep.c ============================================================================== --- stable/8/sys/i386/i386/machdep.c Tue Oct 12 19:24:41 2010 (r213744) +++ stable/8/sys/i386/i386/machdep.c Tue Oct 12 19:28:20 2010 (r213745) @@ -1938,6 +1938,7 @@ sdtossd(sd, ssd) ssd->ssd_gran = sd->sd_gran; } +#ifndef XEN static int add_smap_entry(struct bios_smap *smap, vm_paddr_t *physmap, int *physmap_idxp) { @@ -2017,78 +2018,13 @@ add_smap_entry(struct bios_smap *smap, v return (1); } -/* - * Populate the (physmap) array with base/bound pairs describing the - * available physical memory in the system, then test this memory and - * build the phys_avail array describing the actually-available memory. - * - * If we cannot accurately determine the physical memory map, then use - * value from the 0xE801 call, and failing that, the RTC. - * - * Total memory size may be set by the kernel environment variable - * hw.physmem or the compile-time define MAXMEM. - * - * XXX first should be vm_paddr_t. - */ static void -getmemsize(int first) +basemem_setup(void) { - int i, off, physmap_idx, pa_indx, da_indx; - int hasbrokenint12, has_smap; - u_long physmem_tunable; - u_int extmem; - struct vm86frame vmf; - struct vm86context vmc; - vm_paddr_t pa, physmap[PHYSMAP_SIZE]; + vm_paddr_t pa; pt_entry_t *pte; - struct bios_smap *smap, *smapbase, *smapend; - u_int32_t smapsize; - quad_t dcons_addr, dcons_size; - caddr_t kmdp; - - has_smap = 0; -#ifdef XBOX - if (arch_i386_is_xbox) { - /* - * We queried the memory size before, so chop off 4MB for - * the framebuffer and inform the OS of this. - */ - physmap[0] = 0; - physmap[1] = (arch_i386_xbox_memsize * 1024 * 1024) - XBOX_FB_SIZE; - physmap_idx = 0; - goto physmap_done; - } -#endif -#if defined(XEN) - has_smap = 0; - Maxmem = xen_start_info->nr_pages - init_first; - physmem = Maxmem; - basemem = 0; - physmap[0] = init_first << PAGE_SHIFT; - physmap[1] = ptoa(Maxmem) - round_page(MSGBUF_SIZE); - physmap_idx = 0; - goto physmap_done; -#endif - hasbrokenint12 = 0; - TUNABLE_INT_FETCH("hw.hasbrokenint12", &hasbrokenint12); - bzero(&vmf, sizeof(vmf)); - bzero(physmap, sizeof(physmap)); - basemem = 0; - - /* - * Some newer BIOSes has broken INT 12H implementation which cause - * kernel panic immediately. In this case, we need to scan SMAP - * with INT 15:E820 first, then determine base memory size. - */ - if (hasbrokenint12) { - goto int15e820; - } + int i; - /* - * Perform "base memory" related probes & setup - */ - vm86_intcall(0x12, &vmf); - basemem = vmf.vmf_ax; if (basemem > 640) { printf("Preposterous BIOS basemem of %uK, truncating to 640K\n", basemem); @@ -2128,12 +2064,69 @@ getmemsize(int first) pte = (pt_entry_t *)vm86paddr; for (i = basemem / 4; i < 160; i++) pte[i] = (i << PAGE_SHIFT) | PG_V | PG_RW | PG_U; +} +#endif + +/* + * Populate the (physmap) array with base/bound pairs describing the + * available physical memory in the system, then test this memory and + * build the phys_avail array describing the actually-available memory. + * + * If we cannot accurately determine the physical memory map, then use + * value from the 0xE801 call, and failing that, the RTC. + * + * Total memory size may be set by the kernel environment variable + * hw.physmem or the compile-time define MAXMEM. + * + * XXX first should be vm_paddr_t. + */ +static void +getmemsize(int first) +{ + int has_smap, off, physmap_idx, pa_indx, da_indx; + u_long physmem_tunable; + vm_paddr_t physmap[PHYSMAP_SIZE]; + pt_entry_t *pte; + quad_t dcons_addr, dcons_size; +#ifndef XEN + int hasbrokenint12, i; + u_int extmem; + struct vm86frame vmf; + struct vm86context vmc; + vm_paddr_t pa; + struct bios_smap *smap, *smapbase, *smapend; + u_int32_t smapsize; + caddr_t kmdp; +#endif + + has_smap = 0; +#if defined(XEN) + Maxmem = xen_start_info->nr_pages - init_first; + physmem = Maxmem; + basemem = 0; + physmap[0] = init_first << PAGE_SHIFT; + physmap[1] = ptoa(Maxmem) - round_page(MSGBUF_SIZE); + physmap_idx = 0; +#else +#ifdef XBOX + if (arch_i386_is_xbox) { + /* + * We queried the memory size before, so chop off 4MB for + * the framebuffer and inform the OS of this. + */ + physmap[0] = 0; + physmap[1] = (arch_i386_xbox_memsize * 1024 * 1024) - XBOX_FB_SIZE; + physmap_idx = 0; + goto physmap_done; + } +#endif + bzero(&vmf, sizeof(vmf)); + bzero(physmap, sizeof(physmap)); + basemem = 0; -int15e820: /* - * Fetch the memory map with INT 15:E820. First, check to see - * if the loader supplied it and use that if so. Otherwise, - * use vm86 to invoke the BIOS call directly. + * Check if the loader supplied an SMAP memory map. If so, + * use that and do not make any VM86 calls. */ physmap_idx = 0; smapbase = NULL; @@ -2144,9 +2137,10 @@ int15e820: smapbase = (struct bios_smap *)preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_SMAP); if (smapbase != NULL) { - /* subr_module.c says: + /* + * subr_module.c says: * "Consumer may safely assume that size value precedes data." - * ie: an int32_t immediately precedes smap. + * ie: an int32_t immediately precedes SMAP. */ smapsize = *((u_int32_t *)smapbase - 1); smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize); @@ -2155,33 +2149,50 @@ int15e820: for (smap = smapbase; smap < smapend; smap++) if (!add_smap_entry(smap, physmap, &physmap_idx)) break; - } else { - /* - * map page 1 R/W into the kernel page table so we can use it - * as a buffer. The kernel will unmap this page later. - */ - pmap_kenter(KERNBASE + (1 << PAGE_SHIFT), 1 << PAGE_SHIFT); - vmc.npages = 0; - smap = (void *)vm86_addpage(&vmc, 1, KERNBASE + - (1 << PAGE_SHIFT)); - vm86_getptr(&vmc, (vm_offset_t)smap, &vmf.vmf_es, &vmf.vmf_di); - - vmf.vmf_ebx = 0; - do { - vmf.vmf_eax = 0xE820; - vmf.vmf_edx = SMAP_SIG; - vmf.vmf_ecx = sizeof(struct bios_smap); - i = vm86_datacall(0x15, &vmf, &vmc); - if (i || vmf.vmf_eax != SMAP_SIG) - break; - has_smap = 1; - if (!add_smap_entry(smap, physmap, &physmap_idx)) - break; - } while (vmf.vmf_ebx != 0); + goto have_smap; } /* - * Perform "base memory" related probes & setup based on SMAP + * Some newer BIOSes have a broken INT 12H implementation + * which causes a kernel panic immediately. In this case, we + * need use the SMAP to determine the base memory size. + */ + hasbrokenint12 = 0; + TUNABLE_INT_FETCH("hw.hasbrokenint12", &hasbrokenint12); + if (hasbrokenint12 == 0) { + /* Use INT12 to determine base memory size. */ + vm86_intcall(0x12, &vmf); + basemem = vmf.vmf_ax; + basemem_setup(); + } + + /* + * Fetch the memory map with INT 15:E820. Map page 1 R/W into + * the kernel page table so we can use it as a buffer. The + * kernel will unmap this page later. + */ + pmap_kenter(KERNBASE + (1 << PAGE_SHIFT), 1 << PAGE_SHIFT); + vmc.npages = 0; + smap = (void *)vm86_addpage(&vmc, 1, KERNBASE + (1 << PAGE_SHIFT)); + vm86_getptr(&vmc, (vm_offset_t)smap, &vmf.vmf_es, &vmf.vmf_di); + + vmf.vmf_ebx = 0; + do { + vmf.vmf_eax = 0xE820; + vmf.vmf_edx = SMAP_SIG; + vmf.vmf_ecx = sizeof(struct bios_smap); + i = vm86_datacall(0x15, &vmf, &vmc); + if (i || vmf.vmf_eax != SMAP_SIG) + break; + has_smap = 1; + if (!add_smap_entry(smap, physmap, &physmap_idx)) + break; + } while (vmf.vmf_ebx != 0); + +have_smap: + /* + * If we didn't fetch the "base memory" size from INT12, + * figure it out from the SMAP (or just guess). */ if (basemem == 0) { for (i = 0; i <= physmap_idx; i += 2) { @@ -2191,49 +2202,39 @@ int15e820: } } - /* - * XXX this function is horribly organized and has to the same - * things that it does above here. - */ + /* XXX: If we couldn't find basemem from SMAP, just guess. */ if (basemem == 0) basemem = 640; - if (basemem > 640) { - printf( - "Preposterous BIOS basemem of %uK, truncating to 640K\n", - basemem); - basemem = 640; - } - - /* - * Let vm86 scribble on pages between basemem and - * ISA_HOLE_START, as above. - */ - for (pa = trunc_page(basemem * 1024); - pa < ISA_HOLE_START; pa += PAGE_SIZE) - pmap_kenter(KERNBASE + pa, pa); - pte = (pt_entry_t *)vm86paddr; - for (i = basemem / 4; i < 160; i++) - pte[i] = (i << PAGE_SHIFT) | PG_V | PG_RW | PG_U; + basemem_setup(); } if (physmap[1] != 0) goto physmap_done; /* - * If we failed above, try memory map with INT 15:E801 + * If we failed to find an SMAP, figure out the extended + * memory size. We will then build a simple memory map with + * two segments, one for "base memory" and the second for + * "extended memory". Note that "extended memory" starts at a + * physical address of 1MB and that both basemem and extmem + * are in units of 1KB. + * + * First, try to fetch the extended memory size via INT 15:E801. */ vmf.vmf_ax = 0xE801; if (vm86_intcall(0x15, &vmf) == 0) { extmem = vmf.vmf_cx + vmf.vmf_dx * 64; } else { + /* + * If INT15:E801 fails, this is our last ditch effort + * to determine the extended memory size. Currently + * we prefer the RTC value over INT15:88. + */ #if 0 vmf.vmf_ah = 0x88; vm86_intcall(0x15, &vmf); extmem = vmf.vmf_ax; -#elif !defined(XEN) - /* - * Prefer the RTC value for extended memory. - */ +#else extmem = rtcin(RTC_EXTLO) + (rtcin(RTC_EXTHI) << 8); #endif } @@ -2258,6 +2259,7 @@ int15e820: physmap[physmap_idx + 1] = physmap[physmap_idx] + extmem * 1024; physmap_done: +#endif /* * Now, physmap contains a map of physical memory. */ From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 19:28:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCED3106574E; Tue, 12 Oct 2010 19:28:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9F5A8FC20; Tue, 12 Oct 2010 19:28:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CJSXCG059666; Tue, 12 Oct 2010 19:28:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CJSXKu059664; Tue, 12 Oct 2010 19:28:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010121928.o9CJSXKu059664@svn.freebsd.org> From: John Baldwin Date: Tue, 12 Oct 2010 19:28:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213746 - stable/7/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 19:28:33 -0000 Author: jhb Date: Tue Oct 12 19:28:33 2010 New Revision: 213746 URL: http://svn.freebsd.org/changeset/base/213746 Log: MFC 213226: Rewrite the i386 memory probe: - Check for SMAP data from the loader first. If it exists, don't bother doing any VM86 calls at all. This will be more friendly for non-BIOS boot environments such as EFI, etc. - Move the base memory setup into a new basemem_setup() routine instead of duplicating it. - Simplify the XEN case by removing all of the VM86/SMAP parsing code rather than just jumping over it. - Adjust some comments to better explain the code flow. Modified: stable/7/sys/i386/i386/machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/i386/i386/machdep.c ============================================================================== --- stable/7/sys/i386/i386/machdep.c Tue Oct 12 19:28:20 2010 (r213745) +++ stable/7/sys/i386/i386/machdep.c Tue Oct 12 19:28:33 2010 (r213746) @@ -1730,69 +1730,13 @@ add_smap_entry(struct bios_smap *smap, v return (1); } -/* - * Populate the (physmap) array with base/bound pairs describing the - * available physical memory in the system, then test this memory and - * build the phys_avail array describing the actually-available memory. - * - * If we cannot accurately determine the physical memory map, then use - * value from the 0xE801 call, and failing that, the RTC. - * - * Total memory size may be set by the kernel environment variable - * hw.physmem or the compile-time define MAXMEM. - * - * XXX first should be vm_paddr_t. - */ static void -getmemsize(int first) +basemem_setup(void) { - int i, off, physmap_idx, pa_indx, da_indx; - int hasbrokenint12, has_smap; - u_long physmem_tunable; - u_int extmem; - struct vm86frame vmf; - struct vm86context vmc; - vm_paddr_t pa, physmap[PHYSMAP_SIZE]; + vm_paddr_t pa; pt_entry_t *pte; - struct bios_smap *smap, *smapbase, *smapend; - u_int32_t smapsize; - quad_t dcons_addr, dcons_size; - caddr_t kmdp; - - has_smap = 0; -#ifdef XBOX - if (arch_i386_is_xbox) { - /* - * We queried the memory size before, so chop off 4MB for - * the framebuffer and inform the OS of this. - */ - physmap[0] = 0; - physmap[1] = (arch_i386_xbox_memsize * 1024 * 1024) - XBOX_FB_SIZE; - physmap_idx = 0; - goto physmap_done; - } -#endif - - hasbrokenint12 = 0; - TUNABLE_INT_FETCH("hw.hasbrokenint12", &hasbrokenint12); - bzero(&vmf, sizeof(vmf)); - bzero(physmap, sizeof(physmap)); - basemem = 0; - - /* - * Some newer BIOSes has broken INT 12H implementation which cause - * kernel panic immediately. In this case, we need to scan SMAP - * with INT 15:E820 first, then determine base memory size. - */ - if (hasbrokenint12) { - goto int15e820; - } + int i; - /* - * Perform "base memory" related probes & setup - */ - vm86_intcall(0x12, &vmf); - basemem = vmf.vmf_ax; if (basemem > 640) { printf("Preposterous BIOS basemem of %uK, truncating to 640K\n", basemem); @@ -1832,12 +1776,58 @@ getmemsize(int first) pte = (pt_entry_t *)vm86paddr; for (i = basemem / 4; i < 160; i++) pte[i] = (i << PAGE_SHIFT) | PG_V | PG_RW | PG_U; +} + +/* + * Populate the (physmap) array with base/bound pairs describing the + * available physical memory in the system, then test this memory and + * build the phys_avail array describing the actually-available memory. + * + * If we cannot accurately determine the physical memory map, then use + * value from the 0xE801 call, and failing that, the RTC. + * + * Total memory size may be set by the kernel environment variable + * hw.physmem or the compile-time define MAXMEM. + * + * XXX first should be vm_paddr_t. + */ +static void +getmemsize(int first) +{ + int has_smap, off, physmap_idx, pa_indx, da_indx; + u_long physmem_tunable; + vm_paddr_t physmap[PHYSMAP_SIZE]; + pt_entry_t *pte; + quad_t dcons_addr, dcons_size; + int hasbrokenint12, i; + u_int extmem; + struct vm86frame vmf; + struct vm86context vmc; + vm_paddr_t pa; + struct bios_smap *smap, *smapbase, *smapend; + u_int32_t smapsize; + caddr_t kmdp; + + has_smap = 0; +#ifdef XBOX + if (arch_i386_is_xbox) { + /* + * We queried the memory size before, so chop off 4MB for + * the framebuffer and inform the OS of this. + */ + physmap[0] = 0; + physmap[1] = (arch_i386_xbox_memsize * 1024 * 1024) - XBOX_FB_SIZE; + physmap_idx = 0; + goto physmap_done; + } +#endif + bzero(&vmf, sizeof(vmf)); + bzero(physmap, sizeof(physmap)); + basemem = 0; -int15e820: /* - * Fetch the memory map with INT 15:E820. First, check to see - * if the loader supplied it and use that if so. Otherwise, - * use vm86 to invoke the BIOS call directly. + * Check if the loader supplied an SMAP memory map. If so, + * use that and do not make any VM86 calls. */ physmap_idx = 0; smapbase = NULL; @@ -1848,9 +1838,10 @@ int15e820: smapbase = (struct bios_smap *)preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_SMAP); if (smapbase != NULL) { - /* subr_module.c says: + /* + * subr_module.c says: * "Consumer may safely assume that size value precedes data." - * ie: an int32_t immediately precedes smap. + * ie: an int32_t immediately precedes SMAP. */ smapsize = *((u_int32_t *)smapbase - 1); smapend = (struct bios_smap *)((uintptr_t)smapbase + smapsize); @@ -1859,33 +1850,50 @@ int15e820: for (smap = smapbase; smap < smapend; smap++) if (!add_smap_entry(smap, physmap, &physmap_idx)) break; - } else { - /* - * map page 1 R/W into the kernel page table so we can use it - * as a buffer. The kernel will unmap this page later. - */ - pmap_kenter(KERNBASE + (1 << PAGE_SHIFT), 1 << PAGE_SHIFT); - vmc.npages = 0; - smap = (void *)vm86_addpage(&vmc, 1, KERNBASE + - (1 << PAGE_SHIFT)); - vm86_getptr(&vmc, (vm_offset_t)smap, &vmf.vmf_es, &vmf.vmf_di); - - vmf.vmf_ebx = 0; - do { - vmf.vmf_eax = 0xE820; - vmf.vmf_edx = SMAP_SIG; - vmf.vmf_ecx = sizeof(struct bios_smap); - i = vm86_datacall(0x15, &vmf, &vmc); - if (i || vmf.vmf_eax != SMAP_SIG) - break; - has_smap = 1; - if (!add_smap_entry(smap, physmap, &physmap_idx)) - break; - } while (vmf.vmf_ebx != 0); + goto have_smap; + } + + /* + * Some newer BIOSes have a broken INT 12H implementation + * which causes a kernel panic immediately. In this case, we + * need use the SMAP to determine the base memory size. + */ + hasbrokenint12 = 0; + TUNABLE_INT_FETCH("hw.hasbrokenint12", &hasbrokenint12); + if (hasbrokenint12 == 0) { + /* Use INT12 to determine base memory size. */ + vm86_intcall(0x12, &vmf); + basemem = vmf.vmf_ax; + basemem_setup(); } /* - * Perform "base memory" related probes & setup based on SMAP + * Fetch the memory map with INT 15:E820. Map page 1 R/W into + * the kernel page table so we can use it as a buffer. The + * kernel will unmap this page later. + */ + pmap_kenter(KERNBASE + (1 << PAGE_SHIFT), 1 << PAGE_SHIFT); + vmc.npages = 0; + smap = (void *)vm86_addpage(&vmc, 1, KERNBASE + (1 << PAGE_SHIFT)); + vm86_getptr(&vmc, (vm_offset_t)smap, &vmf.vmf_es, &vmf.vmf_di); + + vmf.vmf_ebx = 0; + do { + vmf.vmf_eax = 0xE820; + vmf.vmf_edx = SMAP_SIG; + vmf.vmf_ecx = sizeof(struct bios_smap); + i = vm86_datacall(0x15, &vmf, &vmc); + if (i || vmf.vmf_eax != SMAP_SIG) + break; + has_smap = 1; + if (!add_smap_entry(smap, physmap, &physmap_idx)) + break; + } while (vmf.vmf_ebx != 0); + +have_smap: + /* + * If we didn't fetch the "base memory" size from INT12, + * figure it out from the SMAP (or just guess). */ if (basemem == 0) { for (i = 0; i <= physmap_idx; i += 2) { @@ -1895,49 +1903,39 @@ int15e820: } } - /* - * XXX this function is horribly organized and has to the same - * things that it does above here. - */ + /* XXX: If we couldn't find basemem from SMAP, just guess. */ if (basemem == 0) basemem = 640; - if (basemem > 640) { - printf( - "Preposterous BIOS basemem of %uK, truncating to 640K\n", - basemem); - basemem = 640; - } - - /* - * Let vm86 scribble on pages between basemem and - * ISA_HOLE_START, as above. - */ - for (pa = trunc_page(basemem * 1024); - pa < ISA_HOLE_START; pa += PAGE_SIZE) - pmap_kenter(KERNBASE + pa, pa); - pte = (pt_entry_t *)vm86paddr; - for (i = basemem / 4; i < 160; i++) - pte[i] = (i << PAGE_SHIFT) | PG_V | PG_RW | PG_U; + basemem_setup(); } if (physmap[1] != 0) goto physmap_done; /* - * If we failed above, try memory map with INT 15:E801 + * If we failed to find an SMAP, figure out the extended + * memory size. We will then build a simple memory map with + * two segments, one for "base memory" and the second for + * "extended memory". Note that "extended memory" starts at a + * physical address of 1MB and that both basemem and extmem + * are in units of 1KB. + * + * First, try to fetch the extended memory size via INT 15:E801. */ vmf.vmf_ax = 0xE801; if (vm86_intcall(0x15, &vmf) == 0) { extmem = vmf.vmf_cx + vmf.vmf_dx * 64; } else { + /* + * If INT15:E801 fails, this is our last ditch effort + * to determine the extended memory size. Currently + * we prefer the RTC value over INT15:88. + */ #if 0 vmf.vmf_ah = 0x88; vm86_intcall(0x15, &vmf); extmem = vmf.vmf_ax; #else - /* - * Prefer the RTC value for extended memory. - */ extmem = rtcin(RTC_EXTLO) + (rtcin(RTC_EXTHI) << 8); #endif } From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 19:31:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF9E71065674; Tue, 12 Oct 2010 19:31:25 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE6168FC14; Tue, 12 Oct 2010 19:31:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CJVP2p059790; Tue, 12 Oct 2010 19:31:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CJVPnK059788; Tue, 12 Oct 2010 19:31:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010121931.o9CJVPnK059788@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 12 Oct 2010 19:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213747 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 19:31:25 -0000 Author: yongari Date: Tue Oct 12 19:31:25 2010 New Revision: 213747 URL: http://svn.freebsd.org/changeset/base/213747 Log: Protect bge(4) from accessing invalid NIC internal memory regions on BCM5906. Tested by: Buganini < buganini <> gmail dot com > Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Oct 12 19:28:33 2010 (r213746) +++ head/sys/dev/bge/if_bge.c Tue Oct 12 19:31:25 2010 (r213747) @@ -550,6 +550,10 @@ bge_readmem_ind(struct bge_softc *sc, in device_t dev; uint32_t val; + if (sc->bge_asicrev == BGE_ASICREV_BCM5906 && + off >= BGE_STATS_BLOCK && off < BGE_SEND_RING_1_TO_4) + return (0); + dev = sc->bge_dev; pci_write_config(dev, BGE_PCI_MEMWIN_BASEADDR, off, 4); @@ -563,6 +567,10 @@ bge_writemem_ind(struct bge_softc *sc, i { device_t dev; + if (sc->bge_asicrev == BGE_ASICREV_BCM5906 && + off >= BGE_STATS_BLOCK && off < BGE_SEND_RING_1_TO_4) + return; + dev = sc->bge_dev; pci_write_config(dev, BGE_PCI_MEMWIN_BASEADDR, off, 4); From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 20:22:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5073A106566C; Tue, 12 Oct 2010 20:22:17 +0000 (UTC) (envelope-from ben@wanderview.com) Received: from mail.wanderview.com (mail.wanderview.com [66.92.166.102]) by mx1.freebsd.org (Postfix) with ESMTP id EB3D78FC0A; Tue, 12 Oct 2010 20:22:16 +0000 (UTC) Received: from xykon.in.wanderview.com (xykon.in.wanderview.com [10.76.10.152]) (authenticated bits=0) by mail.wanderview.com (8.14.4/8.14.4) with ESMTP id o9CJjEeA030636 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 12 Oct 2010 19:45:14 GMT (envelope-from ben@wanderview.com) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Ben Kelly In-Reply-To: <201004151634.o3FGY7wX053198@svn.freebsd.org> Date: Tue, 12 Oct 2010 15:45:14 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <0168690D-7294-48FE-8223-1E3343CCC802@wanderview.com> References: <201004151634.o3FGY7wX053198@svn.freebsd.org> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1081) X-Spam-Score: -1.01 () ALL_TRUSTED,T_RP_MATCHES_RCVD X-Scanned-By: MIMEDefang 2.68 on 10.76.20.1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206665 - head/sys/geom/eli X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 20:22:17 -0000 On Apr 15, 2010, at 12:34 PM, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Thu Apr 15 16:34:06 2010 > New Revision: 206665 > URL: http://svn.freebsd.org/changeset/base/206665 >=20 > Log: > Use lower priority for GELI worker threads. This improves system > responsiveness under heavy GELI load. Sorry to reply to such an old commit, but I wanted to note that this = causes a regression on my server. It is probably fairly specific to my = setup, so it may not make sense to fix, but I thought I should at least = let you know. My server is an old i386 with a zfs pool on top of a geli partition. = When under heavy disk load the zfs subsystem can enter a message passing = loop between the txg and zio threads until any queued disk i/o is = flushed. With the geli worker threads at a lower priority this can lead = to livelock since geli never gets scheduled to perform the flush. =46rom = my previous debugging efforts I believe this can only be triggered if = the ARC is under heavy pressure and the processor is near, or at, 100% = CPU utilization. Here is the old thread on this issue: = http://old.nabble.com/-patch--zfs-livelock-and-thread-priorities-td2258702= 2.html On my local system I have simply reverted this change and bumped up the = priority on the geli worker threads to PVM to match the priority used by = the zio threads. Before doing this I could reliably trigger the = livelock by running my backup process. Anyway, its not clear to me what a good general purpose solution would = be. I just wanted to note the issue in case anyone else encounters it. Thanks. - Ben= From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 20:53:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84BCB106566C; Tue, 12 Oct 2010 20:53:12 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58BB08FC12; Tue, 12 Oct 2010 20:53:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CKrC8Q061640; Tue, 12 Oct 2010 20:53:12 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CKrCm9061636; Tue, 12 Oct 2010 20:53:12 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201010122053.o9CKrCm9061636@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 12 Oct 2010 20:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213748 - in head/sys: amd64/amd64 i386/i386 pc98/pc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 20:53:12 -0000 Author: jkim Date: Tue Oct 12 20:53:12 2010 New Revision: 213748 URL: http://svn.freebsd.org/changeset/base/213748 Log: Remove trailing ", " from `sysctl machdep.idle_available' output. Modified: head/sys/amd64/amd64/machdep.c head/sys/i386/i386/machdep.c head/sys/pc98/pc98/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Oct 12 19:31:25 2010 (r213747) +++ head/sys/amd64/amd64/machdep.c Tue Oct 12 20:53:12 2010 (r213748) @@ -795,7 +795,8 @@ idle_sysctl_available(SYSCTL_HANDLER_ARG if (strcmp(idle_tbl[i].id_name, "acpi") == 0 && cpu_idle_hook == NULL) continue; - p += sprintf(p, "%s, ", idle_tbl[i].id_name); + p += sprintf(p, "%s%s", p != avail ? ", " : "", + idle_tbl[i].id_name); } error = sysctl_handle_string(oidp, avail, 0, req); free(avail, M_TEMP); Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Oct 12 19:31:25 2010 (r213747) +++ head/sys/i386/i386/machdep.c Tue Oct 12 20:53:12 2010 (r213748) @@ -1432,7 +1432,8 @@ idle_sysctl_available(SYSCTL_HANDLER_ARG if (strcmp(idle_tbl[i].id_name, "acpi") == 0 && cpu_idle_hook == NULL) continue; - p += sprintf(p, "%s, ", idle_tbl[i].id_name); + p += sprintf(p, "%s%s", p != avail ? ", " : "", + idle_tbl[i].id_name); } error = sysctl_handle_string(oidp, avail, 0, req); free(avail, M_TEMP); Modified: head/sys/pc98/pc98/machdep.c ============================================================================== --- head/sys/pc98/pc98/machdep.c Tue Oct 12 19:31:25 2010 (r213747) +++ head/sys/pc98/pc98/machdep.c Tue Oct 12 20:53:12 2010 (r213748) @@ -1271,7 +1271,8 @@ idle_sysctl_available(SYSCTL_HANDLER_ARG if (strstr(idle_tbl[i].id_name, "mwait") && (cpu_feature2 & CPUID2_MON) == 0) continue; - p += sprintf(p, "%s, ", idle_tbl[i].id_name); + p += sprintf(p, "%s%s", p != avail ? ", " : "", + idle_tbl[i].id_name); } error = sysctl_handle_string(oidp, avail, 0, req); free(avail, M_TEMP); From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 21:01:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AAAC106566B; Tue, 12 Oct 2010 21:01:27 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 297638FC16; Tue, 12 Oct 2010 21:01:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CL1RoQ061934; Tue, 12 Oct 2010 21:01:27 GMT (envelope-from markm@svn.freebsd.org) Received: (from markm@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CL1Rcp061932; Tue, 12 Oct 2010 21:01:27 GMT (envelope-from markm@svn.freebsd.org) Message-Id: <201010122101.o9CL1Rcp061932@svn.freebsd.org> From: Mark Murray Date: Tue, 12 Oct 2010 21:01:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213749 - head/usr.sbin/mailwrapper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 21:01:27 -0000 Author: markm Date: Tue Oct 12 21:01:26 2010 New Revision: 213749 URL: http://svn.freebsd.org/changeset/base/213749 Log: Create the /bin/rmail symlink (which mailers such as postfix and Exim can use). This is something I thought I committed MONTHS ago, but it appears that I fatfingered it and made a local commit. Pass the pointy hat, please. Modified: head/usr.sbin/mailwrapper/Makefile Modified: head/usr.sbin/mailwrapper/Makefile ============================================================================== --- head/usr.sbin/mailwrapper/Makefile Tue Oct 12 20:53:12 2010 (r213748) +++ head/usr.sbin/mailwrapper/Makefile Tue Oct 12 21:01:26 2010 (r213749) @@ -22,6 +22,10 @@ SYMLINKS+= /usr/libexec/sendmail/sendmai .endif .endif +.if ${MK_MAILWRAPPER} != "no" && ${MK_SENDMAIL} == "no" +SYMLINKS+= ${BINDIR}/mailwrapper /bin/rmail +.endif + .if ${MK_MAILWRAPPER} != "no" .if !exists(${DESTDIR}/etc/mail/mailer.conf) FILES= ${.CURDIR}/../../etc/mail/mailer.conf From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 21:05:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 543A21065673 for ; Tue, 12 Oct 2010 21:05:07 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (unknown [IPv6:2001:ba8:0:1d5:216:d4ff:fe0d:d845]) by mx1.freebsd.org (Postfix) with ESMTP id E544B8FC16 for ; Tue, 12 Oct 2010 21:05:06 +0000 (UTC) Received: from uucp by gromit.grondar.org with UUCP (Exim 4.72) (envelope-from ) id 1P5m1y-0001SF-5y for svn-src-all@freebsd.org; Tue, 12 Oct 2010 22:05:06 +0100 Received: from localhost ([127.0.0.1] helo=groundzero.grondar.org) by groundzero.grondar.org with esmtp (Exim 4.72 (FreeBSD)) (envelope-from ) id 1P5m1Z-0004Lk-OQ; Tue, 12 Oct 2010 22:04:41 +0100 Message-Id: In-reply-to: <201010122101.o9CL1Rcp061932@svn.freebsd.org> References: <201010122101.o9CL1Rcp061932@svn.freebsd.org> From: Mark Murray Date: Tue, 12 Oct 2010 22:04:41 +0100 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213749 - head/usr.sbin/mailwrapper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 21:05:07 -0000 Mark Murray writes: > URL: http://svn.freebsd.org/changeset/base/213749 > > Log: > Create the /bin/rmail symlink (which mailers such as postfix > and Exim can use). > > This is something I thought I committed MONTHS ago, but it appears > that I fatfingered it and made a local commit. > > Pass the pointy hat, please. > > Modified: > head/usr.sbin/mailwrapper/Makefile Diligent prodding by: Alexander Leidinger M -- Mark R V Murray Cert APS(Open) Dip Phys(Open) BSc Open(Open) BSc(Hons)(Open) Pi: 132511160 From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 21:40:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB85A106566B; Tue, 12 Oct 2010 21:40:43 +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 D6A088FC14; Tue, 12 Oct 2010 21:40:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CLehOj062877; Tue, 12 Oct 2010 21:40:43 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CLehrL062868; Tue, 12 Oct 2010 21:40:43 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201010122140.o9CLehrL062868@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 12 Oct 2010 21:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213750 - in stable/7/tools/tools: mcgrab mctest nanobsd netrate/http netrate/httpd netrate/juggle X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 21:40:44 -0000 Author: gnn Date: Tue Oct 12 21:40:43 2010 New Revision: 213750 URL: http://svn.freebsd.org/changeset/base/213750 Log: MFC 177387,177388,177872,178456,179528,180394,186456,203800,204310,213327: r177387 A multicast test. The mctest program acts as both a source and a sink for multicast packets. Parameters for the interface, packet size, number of packets, and interpacket gap may be given on the command line. The sink records how many packets were missed, and at what time each packet arrived. r177388 Add the correct license. r177872 Add a manual page and a Makefile. Add code to reflect packets back from the sink so that we can measure round trip at the source. r178456 Updated the test to handle multiple sinks. The sinks cut their transmissions by the number of them running so that they do not overwhelm the source. Added a simple shell script to kick off sinks on multiple hosts as well as a source on the host where the shell script is run. The script also collects the output of all the sinks and the source into files named for the host on which the tests are run. A date is appended to each output file to make it unique per run. r179528 Update mctest and its associated script to have a base port to listen on so that multiple copies can be run easily. Update documentation with group and port arguments which are optional. r180394 Add a new program to the multicast test suite. The mcgrab program is used to grab and hold some number of multicast addresses in order to test what happens when an interface goes over the number of multicast addresses it can filter in hardware. r186456 Fix a bug in the man page where we were not showing the correct flags in the explanation. Several of the flags were -i, since it was a copy/paste operation. r203800 Fixed error checking of pthread(3) functions. r204310 Moved mcgrab(1) into a separate directory -- our .mk infrastructure doesn't currently have support for building multiple programs in a single makefile. While here, fixed manpages and makefiles (missing dependencies). r213327 Change the output of mctest to give a summary of the results instead of printing a long list. Add a default base port, and default mulitcast address to the runner script. Add support for specifying a different local and remote interface in the runner script. Added: stable/7/tools/tools/mcgrab/ - copied from r204310, head/tools/tools/mcgrab/ stable/7/tools/tools/mctest/ - copied from r177387, head/tools/tools/mctest/ stable/7/tools/tools/mctest/Makefile - copied, changed from r177872, head/tools/tools/mctest/Makefile stable/7/tools/tools/mctest/mctest.1 - copied, changed from r177872, head/tools/tools/mctest/mctest.1 stable/7/tools/tools/mctest/mctest_run.sh - copied, changed from r178456, head/tools/tools/mctest/mctest_run.sh Modified: stable/7/tools/tools/mctest/mctest.cc stable/7/tools/tools/mctest/mctest.h stable/7/tools/tools/netrate/http/http.c stable/7/tools/tools/netrate/httpd/httpd.c stable/7/tools/tools/netrate/juggle/juggle.c Directory Properties: stable/7/tools/tools/ (props changed) stable/7/tools/tools/aac/ (props changed) stable/7/tools/tools/crypto/ (props changed) stable/7/tools/tools/editing/ (props changed) stable/7/tools/tools/nanobsd/ (props changed) stable/7/tools/tools/nanobsd/FlashDevice.sub (props changed) stable/7/tools/tools/nanobsd/nanobsd.sh (props changed) stable/7/tools/tools/umastat/ (props changed) stable/7/tools/tools/usb/ (props changed) Copied and modified: stable/7/tools/tools/mctest/Makefile (from r177872, head/tools/tools/mctest/Makefile) ============================================================================== --- head/tools/tools/mctest/Makefile Thu Apr 3 05:26:54 2008 (r177872, copy source) +++ stable/7/tools/tools/mctest/Makefile Tue Oct 12 21:40:43 2010 (r213750) @@ -1,9 +1,7 @@ -# # $FreeBSD$ -# -# A Makefile that builds both the mctest program and its manual page. -PROG_CXX= mctest -LDADD+= -lpthread +PROG_CXX= mctest +DPADD= ${LIBPTHREAD} +LDADD= -lpthread .include Copied and modified: stable/7/tools/tools/mctest/mctest.1 (from r177872, head/tools/tools/mctest/mctest.1) ============================================================================== --- head/tools/tools/mctest/mctest.1 Thu Apr 3 05:26:54 2008 (r177872, copy source) +++ stable/7/tools/tools/mctest/mctest.1 Tue Oct 12 21:40:43 2010 (r213750) @@ -25,7 +25,7 @@ .\" $FreeBSD$ .\" .Dd April 3, 2008 -.Dt mctest 1 +.Dt MCTEST 1 .Os .Sh NAME .Nm mctest @@ -33,38 +33,57 @@ .Sh SYNOPSIS .Nm .Op Fl i Ar interface +.Op Fl g Ar group +.Op Fl b Ar base port .Op Fl n Ar number .Op Fl s Ar size .Op Fl t Ar inter-packet gap +.Op Fl M Ar number of clients (source only) +.Op Fl m Ar my client number (sink only) .Op Fl r .Sh DESCRIPTION -The +The .Nm -command implements a multicast test which involved a source -and a sink. The source sends packets to a pre-configured -multicast address over the interface given as a command line -argument. The sink listens for multicast packets, records -the time at which they're received and then reflects them back -over unicast to the source. When the source has captured all +command implements a multicast test which involves a source +and a sink. +The source sends packets to a pre-configured +multicast address over the interface given as a command line +argument. +The sink listens for multicast packets, records +the time at which they are received and then reflects them back +over unicast to the source. +When the source has captured all the reflected packets it prints out the round trip time of each. .Pp +The source prints out the round trip time of packets sent to the +sinks. The sink prints out the time between the packets received. .Pp The options are as follows: -.Bl -tag -width ".Fl d Ar argument" +.Bl -tag -width ".Fl i Ar interface" .It Fl i Ar interface -Network interface, which can be found with ifconfig(1). +Network interface, which can be found with +.Xr ifconfig 8 . +.It Fl g Ar group +Multicast group. +.It Fl b Ar base port +Port on which to listen. .It Fl s Ar size Packet size in bytes. .It Fl n Ar number Number of packets. .It Fl t Ar gap Inter-packet gap in nanoseconds. +.It Fl M Ar clients +The number of clients that are listening. +.It Fl m Ar my number +The client's number 0, 1, etc. .It Fl r This version of .Nm -is the receiver aka the sink. This option MUST -only be used with one copy of the program at a time. +is the receiver aka the sink. +This option MUST +only be used with one copy of the program at a time. .El .Sh EXAMPLES The following is an example of a typical usage @@ -73,20 +92,21 @@ of the command: .Pp Source -.Dl "mctest -i em0 -s 1024 -n 100 -t 1" +.Dl "mctest -i em0 -M 1 -s 1024 -n 100 -t 1" Sink -.Dl "mctest -i em0 -s 1024 -n 100 -r" +.Dl "mctest -i em0 -m 0 -s 1024 -n 100 -r" .Pp Send 100 packets of 1024 bytes, with an inter-packet gap of 1 nanosecond. .Pp -Gaps are measured with +Gaps are measured with .Xr nanosleep 2 , and so are not accurate down to nanoseconds -but depend on the setting of kern.hz. +but depend on the setting of +.Va kern.hz . .Sh SEE ALSO -.Xr ifconfig 8 , .Xr netstat 1 , -.Xr nanosleep 2 . +.Xr nanosleep 2 , +.Xr ifconfig 8 .Sh HISTORY The .Nm @@ -97,4 +117,5 @@ This manual page was written by .An George V. Neville-Neil Aq gnn@FreeBSD.org . .Sh BUGS -Should be reported to the author or to net@freebsd.org. +Should be reported to the author or to +.Aq net@FreeBSD.org . Modified: stable/7/tools/tools/mctest/mctest.cc ============================================================================== --- head/tools/tools/mctest/mctest.cc Wed Mar 19 12:44:23 2008 (r177387) +++ stable/7/tools/tools/mctest/mctest.cc Tue Oct 12 21:40:43 2010 (r213750) @@ -1,7 +1,28 @@ // +// Copyright 2008, George V. Neville-Neil // All rights reserved. // -// Author: George V. Neville-Neil +// +// 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. // // This is a relatively simple multicast test which can act as a // source and sink. The purpose of this test is to determine the @@ -17,6 +38,8 @@ __FBSDID("$FreeBSD$"); // C++ STL and other related includes #include #include +#include +#include // Operating System and other C based includes #include @@ -40,7 +63,7 @@ using namespace std; // void usage() { - cout << "mctest -i interface -g multicast group -s packet size -n number -t inter-packet gap\n"; + cout << "mctest [-r] -M clients -m client number -i interface -g multicast group -s packet size -n number -t inter-packet gap\n"; exit(-1); } @@ -65,13 +88,16 @@ void usage(string message) // @param group ///< multicast group // @param pkt_size ///< packet Size // @param number ///< number of packets we're expecting +// @param clients ///< total number of clients (N) +// @param client ///< our client number (0..N) // // @return 0 for 0K, -1 for error, sets errno // -int sink(char *interface, struct in_addr *group, int pkt_size, int number) { +int sink(char *interface, struct in_addr *group, int pkt_size, int number, + int clients, int client, short base_port) { - int sock; + int sock, backchan; socklen_t recvd_len; struct sockaddr_in local, recvd; struct ip_mreq mreq; @@ -90,6 +116,11 @@ int sink(char *interface, struct in_addr return (-1); } + if ((backchan = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + perror("failed to open back channel socket"); + return (-1); + } + strncpy(ifreq.ifr_name, interface, IFNAMSIZ); if (ioctl(sock, SIOCGIFADDR, &ifreq) < 0) { perror("no such interface"); @@ -138,6 +169,7 @@ int sink(char *interface, struct in_addr perror("setsockopt failed"); while (n < number) { + recvd_len = sizeof(recvd); if (recvfrom(sock, packet, pkt_size, 0, (struct sockaddr *)&recvd, &recvd_len) < 0) { if (errno == EWOULDBLOCK) @@ -145,6 +177,19 @@ int sink(char *interface, struct in_addr perror("recvfrom failed"); return -1; } + /* + * Bandwidth limiting. If there are N clients then we want + * 1/N packets from each, otherwise the clients will overwhelm + * the sender. + */ + if (n % clients == client) { + recvd.sin_port = htons(base_port + client); + if (sendto(backchan, packet, pkt_size, 0, + (struct sockaddr *)&recvd, sizeof(recvd)) < 0) { + perror("sendto failed"); + return -1; + } + } gettimeofday(&packets[ntohl(*(int *)packet)], 0); n++; } @@ -173,6 +218,73 @@ int sink(char *interface, struct in_addr } // +// Structure to hold thread arguments +// +struct server_args { + struct timeval *packets; ///< The timestamps of returning packets + int number; ///< Number of packets to expect. + int pkt_size; ///< Size of the packets + int client; ///< Which client we listen for +}; + +// +// server receives packets sent back from the sink +// +// @param passed ///< Arguments passed from the caller +// +// 0return always NULL +void* server(void *passed) { + + int sock, n =0; + struct timeval timeout; + struct sockaddr_in addr; + server_args *args = (server_args *)passed; + + timerclear(&timeout); + timeout.tv_sec = TIMEOUT; + + if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { + perror("could not open server socket"); + return NULL; + } + + bzero(&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = INADDR_ANY; + addr.sin_port = htons(args->client); + addr.sin_len = sizeof(addr); + + if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) { + perror("could not bind server socket"); + return NULL; + } + + if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &timeout, + sizeof(timeout)) < 0) + perror("setsockopt failed"); + + char packet[args->pkt_size]; + while (n < args->number) { + if (recvfrom(sock, &packet, args->pkt_size, 0, NULL, 0) < 0) { + if (errno == EWOULDBLOCK) + break; + perror("recvfrom failed"); + return NULL; + } + gettimeofday(&args->packets[ntohl(*(int *)packet)], 0); + n++; + } + + cout << "Packet Reflection Complete" << endl; + + if (n < args->number) + cout << "Missed " << args->number - n << " packets." << endl; + + return NULL; + +} + +// // transmit packets for the multicast test // // @param interface ///< text name of the interface (em0 etc.) @@ -180,11 +292,12 @@ int sink(char *interface, struct in_addr // @param pkt_size ///< packet size // @param number ///< number of packets // @param gap ///< inter packet gap in nano-seconds +// @param clients ///< number of clients we intend to run // // @return 0 for OK, -1 for error, sets errno // int source(char *interface, struct in_addr *group, int pkt_size, - int number, int gap) { + int number, int gap, int clients, short base_port) { int sock; struct sockaddr_in addr; @@ -247,6 +360,22 @@ int source(char *interface, struct in_ad *(int *)packets[i] = htonl(i); } + struct timeval sent[number]; + struct timeval received[clients][number]; + server_args args[clients]; + pthread_t thread[clients]; + + for (int i = 0;i < clients; i++) { + args[i].pkt_size = pkt_size; + args[i].packets = received[i]; + args[i].number = number / clients; + args[i].client = base_port + i; + if (pthread_create(&thread[i], NULL, server, &args[i]) != 0) { + perror("failed to create server thread"); + return -1; + } + } + struct timespec sleeptime; sleeptime.tv_sec = 0; sleeptime.tv_nsec = gap; @@ -257,12 +386,49 @@ int source(char *interface, struct in_ad perror("sendto failed"); return -1; } + gettimeofday(&sent[i], 0); if (gap > 0) if (nanosleep(&sleeptime, NULL) < 0) { perror("nanosleep failed"); return -1; } } + + for (int i = 0; i < clients; i++) { + if (pthread_join(thread[i], NULL) != 0) { + perror("failed to join thread"); + return -1; + } + } + + timeval result; + vector deltas; + double idx[] = { .0001, .001, .01, .1, .5, .9, .99, .999, .9999, 0.0 }; + + for (int client = 0;client < clients; client++) { + deltas.clear(); + cout << "Results from client #" << client << endl; + cout << "in usecs" << endl; + for (int i = 0; i < number; i++) { +// if (i % clients != client) +// continue; + if (&args[client].packets[i].tv_sec == 0) + continue; + timersub(&args[client].packets[i], &sent[i], &result); + deltas.push_back(result.tv_usec); +// cout << "sec: " << result.tv_sec; +// cout << " usecs: " << result.tv_usec << endl; + } + cout << "comparing %lu deltas" << long(deltas.size()) << endl; + cout << "number represents usecs of round-trip time" << endl; + sort(deltas.begin(), deltas.end()); + for (int i = 0; idx[i] != 0; ++i) { + printf("%s% 5d", (i == 0) ? "" : " ", + deltas[(int) (idx[i] * deltas.size())]); + } + printf("\n"); + } + return 0; } @@ -284,17 +450,20 @@ int main(int argc, char**argv) char ch; ///< character from getopt() extern char* optarg; ///< option argument - char* interface; ///< Name of the interface + char* interface = 0; ///< Name of the interface struct in_addr *group = NULL; ///< the multicast group address - int pkt_size; ///< packet size - int gap; ///< inter packet gap (in nanoseconds) - int number; ///< number of packets to transmit - bool server = false; + int pkt_size = 0; ///< packet size + int gap = 0; ///< inter packet gap (in nanoseconds) + int number = 0; ///< number of packets to transmit + bool server = false; ///< are we on he receiving end of multicast + int client = 0; ///< for receivers which client are we + int clients = 1; ///< for senders how many clients are there + short base_port = SERVER_PORT; ///< to have multiple copies running at once - if (argc < 2 || argc > 11) + if (argc < 2 || argc > 16) usage(); - while ((ch = getopt(argc, argv, "g:i:n:s:t:rh")) != -1) { + while ((ch = getopt(argc, argv, "M:m:g:i:n:s:t:b:rh")) != -1) { switch (ch) { case 'g': group = new (struct in_addr ); @@ -307,7 +476,7 @@ int main(int argc, char**argv) break; case 'n': number = atoi(optarg); - if (number < 0 || number > 10000) + if (number < 0 || number > INT_MAX) usage(argv[0] + string(" Error: ") + optarg + string(" number of packets out of range")); break; @@ -326,6 +495,15 @@ int main(int argc, char**argv) case 'r': server = true; break; + case 'm': + client = atoi(optarg); + break; + case 'M': + clients = atoi(optarg); + break; + case 'b': + base_port = atoi(optarg); + break; case 'h': usage(string("Help\n")); break; @@ -333,9 +511,15 @@ int main(int argc, char**argv) } if (server) { - sink(interface, group, pkt_size, number); + if (clients <= 0 || client < 0) + usage("must specify client (-m) and number of clients (-M)"); + sink(interface, group, pkt_size, number, clients, client, + base_port); } else { - source(interface, group, pkt_size, number, gap); + if (clients <= 0) + usage("must specify number of clients (-M)"); + source(interface, group, pkt_size, number, gap, clients, + base_port); } } Modified: stable/7/tools/tools/mctest/mctest.h ============================================================================== --- head/tools/tools/mctest/mctest.h Wed Mar 19 12:44:23 2008 (r177387) +++ stable/7/tools/tools/mctest/mctest.h Tue Oct 12 21:40:43 2010 (r213750) @@ -28,5 +28,6 @@ // const char* DEFAULT_GROUP = "239.255.255.1"; +const int SERVER_PORT = 9999; const int DEFAULT_PORT = 6666; const int TIMEOUT = 10; Copied and modified: stable/7/tools/tools/mctest/mctest_run.sh (from r178456, head/tools/tools/mctest/mctest_run.sh) ============================================================================== --- head/tools/tools/mctest/mctest_run.sh Thu Apr 24 06:56:45 2008 (r178456, copy source) +++ stable/7/tools/tools/mctest/mctest_run.sh Tue Oct 12 21:40:43 2010 (r213750) @@ -7,18 +7,19 @@ # Defaults size=1024 number=100 -group="" +base=9999 +group="239.255.255.101" interface="cxgb0" remote="ssh" -command="/sources/FreeBSD.CURRENT/src/tools/tools/mctest/mctest" +command="/zoo/tank/users/gnn/svn/Projects/head-exar/src/tools/tools/mctest/mctest" gap=1000 # Arguments are s (size), g (group), n (number), and c (command) followed # by a set of hostnames. -args=`getopt s:g:n:c:i: $*` +args=`getopt s:g:n:c:l:f:b: $*` if [ $? != 0 ] then - echo 'Usage: mctest_run -s size -g group -n number -c remote command host1 host2 hostN' + echo 'Usage: mctest_run -l local_interface -f foreign_interface -s size -g group -n number -c remote command host1 host2 hostN' exit 2 fi set == $args @@ -39,8 +40,14 @@ do -c) command=$3; shift 2;; - -i) - interface=$3; + -l) + local_interface=$3; + shift 2;; + -f) + foreign_interface=$3; + shift 2;; + -b) + base=$3; shift 2;; --) shift; break;; @@ -56,7 +63,7 @@ now=`date "+%Y%m%d%H%M"` for host in $* do output=$host\_$interface\_$size\_$number\.$now - $remote $host $command -r -M $# -m $current -n $number -s $size -i $interface > $output & + $remote $host $command -r -M $# -b $base -g $group -m $current -n $number -s $size -i $foreign_interface > $output & sleep 1 current=`expr $current + 1 `; done @@ -64,4 +71,4 @@ done # # Start the source/collector on this machine # -$command -M $# -n $number -s $size -i le1 -t $gap > `uname -n`\_$size\_$number\.$now +$command -M $# -b $base -g $group -n $number -s $size -i $local_interface -t $gap > `uname -n`\_$size\_$number\.$now Modified: stable/7/tools/tools/netrate/http/http.c ============================================================================== --- stable/7/tools/tools/netrate/http/http.c Tue Oct 12 21:01:26 2010 (r213749) +++ stable/7/tools/tools/netrate/http/http.c Tue Oct 12 21:40:43 2010 (r213750) @@ -300,15 +300,15 @@ main(int argc, char *argv[]) if (threaded) { if (pthread_barrier_init(&statep->start_barrier, NULL, - numthreads) < 0) - err(-1, "pthread_mutex_init"); + numthreads) != 0) + err(-1, "pthread_barrier_init"); } for (i = 0; i < numthreads; i++) { statep->hwd[i].hwd_count = 0; if (threaded) { if (pthread_create(&statep->hwd[i].hwd_thread, NULL, - http_worker, &statep->hwd[i]) < 0) + http_worker, &statep->hwd[i]) != 0) err(-1, "pthread_create"); } else { curthread = i; @@ -339,7 +339,7 @@ main(int argc, char *argv[]) for (i = 0; i < numthreads; i++) { if (threaded) { if (pthread_join(statep->hwd[i].hwd_thread, NULL) - < 0) + != 0) err(-1, "pthread_join"); } else { pid = waitpid(statep->hwd[i].hwd_pid, NULL, 0); Modified: stable/7/tools/tools/netrate/httpd/httpd.c ============================================================================== --- stable/7/tools/tools/netrate/httpd/httpd.c Tue Oct 12 21:01:26 2010 (r213749) +++ stable/7/tools/tools/netrate/httpd/httpd.c Tue Oct 12 21:40:43 2010 (r213750) @@ -280,7 +280,7 @@ main(int argc, char *argv[]) for (i = 0; i < THREADS; i++) { if (threaded) { if (pthread_create(&statep->hts[i].hts_thread, NULL, - httpd_worker, &statep->hts[i]) < 0) + httpd_worker, &statep->hts[i]) != 0) err(-1, "pthread_create"); } else { pid = fork(); @@ -299,7 +299,7 @@ main(int argc, char *argv[]) for (i = 0; i < THREADS; i++) { if (threaded) { if (pthread_join(statep->hts[i].hts_thread, NULL) - < 0) + != 0) err(-1, "pthread_join"); } else { pid = waitpid(statep->hts[i].hts_pid, NULL, 0); Modified: stable/7/tools/tools/netrate/juggle/juggle.c ============================================================================== --- stable/7/tools/tools/netrate/juggle/juggle.c Tue Oct 12 21:01:26 2010 (r213749) +++ stable/7/tools/tools/netrate/juggle/juggle.c Tue Oct 12 21:40:43 2010 (r213750) @@ -301,15 +301,15 @@ juggling_thread(void *arg) fd2 = *(int *)arg; - if (pthread_mutex_lock(&threaded_mtx) < 0) + if (pthread_mutex_lock(&threaded_mtx) != 0) err(-1, "juggling_thread: pthread_mutex_lock"); threaded_child_ready = 1; - if (pthread_cond_signal(&threaded_cond) < 0) + if (pthread_cond_signal(&threaded_cond) != 0) err(-1, "juggling_thread: pthread_cond_signal"); - if (pthread_mutex_unlock(&threaded_mtx) < 0) + if (pthread_mutex_unlock(&threaded_mtx) != 0) err(-1, "juggling_thread: pthread_mutex_unlock"); for (i = 0; i < NUMCYCLES; i++) { @@ -334,21 +334,21 @@ thread_juggle(int fd1, int fd2, int pipe threaded_pipeline = pipeline; - if (pthread_mutex_init(&threaded_mtx, NULL) < 0) + if (pthread_mutex_init(&threaded_mtx, NULL) != 0) err(-1, "thread_juggle: pthread_mutex_init"); - if (pthread_create(&thread, NULL, juggling_thread, &fd2) < 0) + if (pthread_create(&thread, NULL, juggling_thread, &fd2) != 0) err(-1, "thread_juggle: pthread_create"); - if (pthread_mutex_lock(&threaded_mtx) < 0) + if (pthread_mutex_lock(&threaded_mtx) != 0) err(-1, "thread_juggle: pthread_mutex_lock"); while (!threaded_child_ready) { - if (pthread_cond_wait(&threaded_cond, &threaded_mtx) < 0) + if (pthread_cond_wait(&threaded_cond, &threaded_mtx) != 0) err(-1, "thread_juggle: pthread_cond_wait"); } - if (pthread_mutex_unlock(&threaded_mtx) < 0) + if (pthread_mutex_unlock(&threaded_mtx) != 0) err(-1, "thread_juggle: pthread_mutex_unlock"); if (clock_gettime(CLOCK_REALTIME, &tstart) < 0) @@ -369,7 +369,7 @@ thread_juggle(int fd1, int fd2, int pipe if (clock_gettime(CLOCK_REALTIME, &tfinish) < 0) err(-1, "thread_juggle: clock_gettime"); - if (pthread_join(thread, NULL) < 0) + if (pthread_join(thread, NULL) != 0) err(-1, "thread_juggle: pthread_join"); timespecsub(&tfinish, &tstart); From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 21:45:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD091106564A; Tue, 12 Oct 2010 21:45:36 +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 AAAF08FC1B; Tue, 12 Oct 2010 21:45:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CLjapx063020; Tue, 12 Oct 2010 21:45:36 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CLjaRZ063018; Tue, 12 Oct 2010 21:45:36 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201010122145.o9CLjaRZ063018@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 12 Oct 2010 21:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213751 - stable/7/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 21:45:36 -0000 Author: gnn Date: Tue Oct 12 21:45:36 2010 New Revision: 213751 URL: http://svn.freebsd.org/changeset/base/213751 Log: MFC 213409: Fix two aliases that had the same name but were pointing to different events. These are now disamiguated. Modified: stable/7/sys/dev/hwpmc/pmc_events.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/hwpmc/pmc_events.h ============================================================================== --- stable/7/sys/dev/hwpmc/pmc_events.h Tue Oct 12 21:40:43 2010 (r213750) +++ stable/7/sys/dev/hwpmc/pmc_events.h Tue Oct 12 21:45:36 2010 (r213751) @@ -2243,11 +2243,11 @@ __PMC_EV_ALIAS("UOPS_RETIRED.MACRO_FUSED __PMC_EV_ALIAS("MACHINE_CLEARS.CYCLES", IAP_EVENT_C3H_01H) \ __PMC_EV_ALIAS("MACHINE_CLEARS.MEM_ORDER", IAP_EVENT_C3H_02H) \ __PMC_EV_ALIAS("MACHINE_CLEARS.SMC", IAP_EVENT_C3H_04H) \ -__PMC_EV_ALIAS("BR_INST_RETIRED.ALL_BRANCHES", IAP_EVENT_C4H_00H) \ +__PMC_EV_ALIAS("BR_INST_RETIRED.ANY_P", IAP_EVENT_C4H_00H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.CONDITIONAL", IAP_EVENT_C4H_01H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.NEAR_CALL", IAP_EVENT_C4H_02H) \ __PMC_EV_ALIAS("BR_INST_RETIRED.ALL_BRANCHES", IAP_EVENT_C4H_04H) \ -__PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_00H) \ +__PMC_EV_ALIAS("BR_MISP_RETIRED.ANY_P", IAP_EVENT_C5H_00H) \ __PMC_EV_ALIAS("BR_MISP_RETIRED.CONDITIONAL", IAP_EVENT_C5H_01H) \ __PMC_EV_ALIAS("BR_MISP_RETIRED.NEAR_CALL", IAP_EVENT_C5H_02H) \ __PMC_EV_ALIAS("BR_MISP_RETIRED.ALL_BRANCHES", IAP_EVENT_C5H_04H) \ From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 22:09:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 538D2106564A; Tue, 12 Oct 2010 22:09:35 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 426B98FC08; Tue, 12 Oct 2010 22:09:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CM9ZFX063566; Tue, 12 Oct 2010 22:09:35 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CM9ZkW063564; Tue, 12 Oct 2010 22:09:35 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201010122209.o9CM9ZkW063564@svn.freebsd.org> From: Randall Stewart Date: Tue, 12 Oct 2010 22:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213752 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 22:09:35 -0000 Author: rrs Date: Tue Oct 12 22:09:33 2010 New Revision: 213752 URL: http://svn.freebsd.org/changeset/base/213752 Log: This commit removes Bruce Cran from mentiship ;-) Congratulations Bruce keep up the good work. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Oct 12 21:45:36 2010 (r213751) +++ svnadmin/conf/mentors Tue Oct 12 22:09:33 2010 (r213752) @@ -14,7 +14,6 @@ ae mav Co-mentor: kib anchie bz andreast nwhitehorn andrew imp -brucec rrs dchagin kib dim rpaulo Co-mentor: ed eri mlaier Co-mentor: thompsa From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 22:10:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 523291065672; Tue, 12 Oct 2010 22:10:08 +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 3F2A88FC14; Tue, 12 Oct 2010 22:10:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CMA8Dm063622; Tue, 12 Oct 2010 22:10:08 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CMA8WN063620; Tue, 12 Oct 2010 22:10:08 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201010122210.o9CMA8WN063620@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 12 Oct 2010 22:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213753 - stable/8/usr.sbin/pmccontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 22:10:08 -0000 Author: gnn Date: Tue Oct 12 22:10:07 2010 New Revision: 213753 URL: http://svn.freebsd.org/changeset/base/213753 Log: MFC 213691: Add code to print the number and type of the CPU that is present in the system as well has how many PMCs there are per CPU. In this code CPU and core are equivalent. Modified: stable/8/usr.sbin/pmccontrol/pmccontrol.c Directory Properties: stable/8/usr.sbin/pmccontrol/ (props changed) Modified: stable/8/usr.sbin/pmccontrol/pmccontrol.c ============================================================================== --- stable/8/usr.sbin/pmccontrol/pmccontrol.c Tue Oct 12 22:09:33 2010 (r213752) +++ stable/8/usr.sbin/pmccontrol/pmccontrol.c Tue Oct 12 22:10:07 2010 (r213753) @@ -243,6 +243,10 @@ pmcc_do_list_state(void) if (pmc_cpuinfo(&pc) != 0) err(EX_OSERR, "Unable to determine CPU information"); + printf("%d %s CPUs present, with %d PMCs per CPU\n", pc->pm_ncpu, + pmc_name_of_cputype(pc->pm_cputype), + pc->pm_npmc); + dummy = sizeof(logical_cpus_mask); if (sysctlbyname("machdep.logical_cpus_mask", &logical_cpus_mask, &dummy, NULL, 0) < 0) From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 22:11:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B968E106564A; Tue, 12 Oct 2010 22:11:31 +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 A6E478FC13; Tue, 12 Oct 2010 22:11:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9CMBVn3063712; Tue, 12 Oct 2010 22:11:31 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9CMBVTX063710; Tue, 12 Oct 2010 22:11:31 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201010122211.o9CMBVTX063710@svn.freebsd.org> From: "George V. Neville-Neil" Date: Tue, 12 Oct 2010 22:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213754 - stable/7/usr.sbin/pmccontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 22:11:31 -0000 Author: gnn Date: Tue Oct 12 22:11:31 2010 New Revision: 213754 URL: http://svn.freebsd.org/changeset/base/213754 Log: MFC 213691: Add code to print the number and type of the CPU that is present in the system as well has how many PMCs there are per CPU. In this code CPU and core are equivalent. Modified: stable/7/usr.sbin/pmccontrol/pmccontrol.c Directory Properties: stable/7/usr.sbin/pmccontrol/ (props changed) Modified: stable/7/usr.sbin/pmccontrol/pmccontrol.c ============================================================================== --- stable/7/usr.sbin/pmccontrol/pmccontrol.c Tue Oct 12 22:10:07 2010 (r213753) +++ stable/7/usr.sbin/pmccontrol/pmccontrol.c Tue Oct 12 22:11:31 2010 (r213754) @@ -243,6 +243,10 @@ pmcc_do_list_state(void) if (pmc_cpuinfo(&pc) != 0) err(EX_OSERR, "Unable to determine CPU information"); + printf("%d %s CPUs present, with %d PMCs per CPU\n", pc->pm_ncpu, + pmc_name_of_cputype(pc->pm_cputype), + pc->pm_npmc); + dummy = sizeof(logical_cpus_mask); if (sysctlbyname("machdep.logical_cpus_mask", &logical_cpus_mask, &dummy, NULL, 0) < 0) From owner-svn-src-all@FreeBSD.ORG Tue Oct 12 22:43:18 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06D44106566B; Tue, 12 Oct 2010 22:43:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 78A278FC0C; Tue, 12 Oct 2010 22:43:17 +0000 (UTC) Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au (c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o9CMhEJZ007374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Oct 2010 09:43:14 +1100 Date: Wed, 13 Oct 2010 09:43:14 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov In-Reply-To: <201010100705.o9A75lrf073546@svn.freebsd.org> Message-ID: <20101013094301.H1075@besplex.bde.org> References: <201010100705.o9A75lrf073546@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r213664 - in head/sys: fs/cd9660 fs/hpfs fs/msdosfs fs/ntfs gnu/fs/reiserfs kern sys ufs/ffs ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2010 22:43:18 -0000 On Sun, 10 Oct 2010, Konstantin Belousov wrote: > Log: > The r184588 changed the layout of struct export_args, causing an ABI > breakage for old mount(2) syscall, since most struct _args > embed export_args. The mount(2) is supposed to provide ABI > compatibility for pre-nmount mount(8) binaries, so restore ABI to > pre-r184588. > > Requested and reviewed by: bde > MFC after: 2 weeks Thanks. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 00:07:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E29C0106566B; Wed, 13 Oct 2010 00:07:10 +0000 (UTC) (envelope-from 20080111.freebsd.org@ab.ote.we.lv) Received: from mx2.nttmcl.com (MX2.nttmcl.com [216.69.68.200]) by mx1.freebsd.org (Postfix) with ESMTP id C2D178FC0C; Wed, 13 Oct 2010 00:07:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx2.nttmcl.com (Postfix) with ESMTP id A4D094DDA5; Tue, 12 Oct 2010 16:47:09 -0700 (PDT) X-Spam-Flag: NO X-Spam-Score: -1.821 X-Spam-Level: X-Spam-Status: No, score=-1.821 tagged_above=-999 required=5 tests=[ALL_TRUSTED=-1.8, AWL=1.079, BAYES_00=-2.599, FROM_STARTS_WITH_NUMS=1.499] autolearn=no Received: from mx2.nttmcl.com ([127.0.0.1]) by localhost (mx2.nttmcl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q4+KS8WDzyDu; Tue, 12 Oct 2010 16:47:09 -0700 (PDT) Received: from [216.69.70.67] (dyn-v6-67.nttmcl.com [216.69.70.67]) by mx2.nttmcl.com (Postfix) with ESMTPS id 415E74DD93; Tue, 12 Oct 2010 16:47:09 -0700 (PDT) Message-ID: <4CB4F343.2000705@ab.ote.we.lv> Date: Tue, 12 Oct 2010 16:46:11 -0700 From: "Eugene M. Kim" <20080111.freebsd.org@ab.ote.we.lv> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.9) Gecko/20100915 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: svn-src-all@freebsd.org References: <201010030812.o938CH8S068342@svn.freebsd.org> In-Reply-To: <201010030812.o938CH8S068342@svn.freebsd.org> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Hans Petter Selasky Subject: svnsync broken, workaround available (was Re: svn commit: r213379 - head/sys/dev/usb/controller) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 00:07:11 -0000 This commit (r213379) has a couple of stray/toxic directory properties, with an equal sign ("=") in their name, e.g. "svn:keywords=FreeBSD=%H" whose value is "xhci.c" :-p. Running svnsync to mirror this revision to a remote repository over DAV (http: or https:) will result in "400 Bad Request". Unaffected are non-DAV schemes, e.g. svn:, svn+ssh:. Symptom: svnsync fails with the following error message: "svnsync: Server sent unexpected return value (400 Bad Request) in response to PROPPATCH request" Cause (for the curious): svnsync tries to copy the toxic properties by creating a PROPPATCH request with ill-formed XML elements, e.g. "xhci.c". Apache mod_dav catches this and rejects the request. Workaround: Remove svn:sync-currently-copying revprop at revision 0 in the destination (mirror) repository, then run "svnsync sync" manually once, accessing the destination repository via svnserve (svn: or svn+ssh:) instead of the usual DAV scheme. Once svnsync successfully replicates the problematic revision, the DAV scheme can be used again. As for how those names have passed the first line of check (in libsvn_client), I have no idea... I wonder, however, if it is possible to perform a repo surgery to remove these properties. Regards, Eugene From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 00:21:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4862E106566C; Wed, 13 Oct 2010 00:21:54 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B7CC8FC0A; Wed, 13 Oct 2010 00:21:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9D0LspE066878; Wed, 13 Oct 2010 00:21:54 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9D0LrcK066875; Wed, 13 Oct 2010 00:21:53 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201010130021.o9D0LrcK066875@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 13 Oct 2010 00:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213755 - in head: share/man/man4 sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 00:21:54 -0000 Author: jkim Date: Wed Oct 13 00:21:53 2010 New Revision: 213755 URL: http://svn.freebsd.org/changeset/base/213755 Log: Use AcpiReset() from ACPICA instead of rolling our own, which is actually incomplete. If FADT says the register is available, enable the capability by default. Remove the previous default value from acpi(4). Modified: head/share/man/man4/acpi.4 head/sys/dev/acpica/acpi.c Modified: head/share/man/man4/acpi.4 ============================================================================== --- head/share/man/man4/acpi.4 Tue Oct 12 22:11:31 2010 (r213754) +++ head/share/man/man4/acpi.4 Wed Oct 13 00:21:53 2010 (r213755) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 2, 2010 +.Dd October 12, 2010 .Dt ACPI 4 .Os .Sh NAME @@ -112,7 +112,6 @@ exiting to legacy mode first. Default is 0, leave ACPI enabled. .It Va hw.acpi.handle_reboot Use the ACPI Reset Register capability to reboot the system. -Default is 0, use legacy reboot support. Some newer systems require use of this register, while some only work with legacy rebooting support. .It Va hw.acpi.lid_switch_state Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Tue Oct 12 22:11:31 2010 (r213754) +++ head/sys/dev/acpica/acpi.c Wed Oct 13 00:21:53 2010 (r213755) @@ -587,6 +587,10 @@ acpi_attach(device_t dev) freeenv(env); } + /* Only enable reboot by default if the FADT says it is available. */ + if (AcpiGbl_FADT.Flags & ACPI_FADT_RESET_REGISTER) + sc->acpi_handle_reboot = 1; + /* Only enable S4BIOS by default if the FACS says it is available. */ if (AcpiGbl_FACS->Flags & ACPI_FACS_S4_BIOS_PRESENT) sc->acpi_s4bios = 1; @@ -1819,19 +1823,15 @@ acpi_shutdown_final(void *arg, int howto DELAY(1000000); device_printf(sc->acpi_dev, "power-off failed - timeout\n"); } - } else if ((howto & RB_HALT) == 0 && - (AcpiGbl_FADT.Flags & ACPI_FADT_RESET_REGISTER) && - sc->acpi_handle_reboot) { + } else if ((howto & RB_HALT) == 0 && sc->acpi_handle_reboot) { /* Reboot using the reset register. */ - status = AcpiWrite( - AcpiGbl_FADT.ResetValue, &AcpiGbl_FADT.ResetRegister); - if (ACPI_FAILURE(status)) - device_printf(sc->acpi_dev, "reset failed - %s\n", - AcpiFormatException(status)); - else { + status = AcpiReset(); + if (ACPI_SUCCESS(status)) { DELAY(1000000); device_printf(sc->acpi_dev, "reset failed - timeout\n"); - } + } else if (status != AE_NOT_EXIST) + device_printf(sc->acpi_dev, "reset failed - %s\n", + AcpiFormatException(status)); } else if (sc->acpi_do_disable && panicstr == NULL) { /* * Only disable ACPI if the user requested. On some systems, writing From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 00:29:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51574106566C; Wed, 13 Oct 2010 00:29:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id C4A258FC19; Wed, 13 Oct 2010 00:29:12 +0000 (UTC) Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au (c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o9D0T8Y3025830 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Oct 2010 11:29:09 +1100 Date: Wed, 13 Oct 2010 11:29:08 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gennady Proskurin In-Reply-To: <20101012210804.GA4286@gpr.nnz-home.ru> Message-ID: <20101013094338.U1075@besplex.bde.org> References: <201010090807.o9987nG0030939@svn.freebsd.org> <20101009191600.N3531@besplex.bde.org> <4CB03A82.6040701@freebsd.org> <20101012210804.GA4286@gpr.nnz-home.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans , Andriy Gapon Subject: Re: svn commit: r213648 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 00:29:13 -0000 On Wed, 13 Oct 2010, Gennady Proskurin wrote: > On Sat, Oct 09, 2010 at 12:48:50PM +0300, Andriy Gapon wrote: >> on 09/10/2010 12:33 Bruce Evans said the following: >>> On Sat, 9 Oct 2010, Andriy Gapon wrote: >[>]*... >>> Now, why don't the partial memory barriers prevent caching the variable? >>> >>> % if (panic_cpu != PCPU_GET(cpuid)) >>> % while (atomic_cmpset_int(&panic_cpu, NOCPU, >>> % PCPU_GET(cpuid)) == 0) >>> % while (panic_cpu != NOCPU) >>> % ; /* nothing */ >>> >>> The very first access can't reasonably use a cachec value. atomic_cmpset() So the first access doesn't need a compiler-type memory barrier. Not needing a CPU-type one is more subtle -- see below. >>> can change panic_cpu, so even without the memory barrier, panic_cpu must >>> be reloaded for the third access the first time. But then when the third >>> access is repeated in the second while loop, the missing atomic op with >>> barrier makes things very broken. panic_cpu isn't changed by the loop, >>> and the compiler thinks that it isn't changed by anything else either, so >>> the compiler may reduce the loop to: >>> >>> % if (panic_cpu != NOCPU) >>> % for (;;) >>> % ; /* nothing */ >> >> >> Yes, it's exactly the last loop that had the problem. >> On amd64 with -O2: >> .loc 1 544 0 >> movl panic_cpu(%rip), %eax >> .LVL134: >> .p2align 4,,7 >> .L210: >> cmpl $255, %eax >> jne .L210 >> jmp .L225 >> >>> except I've seen claims that even an endless for loop can be optimized >>> to nothing. Declaring panic_cpu as volatile prevents the compiler doing >>> this, but I think it is insufficient. We really do want to see panic_cpu >>> changed by other CPUs, and what is the point of atomic_load_acq*() if not >>> to use for this -- if declaring things volatile were sufficient, then we >>> could just use *(volatile *)&var. atomic_load/store_acq/rel*() on i386 >> >> I discussed this with kib and the idea is that atomic operation is not needed in >> that place and volatile is sufficient, because we don't need barrier semantics >> there and only want to ensure that variable is reloaded from memory. > > If I understand correctly, without acquiring barrier, variable is not > guaranteed to be loaded from memory, it can end up with some stale value from > cpu's cache or pipeline. If incorrect value will be checked in the first "if" > operator, it can lead to skiping all the atomic synchronization. > The same about writing to variable, without barrier new value may be written to > some local cpu cache and not be seen by readers until it is flushed from cache. That's what I was thinking. Now I think the only problem is that not locking everything just makes the correctness very hard to understand, and it shouldn't be done since this code is as far as possible from needing to be efficient. If the access in the inner while loop sees a stale value, then there is no problem provided the value eventually becomes unstale or just changes to a different stale value -- then we exit the inner loop and go back to the locked access in the outer loop. The access before the outer loop can at most see a stale value which doesn't matter. Only the current CPU can set panic_cpu to PCPU_GET(cpuid)). When panic() is called with panic_cpu having this value, it means that the panic is recursive (since panic_cpu is initially NOCPU, and the current CPU doesn't/shouldn't change it to anything but itself). For recursive panics, the current CPU should already have locked everything and stopped other CPUs). It doesn't need to lock against itself, and it needs the test using the first access to avoid deadlocking against itself. When panic() is called with panic_cpu = NOCPU and this value is not stale, then there is no problem. When panic() is called with panic_cpu = NOCPU and this value is stale, it means that one CPU entered and left panic() and set the value to NOCPU, but another CPU has entered panic() and set the value to !NOCPU but we haven't seen this yet. Then we reach the outer while loop expecting to acquire the lock, but when we try to acquire it we don't get it, and there is no problem. Finally, when when panic() is called with panic_cpu = another_cpu, there is similarly no problem, whether or not this value is stale. Then we reach the outer while loop expecting not to acquire the lock, but we may sometimes acquire it, even on the first try, if the value was stale or if it just became stale after we read it. Perhaps my rule for locking read accesses may allow/require the complexity in the above. It is, never lock read accesses, since the value may be stale after you read it, whether or not you locked the access. It is only in delicate cases, where you need a value that is non-stale at the time of the access but are happy with a value that is stale later, that locking a read access is useful. The panic locking could be written using only standard complications using a recursive mutex (or trylock), except then it might have to fight with the mutex implementation doing more than the simple spin: mtx_lock_spin(&panic_mtx); /* * Already have a problem -- the implementation disable interrupts, * which we should want, but since we do wrong things like syncing * with normal i/o expected to work, we probably need interrupts. */ It's interesting that the implementation of mutexes doesn't optimize for the unusual case of a mutex being recursed on, but we do that here. We could be more like the mutex implementation and do: while (atomic_cmpset_int(&panic_cpu, NOCPU, PCPU_GET(cpuid)) == 0) { if (panic_cpu == PCPU_GET(cpuid)) break; /* recursive */ while (panic_cpu != NOCPU) continue; } > > This also applies to r213736. > >> atomic_store_rel at the end seems to be needed because of inter-dependency >> between panicstr and panic_cpu. That is we want changes to panicstr to becomes >> visible at the same time (before actually) changes to panic_cpu are visible. There are similar but larger complications for debugger entry. Debugger entry has the additional problem that a thundering herd of CPUs may enter at a breakpoint, or at any debugger trap with handling necessary but normal handling not possible. Debuggers entr has the additional non-problem that it at least tries to stop other CPUs before proceeding far. My i386 ddb entry starts a bit like the above: % ef = read_eflags(); % disable_intr(); % if (atomic_cmpset_int(&kdb_trap_lock, NOCPU, PCPU_GET(cpuid)) == 0 && % kdb_trap_lock != PCPU_GET(cpuid)) { It has the anti-recursion detection in the same if statement as the cmpset. % while (atomic_cmpset_int(&output_lock, 0, 1) == 0) % ; % db_printf( % "concurrent ddb entry: type %d trap, code=%x cpu=%d\n", % type, code, PCPU_GET(cpuid)); % atomic_store_rel_int(&output_lock, 0); Another lock to serialize output for debugging this stuff. Thundering herds at breakpoints are very easy to arrange, and they will interleave their output almost perfectly with some console drivers (say, a serial console at 50 bps so that you can easily watch the problem; this is also a good test for console drivers). Elsewhere I posted a similar method for properly serializing plain printf output. That bounds the time for the output so it might not work on 50 bps consoles. The above has no bound and depends on db_printf() never blocking endlessly even under fire from places like here. % if (type == T_BPTFLT) % regs->tf_eip--; This backs of from the breakpoint. It is not MI enough. Some nut might have put a 2-byte breakpoint instruction in the instruction stream. Then the breakpoint won't belong to us, so not handling it here would be correct. Backing off 2 would work OK too (it allows the instruction to trap again). Backing of 1 backs into it and corrupts it. Backing off 1 works OK in the same way as when the breakpoint is not ours. Backing off 1 here handles the case where the breakpoint is ours now but will go away because another ddb entry proceeds and removes it. % else { % while (atomic_cmpset_int(&output_lock, 0, 1) == 0) % ; % db_printf( % "concurrent ddb entry on non-breakpoint: too hard to handle properly\n"); % atomic_store_rel_int(&output_lock, 0); % } More debugging. % while (atomic_load_acq_int(&kdb_trap_lock) != NOCPU) % ; This corresponds to the inner while loop in panic(). According to the above discussion, I don't need the atomic op here. I should use pause() here. % write_eflags(ef); panic() doesn't disable interrupts, especially in the inner while loop. Interrupts must be kept disabled to avoid them doing bad things including recursive debugger and/or panic entries, although masking of all interrupts breaks sending of most IPIS. % return (1); % } % // Proceed to stopping CPUs... Since some CPUs may be looping with % // interrupts masked, either in the above loop or accidentally, the % // old method of sending maskable IPIs may block us endlessly. I % // use a hack to work around this. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 00:56:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D0BD1065672; Wed, 13 Oct 2010 00:56:26 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 196CB8FC0C; Wed, 13 Oct 2010 00:56:25 +0000 (UTC) Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au (c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o9D0uMxe006140 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Oct 2010 11:56:23 +1100 Date: Wed, 13 Oct 2010 11:56:22 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jaakko Heinonen In-Reply-To: <201010121558.o9CFwqJi052497@svn.freebsd.org> Message-ID: <20101013112920.R1075@besplex.bde.org> References: <201010121558.o9CFwqJi052497@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213725 - head/sys/fs/devfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 00:56:26 -0000 On Tue, 12 Oct 2010, Jaakko Heinonen wrote: > Log: > Format prototypes to follow style(9) more closely. > > Discussed with: kib, phk Thanks, but style(9) says "The kernel has a name associated with parameter types [sic]", and the old prototypes mostly used named parameters. [The reason for this rule is that it is normal to name parameters in prototypes, and this was done in about half the cases in the kernel, while in userland some programmers don't like and/or understand the underscores necessary to keep parameter names in the implementation namespace, and named parameters were used in less than half the cases outside of the kernel and many of those were broken, so the rule was that "Only the kernel has a name associated with the types", and although I changed style(9) to say to prefer names in the implementation namespace in userland, style(9) is rarely read and more rarely followed, so no one noticed my change :-).] > Modified: head/sys/fs/devfs/devfs.h > ============================================================================== > --- head/sys/fs/devfs/devfs.h Tue Oct 12 15:48:27 2010 (r213724) > +++ head/sys/fs/devfs/devfs.h Tue Oct 12 15:58:52 2010 (r213725) > @@ -178,22 +178,25 @@ extern unsigned devfs_rule_depth; > #define DEVFS_DEL_VNLOCKED 0x01 > #define DEVFS_DEL_NORECURSE 0x02 > > -void devfs_rules_apply(struct devfs_mount *dm, struct devfs_dirent *de); > -void devfs_rules_cleanup (struct devfs_mount *dm); > -int devfs_rules_ioctl(struct devfs_mount *dm, u_long cmd, caddr_t data, struct thread *td); > -int devfs_allocv(struct devfs_dirent *de, struct mount *mp, int lockmode, > - struct vnode **vpp); > -char *devfs_fqpn(char *, struct devfs_mount *, struct devfs_dirent *, > - struct componentname *); > ... > +void devfs_rules_apply(struct devfs_mount *, struct devfs_dirent *); > +void devfs_rules_cleanup(struct devfs_mount *); > +int devfs_rules_ioctl(struct devfs_mount *, u_long, caddr_t, > + struct thread *); > +int devfs_allocv(struct devfs_dirent *, struct mount *, int, > + struct vnode **); > +char *devfs_fqpn(char *, struct devfs_mount *, struct devfs_dirent *, > + struct componentname *); It was just ugly to use parameter names in some places but not others. They were missing mainly for the last function quoted above. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 00:57:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45AEE1065672; Wed, 13 Oct 2010 00:57:15 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 338408FC0A; Wed, 13 Oct 2010 00:57:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9D0vFJR067739; Wed, 13 Oct 2010 00:57:15 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9D0vFkI067735; Wed, 13 Oct 2010 00:57:15 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201010130057.o9D0vFkI067735@svn.freebsd.org> From: Rick Macklem Date: Wed, 13 Oct 2010 00:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213756 - head/sys/rpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 00:57:15 -0000 Author: rmacklem Date: Wed Oct 13 00:57:14 2010 New Revision: 213756 URL: http://svn.freebsd.org/changeset/base/213756 Log: Fix the krpc so that it can handle NFSv3,UDP mounts with a read/write data size greater than 8192. Since soreserve(so, 256*1024, 256*1024) would always fail for the default value of sb_max, modify clnt_dg.c so that it uses the calculated values and checks for an error return from soreserve(). Also, add a check for error return from soreserve() to clnt_vc.c and change __rpc_get_t_size() to use sb_max_adj instead of the bogus maxsize == 256*1024. PR: kern/150910 Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/rpc/clnt_dg.c head/sys/rpc/clnt_vc.c head/sys/rpc/rpc_generic.c Modified: head/sys/rpc/clnt_dg.c ============================================================================== --- head/sys/rpc/clnt_dg.c Wed Oct 13 00:21:53 2010 (r213755) +++ head/sys/rpc/clnt_dg.c Wed Oct 13 00:57:14 2010 (r213756) @@ -193,6 +193,7 @@ clnt_dg_create( struct rpc_msg call_msg; struct __rpc_sockinfo si; XDR xdrs; + int error; if (svcaddr == NULL) { rpc_createerr.cf_stat = RPC_UNKNOWNADDR; @@ -267,7 +268,12 @@ clnt_dg_create( */ cu->cu_closeit = FALSE; cu->cu_socket = so; - soreserve(so, 256*1024, 256*1024); + error = soreserve(so, (u_long)sendsz, (u_long)recvsz); + if (error != 0) { + rpc_createerr.cf_stat = RPC_FAILED; + rpc_createerr.cf_error.re_errno = error; + goto err2; + } sb = &so->so_rcv; SOCKBUF_LOCK(&so->so_rcv); Modified: head/sys/rpc/clnt_vc.c ============================================================================== --- head/sys/rpc/clnt_vc.c Wed Oct 13 00:21:53 2010 (r213755) +++ head/sys/rpc/clnt_vc.c Wed Oct 13 00:57:14 2010 (r213756) @@ -288,13 +288,19 @@ clnt_vc_create( * Create a client handle which uses xdrrec for serialization * and authnone for authentication. */ + sendsz = __rpc_get_t_size(si.si_af, si.si_proto, (int)sendsz); + recvsz = __rpc_get_t_size(si.si_af, si.si_proto, (int)recvsz); + error = soreserve(ct->ct_socket, sendsz, recvsz); + if (error != 0) { + if (ct->ct_closeit) { + soclose(ct->ct_socket); + } + goto err; + } cl->cl_refs = 1; cl->cl_ops = &clnt_vc_ops; cl->cl_private = ct; cl->cl_auth = authnone_create(); - sendsz = __rpc_get_t_size(si.si_af, si.si_proto, (int)sendsz); - recvsz = __rpc_get_t_size(si.si_af, si.si_proto, (int)recvsz); - soreserve(ct->ct_socket, sendsz, recvsz); SOCKBUF_LOCK(&ct->ct_socket->so_rcv); soupcall_set(ct->ct_socket, SO_RCV, clnt_vc_soupcall, ct); Modified: head/sys/rpc/rpc_generic.c ============================================================================== --- head/sys/rpc/rpc_generic.c Wed Oct 13 00:21:53 2010 (r213755) +++ head/sys/rpc/rpc_generic.c Wed Oct 13 00:57:14 2010 (r213756) @@ -63,6 +63,8 @@ __FBSDID("$FreeBSD$"); #include +extern u_long sb_max_adj; /* not defined in socketvar.h */ + #if __FreeBSD_version < 700000 #define strrchr rindex #endif @@ -113,9 +115,8 @@ u_int /*ARGSUSED*/ __rpc_get_t_size(int af, int proto, int size) { - int maxsize, defsize; + int defsize; - maxsize = 256 * 1024; /* XXX */ switch (proto) { case IPPROTO_TCP: defsize = 64 * 1024; /* XXX */ @@ -131,7 +132,7 @@ __rpc_get_t_size(int af, int proto, int return defsize; /* Check whether the value is within the upper max limit */ - return (size > maxsize ? (u_int)maxsize : (u_int)size); + return (size > sb_max_adj ? (u_int)sb_max_adj : (u_int)size); } /* From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 03:18:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F5B1106564A; Wed, 13 Oct 2010 03:18:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id E23038FC08; Wed, 13 Oct 2010 03:18:36 +0000 (UTC) Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au (c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o9D3IXCE027923 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Oct 2010 14:18:34 +1100 Date: Wed, 13 Oct 2010 14:18:33 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "David E. O'Brien" In-Reply-To: <201010121924.o9CJOgwn059485@svn.freebsd.org> Message-ID: <20101013133713.L1075@besplex.bde.org> References: <201010121924.o9CJOgwn059485@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213744 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 03:18:37 -0000 On Tue, 12 Oct 2010, David E. O'Brien wrote: > Log: > If DEBUG is 3 or greater, disable STATICization of functions. > Also correct the documented location of the trace file. Private functions should always be static, which no `#define STATIC static' hack to control this, but there are compiler bugs that result in them being inlined too often. DEBUG=3 also disables staticization of many or all static variables, since STATIC is used for both functions and variables. Variable names might more reasonably be not unique. > Modified: head/bin/sh/Makefile > ============================================================================== > --- head/bin/sh/Makefile Tue Oct 12 19:24:29 2010 (r213743) > +++ head/bin/sh/Makefile Tue Oct 12 19:24:41 2010 (r213744) > @@ -21,7 +21,7 @@ LDADD= -ll -ledit -ltermcap > LFLAGS= -8 # 8-bit lex scanner for arithmetic > CFLAGS+=-DSHELL -I. -I${.CURDIR} > # for debug: > -# CFLAGS+= -g -DDEBUG=2 > +# CFLAGS+= -g -DDEBUG=3 > WARNS?= 2 > WFORMAT=0 > -O2 and perhaps even -O now does excessive inlining (due to it implying -funit-at-a-time -finline-functions-call-once). This gets in the way of debugging even more than the broken default of -O2 , even with -g. (OTOH, -g is supposed to not change the object code, so it shouldn't undo parts of -O2.) In theory, the debugging info should make it possible for debuggers to restore the semantics of not-explictly-inline functions by virtualizing them, but gdb's debugging info and/or gdb are too primitive to do this (gdb doesn't allow putting a breakpoint at a deleted static function, and at least in FreeBSD, at least on amd64 and i386, gdb makes a mess of even stepping over an explicit inline function -- it doesn't even display the source code for lines that call an inline function (this is even worse than for macros), and thus it doesn't even give a chance of stepping over an inline function using 'n' -- stepping stops in the inline function and displays its lines (except for nested inlines -- then it only displays the leaf lines) (this is better than for macros where you can't see the internals). These bugs are larger for the kernel with primitive instruction-level debuggers like ddb and primitive backtracers that don't understand the debugging info. It can be very hard to see where you are in a large function comprised of other large functions that were inlined just because they are only called once, especially after -O2 reorders everything. These bugs are larger when the inlines are not explicit. You may have made a function separate just for easier debugging, or to get separate profiling info for it... Of course, debugging and profiling are magic, but I don't want to have to adorn all functions with STATICs and __attributes() (and pragmas for othercc...) to recover historical/normal or variant debugging or profiling of them. This already stopped me from adding attributes to inline functions in kernel headers. Not inlining them would be usefulfor re-profiling them to see if they really should be inline, but the control structure for this would be ugly. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 03:55:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B74E10656A7; Wed, 13 Oct 2010 03:55:26 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 1EBE58FC2B; Wed, 13 Oct 2010 03:55:25 +0000 (UTC) Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au (c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o9D3tITS028157 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Oct 2010 14:55:20 +1100 Date: Wed, 13 Oct 2010 14:55:18 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Erik Cederstrand In-Reply-To: <2A26ECE8-7713-49C4-8706-5AA5B232BE29@cederstrand.dk> Message-ID: <20101013143845.I1817@besplex.bde.org> References: <201010090531.o995V8n3026865@svn.freebsd.org> <8C667EA1-3012-4499-BCCE-58263165663B@cederstrand.dk> <20101010083725.S3587@besplex.bde.org> <2A26ECE8-7713-49C4-8706-5AA5B232BE29@cederstrand.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Ben Kaduk , Tim Kientzle , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r213643 - head/usr.bin/ar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 03:55:26 -0000 On Sun, 10 Oct 2010, Erik Cederstrand wrote: > Den 10/10/2010 kl. 00.11 skrev Bruce Evans: > >> On Sat, 9 Oct 2010, Erik Cederstrand wrote: >>>> >>>> Thanks! Has anyone looked at the feasibility of setting AR?=ar -D in >>>> sys.mk? I will probably try this when I get my scratch box up again. >> >> I hope not. The default behaviour should not be changed by default. > > The reason I came up with this patch was that I wanted to do binary diffs on FreeBSD distributions to, among other reasons, record witch files are actually affected between commits. Except for a few edge-cases like recording a build timestamp, it seems wrong in my view for FreeBSD to not produce deterministic distributions on identical source code. I also don't like distributions that stamp every file with their release build time (or maybe a little later, with a single release time). How would do you prevent clobbering metadata outside of archives? What I do is install with -C -p (and also -v -v to report changes), and then compare installed copies or just look at the install -v -v output. >> The primary user of ${AR} for FreeBSD builds, namely bsd.lib.mk, doesn't >> even use ${ARFLAGS}, so it is missing from the above list. It uses the >> literal `cq' whenever it uses the non-literal ${AR}. Perhaps ar is often >> spelled `ar' too. > > > I'm a real beginner here. As I read the manuals (GNU ar and BSD ar), the only flags that really control archive contents on archive creation is 'q' and 'r'. The 'l' is ignored, 'c' and 'v' control verbosity, and 'u' and 's' are for performance purposes that are largely irrelevant today (extracting every single *.a file and recreating it wit ar -rD takes less than 10 secs on my slow machine). Is there any negative impact at runtime from having all archives created with either -rD or -qD (ignoring verbosity at build time for now)? I don't really know. 's' is also useful for non-libraries. 'u' is related to clobbering times, but goes the wrong way by updating the archive if the file is newer. I think all FreeBSD libraries should be built with the same flags (probably ARFLAGS, with you putting -D in it if you don't want the timestamp update). However, the places that already use ARFLAGS but set it themselves may be a problem. Some Makefiles initentionally avoid using bsd.lib.mk because they are special and it does the wrong things for them. They probably don't really care about the exact archive flags, but need to be checked individually. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 04:01:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79CF91065679; Wed, 13 Oct 2010 04:01:02 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6787A8FC17; Wed, 13 Oct 2010 04:01:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9D4127d071717; Wed, 13 Oct 2010 04:01:02 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9D4117F071699; Wed, 13 Oct 2010 04:01:01 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010130401.o9D4117F071699@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 13 Oct 2010 04:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213760 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 04:01:02 -0000 Author: obrien Date: Wed Oct 13 04:01:01 2010 New Revision: 213760 URL: http://svn.freebsd.org/changeset/base/213760 Log: Consistently use "STATIC" for all functions in order to be able to set breakpoints with in a debugger. And use naked "static" for variables. Noticed by: bde Modified: head/bin/sh/alias.c head/bin/sh/cd.c head/bin/sh/error.c head/bin/sh/eval.c head/bin/sh/exec.c head/bin/sh/expand.c head/bin/sh/input.c head/bin/sh/jobs.c head/bin/sh/mail.c head/bin/sh/memalloc.c head/bin/sh/output.c head/bin/sh/parser.c head/bin/sh/redir.c head/bin/sh/shell.h head/bin/sh/show.c head/bin/sh/trap.c head/bin/sh/var.c Modified: head/bin/sh/alias.c ============================================================================== --- head/bin/sh/alias.c Wed Oct 13 02:11:59 2010 (r213759) +++ head/bin/sh/alias.c Wed Oct 13 04:01:01 2010 (r213760) @@ -49,8 +49,8 @@ __FBSDID("$FreeBSD$"); #define ATABSIZE 39 -STATIC struct alias *atab[ATABSIZE]; -STATIC int aliases; +static struct alias *atab[ATABSIZE]; +static int aliases; STATIC void setalias(const char *, const char *); STATIC int unalias(const char *); @@ -191,7 +191,7 @@ lookupalias(const char *name, int check) return (NULL); } -static int +STATIC int comparealiases(const void *p1, const void *p2) { const struct alias *const *a1 = p1; @@ -200,7 +200,7 @@ comparealiases(const void *p1, const voi return strcmp((*a1)->name, (*a2)->name); } -static void +STATIC void printalias(const struct alias *a) { char *p; @@ -214,7 +214,7 @@ printalias(const struct alias *a) out1c('\n'); } -static void +STATIC void printaliases(void) { int i, j; Modified: head/bin/sh/cd.c ============================================================================== --- head/bin/sh/cd.c Wed Oct 13 02:11:59 2010 (r213759) +++ head/bin/sh/cd.c Wed Oct 13 04:01:01 2010 (r213760) @@ -73,9 +73,9 @@ STATIC void updatepwd(char *); STATIC char *getpwd(void); STATIC char *getpwd2(void); -STATIC char *curdir = NULL; /* current working directory */ -STATIC char *prevdir; /* previous working directory */ -STATIC char *cdcomppath; +static char *curdir = NULL; /* current working directory */ +static char *prevdir; /* previous working directory */ +static char *cdcomppath; int cdcmd(int argc, char **argv) Modified: head/bin/sh/error.c ============================================================================== --- head/bin/sh/error.c Wed Oct 13 02:11:59 2010 (r213759) +++ head/bin/sh/error.c Wed Oct 13 04:01:01 2010 (r213760) @@ -67,7 +67,7 @@ volatile sig_atomic_t intpending; char *commandname; -static void exverror(int, const char *, va_list) __printf0like(2, 0) __dead2; +STATIC void exverror(int, const char *, va_list) __printf0like(2, 0) __dead2; /* * Called to raise an exception. Since C doesn't include exceptions, we @@ -139,7 +139,7 @@ onint(void) * is not NULL then error prints an error message using printf style * formatting. It then raises the error exception. */ -static void +STATIC void exverror(int cond, const char *msg, va_list ap) { /* Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Wed Oct 13 02:11:59 2010 (r213759) +++ head/bin/sh/eval.c Wed Oct 13 04:01:01 2010 (r213760) @@ -75,10 +75,10 @@ __FBSDID("$FreeBSD$"); int evalskip; /* set if we are skipping commands */ -STATIC int skipcount; /* number of levels to skip */ +static int skipcount; /* number of levels to skip */ MKINIT int loopnest; /* current loop nesting level */ int funcnest; /* depth of function calls */ -STATIC int builtin_flags; /* evalcommand flags for builtins */ +static int builtin_flags; /* evalcommand flags for builtins */ char *commandname; Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Wed Oct 13 02:11:59 2010 (r213759) +++ head/bin/sh/exec.c Wed Oct 13 04:01:01 2010 (r213760) @@ -91,8 +91,8 @@ struct tblentry { }; -STATIC struct tblentry *cmdtable[CMDTABLESIZE]; -STATIC int builtinloc = -1; /* index in path of %builtin, or -1 */ +static struct tblentry *cmdtable[CMDTABLESIZE]; +static int builtinloc = -1; /* index in path of %builtin, or -1 */ int exerrno = 0; /* Last exec error */ @@ -615,7 +615,7 @@ deletefuncs(void) * entry. */ -STATIC struct tblentry **lastcmdentry; +static struct tblentry **lastcmdentry; STATIC struct tblentry * Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Wed Oct 13 02:11:59 2010 (r213759) +++ head/bin/sh/expand.c Wed Oct 13 04:01:01 2010 (r213760) @@ -88,11 +88,11 @@ struct ifsregion { }; -STATIC char *expdest; /* output of current string */ -STATIC struct nodelist *argbackq; /* list of back quote expressions */ -STATIC struct ifsregion ifsfirst; /* first struct in list of ifs regions */ -STATIC struct ifsregion *ifslastp; /* last struct in list */ -STATIC struct arglist exparg; /* holds expanded arg list */ +static char *expdest; /* output of current string */ +static struct nodelist *argbackq; /* list of back quote expressions */ +static struct ifsregion ifsfirst; /* first struct in list of ifs regions */ +static struct ifsregion *ifslastp; /* last struct in list */ +static struct arglist exparg; /* holds expanded arg list */ STATIC void argstr(char *, int); STATIC char *exptilde(char *, int); @@ -1092,7 +1092,7 @@ ifsbreakup(char *string, struct arglist } -STATIC char expdir[PATH_MAX]; +static char expdir[PATH_MAX]; #define expdir_end (expdir + sizeof(expdir)) /* Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Wed Oct 13 02:11:59 2010 (r213759) +++ head/bin/sh/input.c Wed Oct 13 04:01:01 2010 (r213760) @@ -98,14 +98,14 @@ MKINIT int parselleft; /* copy of parse char *parsenextc; /* copy of parsefile->nextc */ MKINIT struct parsefile basepf; /* top level input file */ char basebuf[BUFSIZ]; /* buffer for top level input file */ -STATIC struct parsefile *parsefile = &basepf; /* current input file */ +static struct parsefile *parsefile = &basepf; /* current input file */ int init_editline = 0; /* editline library initialized? */ int whichprompt; /* 1 == PS1, 2 == PS2 */ EditLine *el; /* cookie for editline package */ STATIC void pushfile(void); -static int preadfd(void); +STATIC int preadfd(void); #ifdef mkinit INCLUDE "input.h" @@ -169,7 +169,7 @@ pgetc(void) } -static int +STATIC int preadfd(void) { int nr; Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Wed Oct 13 02:11:59 2010 (r213759) +++ head/bin/sh/jobs.c Wed Oct 13 04:01:01 2010 (r213760) @@ -72,13 +72,13 @@ __FBSDID("$FreeBSD$"); #include "mystring.h" -STATIC struct job *jobtab; /* array of jobs */ -STATIC int njobs; /* size of array */ +static struct job *jobtab; /* array of jobs */ +static int njobs; /* size of array */ MKINIT pid_t backgndpid = -1; /* pid of last background process */ MKINIT struct job *bgjob = NULL; /* last background process */ #if JOBS -STATIC struct job *jobmru; /* most recently used job list */ -STATIC pid_t initialpgrp; /* pgrp of shell on invocation */ +static struct job *jobmru; /* most recently used job list */ +static pid_t initialpgrp; /* pgrp of shell on invocation */ #endif int in_waitcmd = 0; /* are we in waitcmd()? */ int in_dowait = 0; /* are we in dowait()? */ @@ -1130,8 +1130,8 @@ backgndpidval(void) * jobs command. */ -STATIC char *cmdnextc; -STATIC int cmdnleft; +static char *cmdnextc; +static int cmdnleft; #define MAXCMDTEXT 200 char * Modified: head/bin/sh/mail.c ============================================================================== --- head/bin/sh/mail.c Wed Oct 13 02:11:59 2010 (r213759) +++ head/bin/sh/mail.c Wed Oct 13 04:01:01 2010 (r213760) @@ -57,8 +57,8 @@ __FBSDID("$FreeBSD$"); #define MAXMBOXES 10 -STATIC int nmboxes; /* number of mailboxes */ -STATIC time_t mailtime[MAXMBOXES]; /* times of mailboxes */ +static int nmboxes; /* number of mailboxes */ +static time_t mailtime[MAXMBOXES]; /* times of mailboxes */ Modified: head/bin/sh/memalloc.c ============================================================================== --- head/bin/sh/memalloc.c Wed Oct 13 02:11:59 2010 (r213759) +++ head/bin/sh/memalloc.c Wed Oct 13 04:01:01 2010 (r213760) @@ -123,15 +123,15 @@ struct stack_block { }; #define SPACE(sp) ((char*)(sp) + ALIGN(sizeof(struct stack_block))) -STATIC struct stack_block *stackp; -STATIC struct stackmark *markp; +static struct stack_block *stackp; +static struct stackmark *markp; char *stacknxt; int stacknleft; int sstrnleft; int herefd = -1; -static void +STATIC void stnewblock(int nbytes) { struct stack_block *sp; Modified: head/bin/sh/output.c ============================================================================== --- head/bin/sh/output.c Wed Oct 13 02:11:59 2010 (r213759) +++ head/bin/sh/output.c Wed Oct 13 04:01:01 2010 (r213760) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #define MEM_OUT -3 /* output to dynamically allocated memory */ #define OUTPUT_ERR 01 /* error occurred on output */ -static int doformat_wr(void *, const char *, int); +STATIC int doformat_wr(void *, const char *, int); struct output output = {NULL, 0, NULL, OUTBUFSIZ, 1, 0}; struct output errout = {NULL, 0, NULL, 256, 2, 0}; @@ -165,7 +165,7 @@ outqstr(const char *p, struct output *fi outc('\'', file); } -STATIC char out_junk[16]; +static char out_junk[16]; void emptyoutbuf(struct output *dest) @@ -281,7 +281,7 @@ fmtstr(char *outbuf, int length, const c outbuf[length - 1] = '\0'; } -static int +STATIC int doformat_wr(void *cookie, const char *buf, int len) { struct output *o; Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Wed Oct 13 02:11:59 2010 (r213759) +++ head/bin/sh/parser.c Wed Oct 13 04:01:01 2010 (r213760) @@ -86,20 +86,20 @@ struct parser_temp { }; -STATIC struct heredoc *heredoclist; /* list of here documents to read */ -STATIC int doprompt; /* if set, prompt the user */ -STATIC int needprompt; /* true if interactive and at start of line */ -STATIC int lasttoken; /* last token read */ +static struct heredoc *heredoclist; /* list of here documents to read */ +static int doprompt; /* if set, prompt the user */ +static int needprompt; /* true if interactive and at start of line */ +static int lasttoken; /* last token read */ MKINIT int tokpushback; /* last token pushed back */ -STATIC char *wordtext; /* text of last word returned by readtoken */ +static char *wordtext; /* text of last word returned by readtoken */ MKINIT int checkkwd; /* 1 == check for kwds, 2 == also eat newlines */ -STATIC struct nodelist *backquotelist; -STATIC union node *redirnode; -STATIC struct heredoc *heredoc; -STATIC int quoteflag; /* set if (part of) last token was quoted */ -STATIC int startlinno; /* line # where last token started */ -STATIC int funclinno; /* line # where the current function started */ -STATIC struct parser_temp *parser_temp; +static struct nodelist *backquotelist; +static union node *redirnode; +static struct heredoc *heredoc; +static int quoteflag; /* set if (part of) last token was quoted */ +static int startlinno; /* line # where last token started */ +static int funclinno; /* line # where the current function started */ +static struct parser_temp *parser_temp; /* XXX When 'noaliases' is set to one, no alias expansion takes place. */ static int noaliases = 0; @@ -683,7 +683,8 @@ makename(void) return n; } -void fixredir(union node *n, const char *text, int err) +void +fixredir(union node *n, const char *text, int err) { TRACE(("Fix redir %s %d\n", text, err)); if (!err) Modified: head/bin/sh/redir.c ============================================================================== --- head/bin/sh/redir.c Wed Oct 13 02:11:59 2010 (r213759) +++ head/bin/sh/redir.c Wed Oct 13 04:01:01 2010 (r213760) @@ -81,7 +81,7 @@ MKINIT struct redirtab *redirlist; * background commands, where we want to redirect fd0 to /dev/null only * if it hasn't already been redirected. */ -STATIC int fd0_redirected = 0; +static int fd0_redirected = 0; STATIC void openredirect(union node *, char[10 ]); STATIC int openhere(union node *); Modified: head/bin/sh/shell.h ============================================================================== --- head/bin/sh/shell.h Wed Oct 13 02:11:59 2010 (r213759) +++ head/bin/sh/shell.h Wed Oct 13 04:01:01 2010 (r213760) @@ -62,11 +62,14 @@ typedef intmax_t arith_t; #define strtoarith_t(nptr, endptr, base) strtoimax(nptr, endptr, base) typedef void *pointer; + +/* STATIC is only for use with functions, not variables. */ #if DEBUG >= 3 #define STATIC #else #define STATIC static #endif + #define MKINIT /* empty */ #include Modified: head/bin/sh/show.c ============================================================================== --- head/bin/sh/show.c Wed Oct 13 02:11:59 2010 (r213759) +++ head/bin/sh/show.c Wed Oct 13 04:01:01 2010 (r213760) @@ -52,11 +52,11 @@ __FBSDID("$FreeBSD$"); #ifdef DEBUG -static void shtree(union node *, int, char *, FILE*); -static void shcmd(union node *, FILE *); -static void sharg(union node *, FILE *); -static void indent(int, char *, FILE *); -static void trstring(char *); +STATIC void shtree(union node *, int, char *, FILE*); +STATIC void shcmd(union node *, FILE *); +STATIC void sharg(union node *, FILE *); +STATIC void indent(int, char *, FILE *); +STATIC void trstring(char *); void @@ -67,7 +67,7 @@ showtree(union node *n) } -static void +STATIC void shtree(union node *n, int ind, char *pfx, FILE *fp) { struct nodelist *lp; @@ -118,7 +118,7 @@ binop: -static void +STATIC void shcmd(union node *cmd, FILE *fp) { union node *np; @@ -169,7 +169,7 @@ shcmd(union node *cmd, FILE *fp) -static void +STATIC void sharg(union node *arg, FILE *fp) { char *p; @@ -254,7 +254,7 @@ sharg(union node *arg, FILE *fp) } -static void +STATIC void indent(int amount, char *pfx, FILE *fp) { int i; @@ -317,7 +317,7 @@ trputs(const char *s) } -static void +STATIC void trstring(char *s) { char *p; Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Wed Oct 13 02:11:59 2010 (r213759) +++ head/bin/sh/trap.c Wed Oct 13 04:01:01 2010 (r213760) @@ -80,7 +80,7 @@ static volatile sig_atomic_t gotsig[NSIG static int ignore_sigchld; /* Used while handling SIGCHLD traps. */ volatile sig_atomic_t gotwinch; -static int getsigaction(int, sig_t *); +STATIC int getsigaction(int, sig_t *); /* @@ -88,7 +88,7 @@ static int getsigaction(int, sig_t *); * * Note: the signal number may exceed NSIG. */ -static int +STATIC int sigstring_to_signum(char *sig) { @@ -116,7 +116,7 @@ sigstring_to_signum(char *sig) /* * Print a list of valid signal names. */ -static void +STATIC void printsignals(void) { int n, outlen; @@ -334,7 +334,7 @@ setsignal(int signo) /* * Return the current setting for sig w/o changing it. */ -static int +STATIC int getsigaction(int signo, sig_t *sigact) { struct sigaction sa; Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Wed Oct 13 02:11:59 2010 (r213759) +++ head/bin/sh/var.c Wed Oct 13 04:01:01 2010 (r213760) @@ -91,9 +91,9 @@ struct var vps1; struct var vps2; struct var vps4; struct var vvers; -STATIC struct var voptind; +static struct var voptind; -STATIC const struct varinit varinit[] = { +static const struct varinit varinit[] = { #ifndef NO_HISTORY { &vhistsize, VUNSET, "HISTSIZE=", sethistsize }, @@ -125,13 +125,13 @@ STATIC const struct varinit varinit[] = NULL } }; -STATIC struct var *vartab[VTABSIZE]; +static struct var *vartab[VTABSIZE]; -STATIC const char *const locale_names[7] = { +static const char *const locale_names[7] = { "LC_COLLATE", "LC_CTYPE", "LC_MONETARY", "LC_NUMERIC", "LC_TIME", "LC_MESSAGES", NULL }; -STATIC const int locale_categories[7] = { +static const int locale_categories[7] = { LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME, LC_MESSAGES, 0 }; @@ -292,7 +292,7 @@ localevar(const char *s) * Sets/unsets an environment variable from a pointer that may actually be a * pointer into environ where the string should not be manipulated. */ -static void +STATIC void change_env(const char *s, int set) { char *eqp; @@ -579,7 +579,7 @@ shprocvar(void) } -static int +STATIC int var_compare(const void *a, const void *b) { const char *const *sa, *const *sb; From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 04:05:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED2B7106564A; Wed, 13 Oct 2010 04:05:44 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 851A48FC0A; Wed, 13 Oct 2010 04:05:44 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id o9D45iVk040060; Tue, 12 Oct 2010 21:05:44 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.4/8.14.4/Submit) id o9D45hhU040059; Tue, 12 Oct 2010 21:05:43 -0700 (PDT) (envelope-from obrien) Date: Tue, 12 Oct 2010 21:05:43 -0700 From: "David O'Brien" To: Bruce Evans Message-ID: <20101013040543.GB13694@dragon.NUXI.org> References: <201010121924.o9CJOgwn059485@svn.freebsd.org> <20101013133713.L1075@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101013133713.L1075@besplex.bde.org> X-Operating-System: FreeBSD 9.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213744 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 04:05:45 -0000 On Wed, Oct 13, 2010 at 02:18:33PM +1100, Bruce Evans wrote: > On Tue, 12 Oct 2010, David E. O'Brien wrote: >> Log: >> If DEBUG is 3 or greater, disable STATICization of functions. >> Also correct the documented location of the trace file. > > Private functions should always be static, which no `#define STATIC static' [..] > In theory, the debugging info should make it possible for debuggers > to restore the semantics of not-explictly-inline functions by virtualizing > them, but gdb's debugging info and/or gdb are too primitive to do this > (gdb doesn't allow putting a breakpoint at a deleted static function, This is actually what my motivation is -- trying to set breakpoints and finding GDB was unable to. > Of course, debugging and profiling are magic, > but I don't want to have to adorn all functions with STATICs and > __attributes() (and pragmas for othercc...) to recover historical/normal > or variant debugging or profiling of them. I agree, and would not add STATIC's to a program's code that didn't already have them. But in this case we inherited it from 4.4BSD. I'm just making it actually do something other than being a gratuitous spelling change. I believe I've made things more consistent with r213760. -- -- David (obrien@FreeBSD.org) From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 04:29:32 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC9021065693; Wed, 13 Oct 2010 04:29:32 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 623498FC0C; Wed, 13 Oct 2010 04:29:32 +0000 (UTC) Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au (c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o9D4TRgd013948 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Oct 2010 15:29:29 +1100 Date: Wed, 13 Oct 2010 15:29:27 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "David O'Brien" In-Reply-To: <20101013040543.GB13694@dragon.NUXI.org> Message-ID: <20101013152037.S2102@besplex.bde.org> References: <201010121924.o9CJOgwn059485@svn.freebsd.org> <20101013133713.L1075@besplex.bde.org> <20101013040543.GB13694@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r213744 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 04:29:32 -0000 On Tue, 12 Oct 2010, David O'Brien wrote: > On Wed, Oct 13, 2010 at 02:18:33PM +1100, Bruce Evans wrote: >> On Tue, 12 Oct 2010, David E. O'Brien wrote: >>> Log: >>> If DEBUG is 3 or greater, disable STATICization of functions. >>> Also correct the documented location of the trace file. >> >> Private functions should always be static, which no `#define STATIC static' > [..] >> In theory, the debugging info should make it possible for debuggers >> to restore the semantics of not-explictly-inline functions by virtualizing >> them, but gdb's debugging info and/or gdb are too primitive to do this >> (gdb doesn't allow putting a breakpoint at a deleted static function, > > This is actually what my motivation is -- trying to set breakpoints and > finding GDB was unable to. > >> Of course, debugging and profiling are magic, >> but I don't want to have to adorn all functions with STATICs and >> __attributes() (and pragmas for othercc...) to recover historical/normal >> or variant debugging or profiling of them. > > I agree, and would not add STATIC's to a program's code that didn't > already have them. But in this case we inherited it from 4.4BSD. > I'm just making it actually do something other than being a gratuitous > spelling change. > > I believe I've made things more consistent with r213760. Add __noinline or whatever attributes to STATIC (but keep static in it) for the DEBUG >= 3 case if you are going that far. __noinline should be a syntax error for variables, so this should also find any STATICs still on variables. The spelling fix of changing STATIC to what it actually means (ASSORTED_HACKS_FOR_DEBUGGING_BUT_NOW_ONLY_FOR_FUNCTIONS) goes too far for me. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 06:28:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D98E106564A; Wed, 13 Oct 2010 06:28:41 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5D7F8FC0A; Wed, 13 Oct 2010 06:28:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9D6SeIB075106; Wed, 13 Oct 2010 06:28:40 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9D6SeKr075103; Wed, 13 Oct 2010 06:28:40 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201010130628.o9D6SeKr075103@svn.freebsd.org> From: David Xu Date: Wed, 13 Oct 2010 06:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213761 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 06:28:41 -0000 Author: davidxu Date: Wed Oct 13 06:28:40 2010 New Revision: 213761 URL: http://svn.freebsd.org/changeset/base/213761 Log: sigqueue_collect_set() is no longer needed because other functions maintain pending set correctly. Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Wed Oct 13 04:01:01 2010 (r213760) +++ head/sys/kern/kern_sig.c Wed Oct 13 06:28:40 2010 (r213761) @@ -431,36 +431,19 @@ sigqueue_flush(sigqueue_t *sq) } static void -sigqueue_collect_set(sigqueue_t *sq, sigset_t *set) +sigqueue_move_set(sigqueue_t *src, sigqueue_t *dst, const sigset_t *set) { - ksiginfo_t *ksi; - - KASSERT(sq->sq_flags & SQ_INIT, ("sigqueue not inited")); - - TAILQ_FOREACH(ksi, &sq->sq_list, ksi_link) - SIGADDSET(*set, ksi->ksi_signo); - SIGSETOR(*set, sq->sq_kill); -} - -static void -sigqueue_move_set(sigqueue_t *src, sigqueue_t *dst, sigset_t *setp) -{ - sigset_t tmp, set; + sigset_t tmp; struct proc *p1, *p2; ksiginfo_t *ksi, *next; KASSERT(src->sq_flags & SQ_INIT, ("src sigqueue not inited")); KASSERT(dst->sq_flags & SQ_INIT, ("dst sigqueue not inited")); - /* - * make a copy, this allows setp to point to src or dst - * sq_signals without trouble. - */ - set = *setp; p1 = src->sq_proc; p2 = dst->sq_proc; /* Move siginfo to target list */ TAILQ_FOREACH_SAFE(ksi, &src->sq_list, ksi_link, next) { - if (SIGISMEMBER(set, ksi->ksi_signo)) { + if (SIGISMEMBER(*set, ksi->ksi_signo)) { TAILQ_REMOVE(&src->sq_list, ksi, ksi_link); if (p1 != NULL) p1->p_pendingcnt--; @@ -473,17 +456,14 @@ sigqueue_move_set(sigqueue_t *src, sigqu /* Move pending bits to target list */ tmp = src->sq_kill; - SIGSETAND(tmp, set); + SIGSETAND(tmp, *set); SIGSETOR(dst->sq_kill, tmp); SIGSETNAND(src->sq_kill, tmp); tmp = src->sq_signals; - SIGSETAND(tmp, set); + SIGSETAND(tmp, *set); SIGSETOR(dst->sq_signals, tmp); SIGSETNAND(src->sq_signals, tmp); - - /* Finally, rescan src queue and set pending bits for it */ - sigqueue_collect_set(src, &src->sq_signals); } static void @@ -497,7 +477,7 @@ sigqueue_move(sigqueue_t *src, sigqueue_ } static void -sigqueue_delete_set(sigqueue_t *sq, sigset_t *set) +sigqueue_delete_set(sigqueue_t *sq, const sigset_t *set) { struct proc *p = sq->sq_proc; ksiginfo_t *ksi, *next; @@ -515,8 +495,6 @@ sigqueue_delete_set(sigqueue_t *sq, sigs } SIGSETNAND(sq->sq_kill, *set); SIGSETNAND(sq->sq_signals, *set); - /* Finally, rescan queue and set pending bits for it */ - sigqueue_collect_set(sq, &sq->sq_signals); } void @@ -531,7 +509,7 @@ sigqueue_delete(sigqueue_t *sq, int sign /* Remove a set of signals for a process */ static void -sigqueue_delete_set_proc(struct proc *p, sigset_t *set) +sigqueue_delete_set_proc(struct proc *p, const sigset_t *set) { sigqueue_t worklist; struct thread *td0; From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 09:17:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 317A9106566B; Wed, 13 Oct 2010 09:17:45 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DE7F8FC12; Wed, 13 Oct 2010 09:17:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9D9Hj3a078777; Wed, 13 Oct 2010 09:17:45 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9D9HjSh078768; Wed, 13 Oct 2010 09:17:45 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201010130917.o9D9HjSh078768@svn.freebsd.org> From: Juli Mallett Date: Wed, 13 Oct 2010 09:17:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213762 - in head/sys/mips: cavium cavium/octe conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 09:17:45 -0000 Author: jmallett Date: Wed Oct 13 09:17:44 2010 New Revision: 213762 URL: http://svn.freebsd.org/changeset/base/213762 Log: o) Make it possible to attach a PHY directly to an octe device rather than using miibus, since for some devices that use multiple addresses on the bus, going through miibus may be unclear, and for devices that are not standard MII PHYs, miibus may throw a fit, necessitating complicated interfaces to fake the interface that it expects during probe/attach. o) Make the mv88e61xx SMI interface in octe attach a PHY directly and fix some mistakes in the code that resulted from trying too hard to present a nice interface to miibus. o) Add a PHY driver for the mv88e61xx. If attached (it is optional in kernel compiles so the default behavior of having a dumb switch is preserved) it will place the switch in a VLAN-tagging mode such that each physical port has a VLAN associated with it and interfaces for the VLANs can be created to address or bridge between them. XXX It would be nice for this to be part of a single module including the SMI interface, and for it to fit into a generic switch configuration framework and for it to use DSA rather than VLANs, but this is a start and gives some sense of the parameters of such frameworks that are not currently present in FreeBSD. In lieu of a switch configuration interface, per-port media status and VLAN settings are in a sysctl tree. XXX There may be some minor nits remaining in the handling of broadcast, multicast and unknown destination traffic. It would also be nice to go through and replace the few remaining magic numbers with macros at some point in the future. XXX This has only been tested with the MV88E6161, but it should work with minimal or no modification on related switches, so support for probing them was included. Thanks to Pat Saavedra of TELoIP and Rafal Jaworowski of Semihalf for their assistance in understanding the switch chipset. Added: head/sys/mips/cavium/octe/mv88e61xxphy.c (contents, props changed) head/sys/mips/cavium/octe/mv88e61xxphyreg.h (contents, props changed) Modified: head/sys/mips/cavium/files.octeon1 head/sys/mips/cavium/octe/cavium-ethernet.h head/sys/mips/cavium/octe/ethernet-mdio.c head/sys/mips/cavium/octe/ethernet-mv88e61xx.c head/sys/mips/cavium/octe/octe.c head/sys/mips/conf/OCTEON1 Modified: head/sys/mips/cavium/files.octeon1 ============================================================================== --- head/sys/mips/cavium/files.octeon1 Wed Oct 13 06:28:40 2010 (r213761) +++ head/sys/mips/cavium/files.octeon1 Wed Oct 13 09:17:44 2010 (r213762) @@ -31,6 +31,7 @@ mips/cavium/octe/ethernet-sgmii.c optio mips/cavium/octe/ethernet-spi.c optional octe mips/cavium/octe/ethernet-tx.c optional octe mips/cavium/octe/ethernet-xaui.c optional octe +mips/cavium/octe/mv88e61xxphy.c optional octe mv88e61xxphy mips/cavium/octe/octe.c optional octe mips/cavium/octe/octebus.c optional octe Modified: head/sys/mips/cavium/octe/cavium-ethernet.h ============================================================================== --- head/sys/mips/cavium/octe/cavium-ethernet.h Wed Oct 13 06:28:40 2010 (r213761) +++ head/sys/mips/cavium/octe/cavium-ethernet.h Wed Oct 13 09:17:44 2010 (r213762) @@ -72,6 +72,7 @@ typedef struct { uint8_t mac[6]; int phy_id; + const char *phy_device; int (*mdio_read)(struct ifnet *, int, int); void (*mdio_write)(struct ifnet *, int, int, int); Modified: head/sys/mips/cavium/octe/ethernet-mdio.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-mdio.c Wed Oct 13 06:28:40 2010 (r213761) +++ head/sys/mips/cavium/octe/ethernet-mdio.c Wed Oct 13 09:17:44 2010 (r213762) @@ -132,6 +132,7 @@ int cvm_oct_mdio_setup_device(struct ifn cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; priv->phy_id = cvmx_helper_board_get_mii_address(priv->port); + priv->phy_device = NULL; priv->mdio_read = NULL; priv->mdio_write = NULL; Modified: head/sys/mips/cavium/octe/ethernet-mv88e61xx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-mv88e61xx.c Wed Oct 13 06:28:40 2010 (r213761) +++ head/sys/mips/cavium/octe/ethernet-mv88e61xx.c Wed Oct 13 09:17:44 2010 (r213762) @@ -49,8 +49,6 @@ __FBSDID("$FreeBSD$"); #include "wrapper-cvmx-includes.h" #include "ethernet-headers.h" -#define MV88E61XX_SMI_PHY_SW 0x10 /* Switch PHY. */ - #define MV88E61XX_SMI_REG_CMD 0x00 /* Indirect command register. */ #define MV88E61XX_SMI_CMD_BUSY 0x8000 /* Busy bit. */ #define MV88E61XX_SMI_CMD_22 0x1000 /* Clause 22 (default 45.) */ @@ -61,89 +59,67 @@ __FBSDID("$FreeBSD$"); #define MV88E61XX_SMI_REG_DAT 0x01 /* Indirect data register. */ -static int cvm_oct_mv88e61xx_mdio_read(struct ifnet *, int, int); -static void cvm_oct_mv88e61xx_mdio_write(struct ifnet *, int, int, int); static int cvm_oct_mv88e61xx_smi_read(struct ifnet *, int, int); static void cvm_oct_mv88e61xx_smi_write(struct ifnet *, int, int, int); -static int cvm_oct_mv88e61xx_smi_wait(struct ifnet *, int); +static int cvm_oct_mv88e61xx_smi_wait(struct ifnet *); int cvm_oct_mv88e61xx_setup_device(struct ifnet *ifp) { cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; - priv->mdio_read = cvm_oct_mv88e61xx_mdio_read; - priv->mdio_write = cvm_oct_mv88e61xx_mdio_write; + priv->mdio_read = cvm_oct_mv88e61xx_smi_read; + priv->mdio_write = cvm_oct_mv88e61xx_smi_write; + priv->phy_device = "mv88e61xxphy"; return (0); } static int -cvm_oct_mv88e61xx_mdio_read(struct ifnet *ifp, int phy_id, int location) -{ - /* - * Intercept reads of MII_BMSR. The miibus uses this to determine - * PHY presence and we only want it to look for a PHY attachment - * for the switch PHY itself. The PHY driver will talk to all of - * the other ports as need be. - */ - switch (location) { - case MII_BMSR: - if (phy_id != MV88E61XX_SMI_PHY_SW) - return (0); - return (BMSR_EXTSTAT | BMSR_ACOMP | BMSR_LINK); - default: - return (cvm_oct_mv88e61xx_smi_read(ifp, phy_id, location)); - } -} - -static void -cvm_oct_mv88e61xx_mdio_write(struct ifnet *ifp, int phy_id, int location, int val) -{ - return (cvm_oct_mv88e61xx_smi_write(ifp, phy_id, location, val)); -} - -static int cvm_oct_mv88e61xx_smi_read(struct ifnet *ifp, int phy_id, int location) { + cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; int error; - error = cvm_oct_mv88e61xx_smi_wait(ifp, phy_id); + error = cvm_oct_mv88e61xx_smi_wait(ifp); if (error != 0) return (0); - cvm_oct_mdio_write(ifp, phy_id, MV88E61XX_SMI_REG_CMD, + cvm_oct_mdio_write(ifp, priv->phy_id, MV88E61XX_SMI_REG_CMD, MV88E61XX_SMI_CMD_BUSY | MV88E61XX_SMI_CMD_22 | MV88E61XX_SMI_CMD_READ | MV88E61XX_SMI_CMD_PHY(phy_id) | MV88E61XX_SMI_CMD_REG(location)); - error = cvm_oct_mv88e61xx_smi_wait(ifp, phy_id); + error = cvm_oct_mv88e61xx_smi_wait(ifp); if (error != 0) return (0); - return (cvm_oct_mdio_read(ifp, phy_id, MV88E61XX_SMI_REG_DAT)); + return (cvm_oct_mdio_read(ifp, priv->phy_id, MV88E61XX_SMI_REG_DAT)); } static void cvm_oct_mv88e61xx_smi_write(struct ifnet *ifp, int phy_id, int location, int val) { - cvm_oct_mv88e61xx_smi_wait(ifp, phy_id); - cvm_oct_mdio_write(ifp, phy_id, MV88E61XX_SMI_REG_DAT, val); - cvm_oct_mdio_write(ifp, phy_id, MV88E61XX_SMI_REG_CMD, + cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; + + cvm_oct_mv88e61xx_smi_wait(ifp); + cvm_oct_mdio_write(ifp, priv->phy_id, MV88E61XX_SMI_REG_DAT, val); + cvm_oct_mdio_write(ifp, priv->phy_id, MV88E61XX_SMI_REG_CMD, MV88E61XX_SMI_CMD_BUSY | MV88E61XX_SMI_CMD_22 | MV88E61XX_SMI_CMD_WRITE | MV88E61XX_SMI_CMD_PHY(phy_id) | MV88E61XX_SMI_CMD_REG(location)); - cvm_oct_mv88e61xx_smi_wait(ifp, phy_id); + cvm_oct_mv88e61xx_smi_wait(ifp); } static int -cvm_oct_mv88e61xx_smi_wait(struct ifnet *ifp, int phy_id) +cvm_oct_mv88e61xx_smi_wait(struct ifnet *ifp) { + cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; uint16_t cmd; unsigned i; for (i = 0; i < 10000; i++) { - cmd = cvm_oct_mdio_read(ifp, phy_id, MV88E61XX_SMI_REG_CMD); + cmd = cvm_oct_mdio_read(ifp, priv->phy_id, MV88E61XX_SMI_REG_CMD); if ((cmd & MV88E61XX_SMI_CMD_BUSY) == 0) return (0); } Added: head/sys/mips/cavium/octe/mv88e61xxphy.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/cavium/octe/mv88e61xxphy.c Wed Oct 13 09:17:44 2010 (r213762) @@ -0,0 +1,630 @@ +/*- + * Copyright (c) 2010 Juli Mallett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * Driver for the Marvell 88E61xx family of switch PHYs + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "miibus_if.h" + +#include "mv88e61xxphyreg.h" + +struct mv88e61xxphy_softc; + +struct mv88e61xxphy_port_softc { + struct mv88e61xxphy_softc *sc_switch; + unsigned sc_port; + unsigned sc_domain; + unsigned sc_vlan; + unsigned sc_priority; + unsigned sc_flags; +}; + +#define MV88E61XXPHY_PORT_FLAG_VTU_UPDATE (0x0001) + +struct mv88e61xxphy_softc { + device_t sc_dev; + struct mv88e61xxphy_port_softc sc_ports[MV88E61XX_PORTS]; +}; + +enum mv88e61xxphy_vtu_membership_type { + MV88E61XXPHY_VTU_UNMODIFIED, + MV88E61XXPHY_VTU_UNTAGGED, + MV88E61XXPHY_VTU_TAGGED, + MV88E61XXPHY_VTU_DISCARDED, +}; + +enum mv88e61xxphy_sysctl_link_type { + MV88E61XXPHY_LINK_SYSCTL_DUPLEX, + MV88E61XXPHY_LINK_SYSCTL_LINK, + MV88E61XXPHY_LINK_SYSCTL_MEDIA, +}; + +enum mv88e61xxphy_sysctl_port_type { + MV88E61XXPHY_PORT_SYSCTL_DOMAIN, + MV88E61XXPHY_PORT_SYSCTL_VLAN, + MV88E61XXPHY_PORT_SYSCTL_PRIORITY, +}; + +/* + * Register access macros. + */ +#define MV88E61XX_READ(sc, phy, reg) \ + MIIBUS_READREG(device_get_parent((sc)->sc_dev), (phy), (reg)) + +#define MV88E61XX_WRITE(sc, phy, reg, val) \ + MIIBUS_WRITEREG(device_get_parent((sc)->sc_dev), (phy), (reg), (val)) + +#define MV88E61XX_READ_PORT(psc, reg) \ + MV88E61XX_READ((psc)->sc_switch, MV88E61XX_PORT((psc)->sc_port), (reg)) + +#define MV88E61XX_WRITE_PORT(psc, reg, val) \ + MV88E61XX_WRITE((psc)->sc_switch, MV88E61XX_PORT((psc)->sc_port), (reg), (val)) + +static int mv88e61xxphy_probe(device_t); +static int mv88e61xxphy_attach(device_t); + +static void mv88e61xxphy_init(struct mv88e61xxphy_softc *); +static void mv88e61xxphy_init_port(struct mv88e61xxphy_port_softc *); +static void mv88e61xxphy_init_vtu(struct mv88e61xxphy_softc *); +static int mv88e61xxphy_sysctl_link_proc(SYSCTL_HANDLER_ARGS); +static int mv88e61xxphy_sysctl_port_proc(SYSCTL_HANDLER_ARGS); +static void mv88e61xxphy_vtu_load(struct mv88e61xxphy_softc *, uint16_t); +static void mv88e61xxphy_vtu_set_membership(struct mv88e61xxphy_softc *, unsigned, enum mv88e61xxphy_vtu_membership_type); +static void mv88e61xxphy_vtu_wait(struct mv88e61xxphy_softc *); + +static int +mv88e61xxphy_probe(device_t dev) +{ + uint16_t val; + + val = MIIBUS_READREG(device_get_parent(dev), MV88E61XX_PORT(0), + MV88E61XX_PORT_REVISION); + switch (val >> 4) { + case 0x121: + device_set_desc(dev, "Marvell Link Street 88E6123 3-Port Gigabit Switch"); + return (0); + case 0x161: + device_set_desc(dev, "Marvell Link Street 88E6161 6-Port Gigabit Switch"); + return (0); + case 0x165: + device_set_desc(dev, "Marvell Link Street 88E6161 6-Port Advanced Gigabit Switch"); + return (0); + default: + return (ENXIO); + } +} + +static int +mv88e61xxphy_attach(device_t dev) +{ + char portbuf[] = "N"; + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev); + struct sysctl_oid *tree = device_get_sysctl_tree(dev); + struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree); + struct sysctl_oid *port_node, *portN_node; + struct sysctl_oid_list *port_tree, *portN_tree; + struct mv88e61xxphy_softc *sc; + unsigned port; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + /* + * Initialize port softcs. + */ + for (port = 0; port < MV88E61XX_PORTS; port++) { + struct mv88e61xxphy_port_softc *psc; + + psc = &sc->sc_ports[port]; + psc->sc_switch = sc; + psc->sc_port = port; + psc->sc_domain = 0; /* One broadcast domain by default. */ + psc->sc_vlan = port + 1; /* Tag VLANs by default. */ + psc->sc_priority = 0; /* No default special priority. */ + psc->sc_flags = 0; + } + + /* + * Add per-port sysctl tree/handlers. + */ + port_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "port", + CTLFLAG_RD, NULL, "Switch Ports"); + port_tree = SYSCTL_CHILDREN(port_node); + for (port = 0; port < MV88E61XX_PORTS; port++) { + struct mv88e61xxphy_port_softc *psc; + + psc = &sc->sc_ports[port]; + + portbuf[0] = '0' + port; + portN_node = SYSCTL_ADD_NODE(ctx, port_tree, OID_AUTO, portbuf, + CTLFLAG_RD, NULL, "Switch Port"); + portN_tree = SYSCTL_CHILDREN(portN_node); + + SYSCTL_ADD_PROC(ctx, portN_tree, OID_AUTO, "duplex", + CTLFLAG_RD | CTLTYPE_INT, psc, + MV88E61XXPHY_LINK_SYSCTL_DUPLEX, + mv88e61xxphy_sysctl_link_proc, "IU", + "Media duplex status (0 = half duplex; 1 = full duplex)"); + + SYSCTL_ADD_PROC(ctx, portN_tree, OID_AUTO, "link", + CTLFLAG_RD | CTLTYPE_INT, psc, + MV88E61XXPHY_LINK_SYSCTL_LINK, + mv88e61xxphy_sysctl_link_proc, "IU", + "Link status (0 = down; 1 = up)"); + + SYSCTL_ADD_PROC(ctx, portN_tree, OID_AUTO, "media", + CTLFLAG_RD | CTLTYPE_INT, psc, + MV88E61XXPHY_LINK_SYSCTL_MEDIA, + mv88e61xxphy_sysctl_link_proc, "IU", + "Media speed (0 = unknown; 10 = 10Mbps; 100 = 100Mbps; 1000 = 1Gbps)"); + + SYSCTL_ADD_PROC(ctx, portN_tree, OID_AUTO, "domain", + CTLFLAG_RW | CTLTYPE_INT, psc, + MV88E61XXPHY_PORT_SYSCTL_DOMAIN, + mv88e61xxphy_sysctl_port_proc, "IU", + "Broadcast domain (ports can only talk to other ports in the same domain)"); + + SYSCTL_ADD_PROC(ctx, portN_tree, OID_AUTO, "vlan", + CTLFLAG_RW | CTLTYPE_INT, psc, + MV88E61XXPHY_PORT_SYSCTL_VLAN, + mv88e61xxphy_sysctl_port_proc, "IU", + "Tag packets from/for this port with a given VLAN."); + + SYSCTL_ADD_PROC(ctx, portN_tree, OID_AUTO, "priority", + CTLFLAG_RW | CTLTYPE_INT, psc, + MV88E61XXPHY_PORT_SYSCTL_PRIORITY, + mv88e61xxphy_sysctl_port_proc, "IU", + "Default packet priority for this port."); + } + + mv88e61xxphy_init(sc); + + return (0); +} + +static void +mv88e61xxphy_init(struct mv88e61xxphy_softc *sc) +{ + unsigned port; + uint16_t val; + unsigned i; + + /* Disable all ports. */ + for (port = 0; port < MV88E61XX_PORTS; port++) { + struct mv88e61xxphy_port_softc *psc; + + psc = &sc->sc_ports[port]; + + val = MV88E61XX_READ_PORT(psc, MV88E61XX_PORT_CONTROL); + val &= ~0x3; + MV88E61XX_WRITE_PORT(psc, MV88E61XX_PORT_CONTROL, val); + } + + DELAY(2000); + + /* Reset the switch. */ + MV88E61XX_WRITE(sc, MV88E61XX_GLOBAL, MV88E61XX_GLOBAL_CONTROL, 0xc400); + for (i = 0; i < 100; i++) { + val = MV88E61XX_READ(sc, MV88E61XX_GLOBAL, MV88E61XX_GLOBAL_STATUS); + if ((val & 0xc800) == 0xc800) + break; + DELAY(10); + } + if (i == 100) { + device_printf(sc->sc_dev, "%s: switch reset timed out.\n", __func__); + return; + } + + /* Disable PPU. */ + MV88E61XX_WRITE(sc, MV88E61XX_GLOBAL, MV88E61XX_GLOBAL_CONTROL, 0x0000); + + /* Configure host port and send monitor frames to it. */ + MV88E61XX_WRITE(sc, MV88E61XX_GLOBAL, MV88E61XX_GLOBAL_MONITOR, + (MV88E61XX_HOST_PORT << 12) | (MV88E61XX_HOST_PORT << 8) | + (MV88E61XX_HOST_PORT << 4)); + + /* Disable remote management. */ + MV88E61XX_WRITE(sc, MV88E61XX_GLOBAL, MV88E61XX_GLOBAL_REMOTE_MGMT, 0x0000); + + /* Send all specifically-addressed frames to the host port. */ + MV88E61XX_WRITE(sc, MV88E61XX_GLOBAL2, MV88E61XX_GLOBAL2_MANAGE_2X, 0xffff); + MV88E61XX_WRITE(sc, MV88E61XX_GLOBAL2, MV88E61XX_GLOBAL2_MANAGE_0X, 0xffff); + + /* Remove provider-supplied tag and use it for switching. */ + MV88E61XX_WRITE(sc, MV88E61XX_GLOBAL2, MV88E61XX_GLOBAL2_CONTROL2, + MV88E61XX_GLOBAL2_CONTROL2_REMOVE_PTAG); + + /* Configure all ports. */ + for (port = 0; port < MV88E61XX_PORTS; port++) { + struct mv88e61xxphy_port_softc *psc; + + psc = &sc->sc_ports[port]; + mv88e61xxphy_init_port(psc); + } + + /* Reprogram VLAN table (VTU.) */ + mv88e61xxphy_init_vtu(sc); + + /* Enable all ports. */ + for (port = 0; port < MV88E61XX_PORTS; port++) { + struct mv88e61xxphy_port_softc *psc; + + psc = &sc->sc_ports[port]; + + val = MV88E61XX_READ_PORT(psc, MV88E61XX_PORT_CONTROL); + val |= 0x3; + MV88E61XX_WRITE_PORT(psc, MV88E61XX_PORT_CONTROL, val); + } +} + +static void +mv88e61xxphy_init_port(struct mv88e61xxphy_port_softc *psc) +{ + struct mv88e61xxphy_softc *sc; + unsigned allow_mask; + + sc = psc->sc_switch; + + /* Set media type and flow control. */ + if (psc->sc_port != MV88E61XX_HOST_PORT) { + /* Don't force any media type or flow control. */ + MV88E61XX_WRITE_PORT(psc, MV88E61XX_PORT_FORCE_MAC, 0x0003); + } else { + /* Make CPU port 1G FDX. */ + MV88E61XX_WRITE_PORT(psc, MV88E61XX_PORT_FORCE_MAC, 0x003e); + } + + /* Don't limit flow control pauses. */ + MV88E61XX_WRITE_PORT(psc, MV88E61XX_PORT_PAUSE_CONTROL, 0x0000); + + /* Set various port functions per Linux. */ + if (psc->sc_port != MV88E61XX_HOST_PORT) { + MV88E61XX_WRITE_PORT(psc, MV88E61XX_PORT_CONTROL, 0x04bc); + } else { + /* + * Send frames for unknown unicast and multicast groups to + * host, too. + */ + MV88E61XX_WRITE_PORT(psc, MV88E61XX_PORT_CONTROL, 0x063f); + } + + if (psc->sc_port != MV88E61XX_HOST_PORT) { + /* Disable trunking. */ + MV88E61XX_WRITE_PORT(psc, MV88E61XX_PORT_CONTROL2, 0x0000); + } else { + /* Disable trunking and send learn messages to host. */ + MV88E61XX_WRITE_PORT(psc, MV88E61XX_PORT_CONTROL2, 0x8000); + } + + /* + * Port-based VLAN map; isolates MAC tables and forces ports to talk + * only to the host. + * + * Always allow the host to send to all ports and allow all ports to + * send to the host. + */ + if (psc->sc_port != MV88E61XX_HOST_PORT) { + allow_mask = 1 << MV88E61XX_HOST_PORT; + } else { + allow_mask = (1 << MV88E61XX_PORTS) - 1; + allow_mask &= ~(1 << MV88E61XX_HOST_PORT); + } + MV88E61XX_WRITE_PORT(psc, MV88E61XX_PORT_VLAN_MAP, + (psc->sc_domain << 12) | allow_mask); + + /* VLAN tagging. Set default priority and VLAN tag (or none.) */ + MV88E61XX_WRITE_PORT(psc, MV88E61XX_PORT_VLAN, + (psc->sc_priority << 14) | psc->sc_vlan); + + if (psc->sc_port == MV88E61XX_HOST_PORT) { + /* Set provider ingress tag. */ + MV88E61XX_WRITE_PORT(psc, MV88E61XX_PORT_PROVIDER_PROTO, + ETHERTYPE_VLAN); + + /* Set provider egress tag. */ + MV88E61XX_WRITE_PORT(psc, MV88E61XX_PORT_ETHER_PROTO, + ETHERTYPE_VLAN); + + /* Use secure 802.1q mode and accept only tagged frames. */ + MV88E61XX_WRITE_PORT(psc, MV88E61XX_PORT_FILTER, + MV88E61XX_PORT_FILTER_MAP_DEST | + MV88E61XX_PORT_FILTER_8021Q_SECURE | + MV88E61XX_PORT_FILTER_DISCARD_UNTAGGED); + } else { + /* Don't allow tagged frames. */ + MV88E61XX_WRITE_PORT(psc, MV88E61XX_PORT_FILTER, + MV88E61XX_PORT_FILTER_MAP_DEST | + MV88E61XX_PORT_FILTER_DISCARD_TAGGED); + } +} + +static void +mv88e61xxphy_init_vtu(struct mv88e61xxphy_softc *sc) +{ + unsigned port; + + /* + * Start flush of the VTU. + */ + mv88e61xxphy_vtu_wait(sc); + MV88E61XX_WRITE(sc, MV88E61XX_GLOBAL, MV88E61XX_GLOBAL_VTU_OP, + MV88E61XX_GLOBAL_VTU_OP_BUSY | MV88E61XX_GLOBAL_VTU_OP_OP_FLUSH); + + /* + * Queue each port's VLAN to be programmed. + */ + for (port = 0; port < MV88E61XX_PORTS; port++) { + struct mv88e61xxphy_port_softc *psc; + + psc = &sc->sc_ports[port]; + psc->sc_flags &= ~MV88E61XXPHY_PORT_FLAG_VTU_UPDATE; + if (psc->sc_vlan == 0) + continue; + psc->sc_flags |= MV88E61XXPHY_PORT_FLAG_VTU_UPDATE; + } + + /* + * Program each VLAN that is in use. + */ + for (port = 0; port < MV88E61XX_PORTS; port++) { + struct mv88e61xxphy_port_softc *psc; + + psc = &sc->sc_ports[port]; + if ((psc->sc_flags & MV88E61XXPHY_PORT_FLAG_VTU_UPDATE) == 0) + continue; + mv88e61xxphy_vtu_load(sc, psc->sc_vlan); + } + + /* + * Wait for last pending VTU operation to complete. + */ + mv88e61xxphy_vtu_wait(sc); +} + +static int +mv88e61xxphy_sysctl_link_proc(SYSCTL_HANDLER_ARGS) +{ + struct mv88e61xxphy_port_softc *psc = arg1; + enum mv88e61xxphy_sysctl_link_type type = arg2; + uint16_t val; + unsigned out; + + val = MV88E61XX_READ_PORT(psc, MV88E61XX_PORT_STATUS); + switch (type) { + case MV88E61XXPHY_LINK_SYSCTL_DUPLEX: + if ((val & MV88E61XX_PORT_STATUS_DUPLEX) != 0) + out = 1; + else + out = 0; + break; + case MV88E61XXPHY_LINK_SYSCTL_LINK: + if ((val & MV88E61XX_PORT_STATUS_LINK) != 0) + out = 1; + else + out = 0; + break; + case MV88E61XXPHY_LINK_SYSCTL_MEDIA: + switch (val & MV88E61XX_PORT_STATUS_MEDIA) { + case MV88E61XX_PORT_STATUS_MEDIA_10M: + out = 10; + break; + case MV88E61XX_PORT_STATUS_MEDIA_100M: + out = 100; + break; + case MV88E61XX_PORT_STATUS_MEDIA_1G: + out = 1000; + break; + default: + out = 0; + break; + } + break; + default: + return (EINVAL); + } + return (sysctl_handle_int(oidp, NULL, out, req)); +} + +static int +mv88e61xxphy_sysctl_port_proc(SYSCTL_HANDLER_ARGS) +{ + struct mv88e61xxphy_port_softc *psc = arg1; + enum mv88e61xxphy_sysctl_port_type type = arg2; + struct mv88e61xxphy_softc *sc = psc->sc_switch; + unsigned max, val, *valp; + int error; + + switch (type) { + case MV88E61XXPHY_PORT_SYSCTL_DOMAIN: + valp = &psc->sc_domain; + max = 0xf; + break; + case MV88E61XXPHY_PORT_SYSCTL_VLAN: + valp = &psc->sc_vlan; + max = 0x1000; + break; + case MV88E61XXPHY_PORT_SYSCTL_PRIORITY: + valp = &psc->sc_priority; + max = 3; + break; + default: + return (EINVAL); + } + + val = *valp; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + /* Bounds check value. */ + if (val >= max) + return (EINVAL); + + /* Reinitialize switch with new value. */ + *valp = val; + mv88e61xxphy_init(sc); + + return (0); +} + +static void +mv88e61xxphy_vtu_load(struct mv88e61xxphy_softc *sc, uint16_t vid) +{ + unsigned port; + + /* + * Wait for previous operation to complete. + */ + mv88e61xxphy_vtu_wait(sc); + + /* + * Set VID. + */ + MV88E61XX_WRITE(sc, MV88E61XX_GLOBAL, MV88E61XX_GLOBAL_VTU_VID, + MV88E61XX_GLOBAL_VTU_VID_VALID | vid); + + /* + * Add ports to this VTU. + */ + for (port = 0; port < MV88E61XX_PORTS; port++) { + struct mv88e61xxphy_port_softc *psc; + + psc = &sc->sc_ports[port]; + if (psc->sc_vlan == vid) { + /* + * Send this port its VLAN traffic untagged. + */ + psc->sc_flags &= ~MV88E61XXPHY_PORT_FLAG_VTU_UPDATE; + mv88e61xxphy_vtu_set_membership(sc, port, MV88E61XXPHY_VTU_UNTAGGED); + } else if (psc->sc_port == MV88E61XX_HOST_PORT) { + /* + * The host sees all VLANs tagged. + */ + mv88e61xxphy_vtu_set_membership(sc, port, MV88E61XXPHY_VTU_TAGGED); + } else { + /* + * This port isn't on this VLAN. + */ + mv88e61xxphy_vtu_set_membership(sc, port, MV88E61XXPHY_VTU_DISCARDED); + } + } + + /* + * Start adding this entry. + */ + MV88E61XX_WRITE(sc, MV88E61XX_GLOBAL, MV88E61XX_GLOBAL_VTU_OP, + MV88E61XX_GLOBAL_VTU_OP_BUSY | + MV88E61XX_GLOBAL_VTU_OP_OP_VTU_LOAD); +} + +static void +mv88e61xxphy_vtu_set_membership(struct mv88e61xxphy_softc *sc, unsigned port, + enum mv88e61xxphy_vtu_membership_type type) +{ + unsigned shift, reg; + uint16_t bits; + uint16_t val; + + switch (type) { + case MV88E61XXPHY_VTU_UNMODIFIED: + bits = 0; + break; + case MV88E61XXPHY_VTU_UNTAGGED: + bits = 1; + break; + case MV88E61XXPHY_VTU_TAGGED: + bits = 2; + break; + case MV88E61XXPHY_VTU_DISCARDED: + bits = 3; + break; + default: + return; + } + + if (port < 4) { + reg = MV88E61XX_GLOBAL_VTU_DATA_P0P3; + shift = port * 4; + } else { + reg = MV88E61XX_GLOBAL_VTU_DATA_P4P5; + shift = (port - 4) * 4; + } + + val = MV88E61XX_READ(sc, MV88E61XX_GLOBAL, reg); + val |= bits << shift; + MV88E61XX_WRITE(sc, MV88E61XX_GLOBAL, reg, val); +} + +static void +mv88e61xxphy_vtu_wait(struct mv88e61xxphy_softc *sc) +{ + uint16_t val; + + for (;;) { + val = MV88E61XX_READ(sc, MV88E61XX_GLOBAL, MV88E61XX_GLOBAL_VTU_OP); + if ((val & MV88E61XX_GLOBAL_VTU_OP_BUSY) == 0) + return; + } +} + +static device_method_t mv88e61xxphy_methods[] = { + /* device interface */ + DEVMETHOD(device_probe, mv88e61xxphy_probe), + DEVMETHOD(device_attach, mv88e61xxphy_attach), + DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + { 0, 0 } +}; + +static devclass_t mv88e61xxphy_devclass; + +static driver_t mv88e61xxphy_driver = { + "mv88e61xxphy", + mv88e61xxphy_methods, + sizeof(struct mv88e61xxphy_softc) +}; + +DRIVER_MODULE(mv88e61xxphy, octe, mv88e61xxphy_driver, mv88e61xxphy_devclass, 0, 0); Added: head/sys/mips/cavium/octe/mv88e61xxphyreg.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/cavium/octe/mv88e61xxphyreg.h Wed Oct 13 09:17:44 2010 (r213762) @@ -0,0 +1,149 @@ +/*- + * Copyright (c) 2010 Juli Mallett + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Register definitions for Marvell MV88E61XX + * + * Note that names and definitions were gleaned from Linux and U-Boot patches + * released by Marvell, often by looking at contextual use of the registers + * involved, and may not be representative of the full functionality of those + * registers and are certainly not an exhaustive enumeration of registers. + * + * For an exhaustive enumeration of registers, check out the QD-DSDT package + * included in the Marvell ARM Feroceon Board Support Package for Linux. + */ + +#ifndef _MIPS_CAVIUM_OCTE_MV88E61XXPHYREG_H_ +#define _MIPS_CAVIUM_OCTE_MV88E61XXPHYREG_H_ + +/* + * Port addresses & per-port registers. + */ +#define MV88E61XX_PORT(x) (0x10 + (x)) +#define MV88E61XX_HOST_PORT (5) +#define MV88E61XX_PORTS (6) + +#define MV88E61XX_PORT_STATUS (0x00) +#define MV88E61XX_PORT_FORCE_MAC (0x01) +#define MV88E61XX_PORT_PAUSE_CONTROL (0x02) +#define MV88E61XX_PORT_REVISION (0x03) +#define MV88E61XX_PORT_CONTROL (0x04) +#define MV88E61XX_PORT_CONTROL2 (0x05) +#define MV88E61XX_PORT_VLAN_MAP (0x06) +#define MV88E61XX_PORT_VLAN (0x07) +#define MV88E61XX_PORT_FILTER (0x08) +#define MV88E61XX_PORT_EGRESS_CONTROL (0x09) +#define MV88E61XX_PORT_EGRESS_CONTROL2 (0x0a) +#define MV88E61XX_PORT_PORT_LEARN (0x0b) +#define MV88E61XX_PORT_ATU_CONTROL (0x0c) +#define MV88E61XX_PORT_PRIORITY_CONTROL (0x0d) +#define MV88E61XX_PORT_ETHER_PROTO (0x0f) +#define MV88E61XX_PORT_PROVIDER_PROTO (0x1a) +#define MV88E61XX_PORT_PRIORITY_MAP (0x18) +#define MV88E61XX_PORT_PRIORITY_MAP2 (0x19) + +/* + * Fields and values in each register. + */ +#define MV88E61XX_PORT_STATUS_MEDIA (0x0300) +#define MV88E61XX_PORT_STATUS_MEDIA_10M (0x0000) +#define MV88E61XX_PORT_STATUS_MEDIA_100M (0x0100) +#define MV88E61XX_PORT_STATUS_MEDIA_1G (0x0200) +#define MV88E61XX_PORT_STATUS_DUPLEX (0x0400) +#define MV88E61XX_PORT_STATUS_LINK (0x0800) +#define MV88E61XX_PORT_STATUS_FC (0x8000) + +#define MV88E61XX_PORT_CONTROL_DOUBLE_TAG (0x0200) + +#define MV88E61XX_PORT_FILTER_MAP_DEST (0x0080) +#define MV88E61XX_PORT_FILTER_DISCARD_UNTAGGED (0x0100) +#define MV88E61XX_PORT_FILTER_DISCARD_TAGGED (0x0200) +#define MV88E61XX_PORT_FILTER_8021Q_MODE (0x0c00) +#define MV88E61XX_PORT_FILTER_8021Q_DISABLED (0x0000) +#define MV88E61XX_PORT_FILTER_8021Q_FALLBACK (0x0400) +#define MV88E61XX_PORT_FILTER_8021Q_CHECK (0x0800) +#define MV88E61XX_PORT_FILTER_8021Q_SECURE (0x0c00) + +/* + * Global address & global registers. + */ +#define MV88E61XX_GLOBAL (0x1b) + +#define MV88E61XX_GLOBAL_STATUS (0x00) +#define MV88E61XX_GLOBAL_CONTROL (0x04) +#define MV88E61XX_GLOBAL_VTU_OP (0x05) +#define MV88E61XX_GLOBAL_VTU_VID (0x06) +#define MV88E61XX_GLOBAL_VTU_DATA_P0P3 (0x07) +#define MV88E61XX_GLOBAL_VTU_DATA_P4P5 (0x08) +#define MV88E61XX_GLOBAL_ATU_CONTROL (0x0a) +#define MV88E61XX_GLOBAL_PRIORITY_MAP (0x18) +#define MV88E61XX_GLOBAL_MONITOR (0x1a) +#define MV88E61XX_GLOBAL_REMOTE_MGMT (0x1c) +#define MV88E61XX_GLOBAL_STATS (0x1d) + +/* + * Fields and values in each register. + */ +#define MV88E61XX_GLOBAL_VTU_OP_BUSY (0x8000) +#define MV88E61XX_GLOBAL_VTU_OP_OP (0x7000) +#define MV88E61XX_GLOBAL_VTU_OP_OP_FLUSH (0x1000) +#define MV88E61XX_GLOBAL_VTU_OP_OP_VTU_LOAD (0x3000) + +#define MV88E61XX_GLOBAL_VTU_VID_VALID (0x1000) + +/* + * Second global address & second global registers. + */ +#define MV88E61XX_GLOBAL2 (0x1c) + +#define MV88E61XX_GLOBAL2_MANAGE_2X (0x02) +#define MV88E61XX_GLOBAL2_MANAGE_0X (0x03) +#define MV88E61XX_GLOBAL2_CONTROL2 (0x05) +#define MV88E61XX_GLOBAL2_TRUNK_MASK (0x07) +#define MV88E61XX_GLOBAL2_TRUNK_MAP (0x08) +#define MV88E61XX_GLOBAL2_RATELIMIT (0x09) +#define MV88E61XX_GLOBAL2_VLAN_CONTROL (0x0b) +#define MV88E61XX_GLOBAL2_MAC_ADDRESS (0x0d) + +/* + * Fields and values in each register. + */ +#define MV88E61XX_GLOBAL2_CONTROL2_DOUBLE_USE (0x8000) +#define MV88E61XX_GLOBAL2_CONTROL2_LOOP_PREVENT (0x4000) +#define MV88E61XX_GLOBAL2_CONTROL2_FLOW_MESSAGE (0x2000) +#define MV88E61XX_GLOBAL2_CONTROL2_FLOOD_BC (0x1000) +#define MV88E61XX_GLOBAL2_CONTROL2_REMOVE_PTAG (0x0800) +#define MV88E61XX_GLOBAL2_CONTROL2_AGE_INT (0x0400) +#define MV88E61XX_GLOBAL2_CONTROL2_FLOW_TAG (0x0200) +#define MV88E61XX_GLOBAL2_CONTROL2_ALWAYS_VTU (0x0100) +#define MV88E61XX_GLOBAL2_CONTROL2_FORCE_FC_PRI (0x0080) +#define MV88E61XX_GLOBAL2_CONTROL2_FC_PRI (0x0070) +#define MV88E61XX_GLOBAL2_CONTROL2_MGMT_TO_HOST (0x0008) +#define MV88E61XX_GLOBAL2_CONTROL2_MGMT_PRI (0x0007) + +#endif /* !_MIPS_CAVIUM_OCTE_MV88E61XXPHYREG_H_ */ Modified: head/sys/mips/cavium/octe/octe.c ============================================================================== --- head/sys/mips/cavium/octe/octe.c Wed Oct 13 06:28:40 2010 (r213761) +++ head/sys/mips/cavium/octe/octe.c Wed Oct 13 09:17:44 2010 (r213762) @@ -146,6 +146,7 @@ octe_attach(device_t dev) { struct ifnet *ifp; cvm_oct_private_t *priv; + device_t child; unsigned qos; int error; @@ -155,10 +156,15 @@ octe_attach(device_t dev) if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if (priv->phy_id != -1) { - error = mii_phy_probe(dev, &priv->miibus, octe_mii_medchange, - octe_mii_medstat); - if (error != 0) { - device_printf(dev, "missing phy %u\n", priv->phy_id); + if (priv->phy_device == NULL) { + error = mii_phy_probe(dev, &priv->miibus, octe_mii_medchange, + octe_mii_medstat); + if (error != 0) + device_printf(dev, "missing phy %u\n", priv->phy_id); + } else { + child = device_add_child(dev, priv->phy_device, -1); + if (child == NULL) + device_printf(dev, "missing phy %u device %s\n", priv->phy_id, priv->phy_device); } } @@ -202,7 +208,7 @@ octe_attach(device_t dev) IFQ_SET_READY(&ifp->if_snd); OCTE_TX_UNLOCK(priv); - return (0); + return (bus_generic_attach(dev)); } static int Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Wed Oct 13 06:28:40 2010 (r213761) +++ head/sys/mips/conf/OCTEON1 Wed Oct 13 09:17:44 2010 (r213762) @@ -180,6 +180,10 @@ device uart # Generic UART driver # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! device octe +# Switch PHY support for the octe driver. These currently present a VLAN per +# physical port, but may eventually provide support for DSA or similar instead. +#device mv88e61xxphy # Marvell 88E61XX + # PCI Ethernet NICs. device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel PRO/1000 Gigabit Ethernet Family From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 09:33:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79D461065675; Wed, 13 Oct 2010 09:33:26 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6833E8FC13; Wed, 13 Oct 2010 09:33:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9D9XQ6f079166; Wed, 13 Oct 2010 09:33:26 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9D9XQEk079164; Wed, 13 Oct 2010 09:33:26 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201010130933.o9D9XQEk079164@svn.freebsd.org> From: Bruce Cran Date: Wed, 13 Oct 2010 09:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213763 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 09:33:26 -0000 Author: brucec Date: Wed Oct 13 09:33:26 2010 New Revision: 213763 URL: http://svn.freebsd.org/changeset/base/213763 Log: Use the RFC2606 domain example.com in examples. Modified: head/usr.sbin/sysinstall/tcpip.c Modified: head/usr.sbin/sysinstall/tcpip.c ============================================================================== --- head/usr.sbin/sysinstall/tcpip.c Wed Oct 13 09:17:44 2010 (r213762) +++ head/usr.sbin/sysinstall/tcpip.c Wed Oct 13 09:33:26 2010 (r213763) @@ -72,12 +72,12 @@ static char ipv6addr[INET6_ADDRSTRLEN]; static Layout layout[] = { #define LAYOUT_HOSTNAME 0 { 1, 2, 25, HOSTNAME_FIELD_LEN - 1, - "Host:", "Your fully-qualified hostname, e.g. foo.bar.com", + "Host:", "Your fully-qualified hostname, e.g. foo.example.com", hostname, STRINGOBJ, NULL }, #define LAYOUT_DOMAINNAME 1 { 1, 35, 20, HOSTNAME_FIELD_LEN - 1, "Domain:", - "The name of the domain that your machine is in, e.g. bar.com", + "The name of the domain that your machine is in, e.g. example.com", domainname, STRINGOBJ, NULL }, #define LAYOUT_GATEWAY 2 { 5, 2, 18, IPADDR_FIELD_LEN - 1, From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 10:31:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B762D106566C; Wed, 13 Oct 2010 10:31:32 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A59768FC08; Wed, 13 Oct 2010 10:31:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DAVWhp080443; Wed, 13 Oct 2010 10:31:32 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DAVWoQ080441; Wed, 13 Oct 2010 10:31:32 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131031.o9DAVWoQ080441@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 10:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213764 - head/usr.bin/lex X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 10:31:32 -0000 Author: rpaulo Date: Wed Oct 13 10:31:32 2010 New Revision: 213764 URL: http://svn.freebsd.org/changeset/base/213764 Log: Don't define the input() function ifdef YY_NO_INPUT. This was previously done for the input() function. Submitted by: Norberto Lopes Modified: head/usr.bin/lex/flex.skl Modified: head/usr.bin/lex/flex.skl ============================================================================== --- head/usr.bin/lex/flex.skl Wed Oct 13 09:33:26 2010 (r213763) +++ head/usr.bin/lex/flex.skl Wed Oct 13 10:31:32 2010 (r213764) @@ -979,6 +979,7 @@ void yyFlexLexer::yyunput( int c, char* %- +#ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput() #else @@ -1054,6 +1055,7 @@ int yyFlexLexer::yyinput() return c; } +#endif /* ifndef YY_NO_INPUT */ %- From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 10:33:02 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06D1A1065695; Wed, 13 Oct 2010 10:33:02 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8DC08FC16; Wed, 13 Oct 2010 10:33:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DAX12c080537; Wed, 13 Oct 2010 10:33:01 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DAX1EE080534; Wed, 13 Oct 2010 10:33:01 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131033.o9DAX1EE080534@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 10:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213765 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 10:33:02 -0000 Author: rpaulo Date: Wed Oct 13 10:33:01 2010 New Revision: 213765 URL: http://svn.freebsd.org/changeset/base/213765 Log: Define YY_NO_INPUT. This makes aicasm buildable by clang with Werror turned on. Modified: head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Modified: head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l Wed Oct 13 10:31:32 2010 (r213764) +++ head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l Wed Oct 13 10:33:01 2010 (r213765) @@ -61,6 +61,7 @@ #include "aicasm_symbol.h" #include "aicasm_macro_gram.h" +#define YY_NO_INPUT #define MAX_STR_CONST 4096 static char string_buf[MAX_STR_CONST]; static char *string_buf_ptr; Modified: head/sys/dev/aic7xxx/aicasm/aicasm_scan.l ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Wed Oct 13 10:31:32 2010 (r213764) +++ head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Wed Oct 13 10:33:01 2010 (r213765) @@ -61,6 +61,7 @@ #include "aicasm_symbol.h" #include "aicasm_gram.h" +#define YY_NO_INPUT /* This is used for macro body capture too, so err on the large size. */ #define MAX_STR_CONST 4096 static char string_buf[MAX_STR_CONST]; From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 10:38:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FA7E106564A; Wed, 13 Oct 2010 10:38:09 +0000 (UTC) (envelope-from gprspb@mail.ru) Received: from fallback2.mail.ru (fallback2.mail.ru [94.100.176.87]) by mx1.freebsd.org (Postfix) with ESMTP id B4B708FC13; Wed, 13 Oct 2010 10:38:08 +0000 (UTC) Received: from smtp13.mail.ru (smtp13.mail.ru [94.100.176.90]) by fallback2.mail.ru (mPOP.Fallback_MX) with ESMTP id 586752D1098C; Wed, 13 Oct 2010 01:08:41 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=0L93DS/TJL4JSWOMMF8v5FCk42YkJiFrqQNuRyHwKD8=; b=jrXiHfCT/brqopmALR62Ndr4/IyJ9CniIE9JtHR6FaSozCCG0yyH3djvwCPooPNXeLNISC6dK5UL+Ag9GFbkpcylVNoqwk9263hwYFwwyB0GpAqC4UuXZv8tmfSYC8Xy; Received: from [93.185.182.46] (port=52537 helo=gpr.nnz-home.ru) by smtp13.mail.ru with asmtp (TLSv1:AES256-SHA:256) id 1P5m5H-0003sj-00; Wed, 13 Oct 2010 01:08:31 +0400 Received: from gpr by gpr.nnz-home.ru with local (Exim 4.72 (FreeBSD)) (envelope-from ) id 1P5m4q-0001AR-Lm; Wed, 13 Oct 2010 01:08:04 +0400 Date: Wed, 13 Oct 2010 01:08:04 +0400 From: Gennady Proskurin To: Andriy Gapon Message-ID: <20101012210804.GA4286@gpr.nnz-home.ru> References: <201010090807.o9987nG0030939@svn.freebsd.org> <20101009191600.N3531@besplex.bde.org> <4CB03A82.6040701@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CB03A82.6040701@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Mras: Ok Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r213648 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 10:38:09 -0000 On Sat, Oct 09, 2010 at 12:48:50PM +0300, Andriy Gapon wrote: > on 09/10/2010 12:33 Bruce Evans said the following: > > On Sat, 9 Oct 2010, Andriy Gapon wrote: > > > >> Log: > >> panic_cpu variable should be volatile > >> > >> This is to prevent caching of its value in a register when it is checked > >> and modified by multiple CPUs in parallel. > >> Also, move the variable into the scope of the only function that uses it. > >> > >> Reviewed by: jhb > >> Hint from: mdf > >> MFC after: 1 week > > > > I doubt that this is either necessary or sufficient. Most variables > > aren't volatile while they are locked by a mutex. But panic() cannot use > > normal mutex locking, so it should access this variable using atomic > > ops with memory barriers. The compiler part of the memory barriers > > effectively make _all_ variables temporily volatile. However, 2 of the > > the 4 accesses to this variable doesn't use an atomic op. > > > > % #ifdef SMP > > % /* > > % * We don't want multiple CPU's to panic at the same time, so we > > % * use panic_cpu as a simple spinlock. We have to keep checking > > % * panic_cpu if we are spinning in case the panic on the first > > % * CPU is canceled. > > % */ > > % if (panic_cpu != PCPU_GET(cpuid)) > > > > This access doesn't use an atomic op. > > > > % while (atomic_cmpset_int(&panic_cpu, NOCPU, > > % PCPU_GET(cpuid)) == 0) > > > > This access uses an atomic op. Not all atomic ops use memory barriers, > > at least on i386. However, this one does, at least on i386. > > > > (I'm always confused about what atomic_any() without acq or release > > means. Do they mean that you don't want a memory barrier (this is > > what the mostly give, at least on i386), and if so, what use are > > they? There are far too many atomic ops, for far too many never-used > > widths, with alternative spellings to encourage using a wrong one. > > cmpset is is especially confusing since it you can spell it as cmpset, > > cmpset_acq or compset_rel and always get the barrier, at least on > > i386. At least cmpset only supports 1 width, at least on i386.) > > > > % while (panic_cpu != NOCPU) > > > > This access doesn't use an atomic op. > > > > % ; /* nothing */ > > % #endif > > % ... > > % #ifdef RESTARTABLE_PANICS > > % /* See if the user aborted the panic, in which case we continue. */ > > % if (panicstr == NULL) { > > % #ifdef SMP > > % atomic_store_rel_int(&panic_cpu, NOCPU); > > > > This access uses an atomic op with a memory barrier, at least on i386. > > Now its rel semantics are clear. > > > > panicstr is non-volatile and never accessed by an atomic op, so it probably > > strictly needs to be declared volatile even more than panic_cpu. I think > > I agree about panicstr. > But I am not sure if we have places in code (beyond panic function) itself where > volatile vs. non-volatile would make any actual difference. > But still. > > > the only thing that makes it work now is that it is bogusly pubic, and > > compilers can't analyze the whole program yet -- if they could, then they > > would see that it is only set in panic(). > > > > % #endif > > % return; > > % } > > % #endif > > % #endif > > > > Now, why don't the partial memory barriers prevent caching the variable? > > > > % if (panic_cpu != PCPU_GET(cpuid)) > > % while (atomic_cmpset_int(&panic_cpu, NOCPU, > > % PCPU_GET(cpuid)) == 0) > > % while (panic_cpu != NOCPU) > > % ; /* nothing */ > > > > The very first access can't reasonably use a cachec value. atomic_cmpset() > > can change panic_cpu, so even without the memory barrier, panic_cpu must > > be reloaded for the third access the first time. But then when the third > > access is repeated in the second while loop, the missing atomic op with > > barrier makes things very broken. panic_cpu isn't changed by the loop, > > and the compiler thinks that it isn't changed by anything else either, so > > the compiler may reduce the loop to: > > > > % if (panic_cpu != NOCPU) > > % for (;;) > > % ; /* nothing */ > > > Yes, it's exactly the last loop that had the problem. > On amd64 with -O2: > .loc 1 544 0 > movl panic_cpu(%rip), %eax > .LVL134: > .p2align 4,,7 > .L210: > cmpl $255, %eax > jne .L210 > jmp .L225 > > > except I've seen claims that even an endless for loop can be optimized > > to nothing. Declaring panic_cpu as volatile prevents the compiler doing > > this, but I think it is insufficient. We really do want to see panic_cpu > > changed by other CPUs, and what is the point of atomic_load_acq*() if not > > to use for this -- if declaring things volatile were sufficient, then we > > could just use *(volatile *)&var. atomic_load/store_acq/rel*() on i386 > > I discussed this with kib and the idea is that atomic operation is not needed in > that place and volatile is sufficient, because we don't need barrier semantics > there and only want to ensure that variable is reloaded from memory. If I understand correctly, without acquiring barrier, variable is not guaranteed to be loaded from memory, it can end up with some stale value from cpu's cache or pipeline. If incorrect value will be checked in the first "if" operator, it can lead to skiping all the atomic synchronization. The same about writing to variable, without barrier new value may be written to some local cpu cache and not be seen by readers until it is flushed from cache. This also applies to r213736. > atomic_store_rel at the end seems to be needed because of inter-dependency > between panicstr and panic_cpu. That is we want changes to panicstr to becomes > visible at the same time (before actually) changes to panic_cpu are visible. > > > used to do exactly that for the UP case, but use a lock prefix and also > > a memory barrier for the SMP case. Current versions also use the memory > > barrier in the UP case, and have a relevant comment aboat this: > > > > % Index: atomic.h > > % =================================================================== > > % RCS file: /home/ncvs/src/sys/i386/include/atomic.h,v > > % retrieving revision 1.32.2.1 > > % retrieving revision 1.55 > > % diff -u -1 -r1.32.2.1 -r1.55 > > % --- atomic.h 24 Nov 2004 18:10:02 -0000 1.32.2.1 > > % +++ atomic.h 20 May 2010 06:18:03 -0000 1.55 > > % @@ -181,5 +207,5 @@ > > % * SMP kernels. For UP kernels, however, the cache of the single processor > > % - * is always consistent, so we don't need any memory barriers. > > % + * is always consistent, so we only need to take care of compiler. > > % */ > > > > i386 doesn't really have memory barriers (maybe l/s/mfence are, but we > > don't use them even on amd64), but we have to use "memoy" clobbers to > > take care of the compiler, or we would have to declare too many things > > as volatile. > > > > % -#define ATOMIC_STORE_LOAD(TYPE, LOP, SOP) \ > > % +#define ATOMIC_STORE_LOAD(TYPE, LOP, SOP) \ > > % static __inline u_##TYPE \ > > % @@ -187,3 +213,7 @@ > > % { \ > > % - return (*p); \ > > % + u_##TYPE tmp; \ > > % + \ > > % + tmp = *p; \ > > % + __asm __volatile("" : : : "memory"); \ > > % + return (tmp); \ > > % } \ > > % @@ -193,2 +223,3 @@ > > % { \ > > % + __asm __volatile("" : : : "memory"); \ > > % *p = v; \ > > > > 5-STABLE is still missing the memory clobber, so a newer compiler on it > > might compile away the while loop even when it is fixed to use > > atomic_load_acq_int(). > > > > % ... > > % if (panicstr == NULL) { > > % atomic_store_rel_int(&panic_cpu, NOCPU); > > > > Smaller problems with this. Just the unlocked access to panicstr. > > Maybe not a problem, except to understand why it isn't one. I think > > the earlier while loops prevent concurrent modification of panicstr. > > Recursive panics are possible, but since they are possible the compiler > > should see that they are possible even if it analyzes the whole program, > > and thus know that it cannot cache panicstr. > > > > Bruce > > > -- > Andriy Gapon > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 10:45:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74754106564A; Wed, 13 Oct 2010 10:45:22 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62EA68FC28; Wed, 13 Oct 2010 10:45:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DAjMak080812; Wed, 13 Oct 2010 10:45:22 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DAjMD6080810; Wed, 13 Oct 2010 10:45:22 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131045.o9DAjMD6080810@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 10:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213766 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 10:45:22 -0000 Author: rpaulo Date: Wed Oct 13 10:45:22 2010 New Revision: 213766 URL: http://svn.freebsd.org/changeset/base/213766 Log: Purposely tell the compiler that we ignore the return value of ADDCARRY() in the REDUCE macro. Reviewed by: dim, rdivacky Modified: head/sys/netinet6/in6_cksum.c Modified: head/sys/netinet6/in6_cksum.c ============================================================================== --- head/sys/netinet6/in6_cksum.c Wed Oct 13 10:33:01 2010 (r213765) +++ head/sys/netinet6/in6_cksum.c Wed Oct 13 10:45:22 2010 (r213766) @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); */ #define ADDCARRY(x) (x > 65535 ? x -= 65535 : x) -#define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);} +#define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; (void)ADDCARRY(sum);} /* * m MUST contain a continuous IP6 header. From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 11:04:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79D3B106566B; Wed, 13 Oct 2010 11:04:56 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D9378FC14; Wed, 13 Oct 2010 11:04:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DB4uTu085344; Wed, 13 Oct 2010 11:04:56 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DB4uxB085342; Wed, 13 Oct 2010 11:04:56 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131104.o9DB4uxB085342@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 11:04:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213767 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 11:04:56 -0000 Author: rpaulo Date: Wed Oct 13 11:04:55 2010 New Revision: 213767 URL: http://svn.freebsd.org/changeset/base/213767 Log: Release dim from mentorship. Congrats! Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Wed Oct 13 10:45:22 2010 (r213766) +++ svnadmin/conf/mentors Wed Oct 13 11:04:55 2010 (r213767) @@ -15,7 +15,6 @@ anchie bz andreast nwhitehorn andrew imp dchagin kib -dim rpaulo Co-mentor: ed eri mlaier Co-mentor: thompsa gabor delphij hselasky thompsa From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 11:35:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 933481065670; Wed, 13 Oct 2010 11:35:59 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80AF08FC15; Wed, 13 Oct 2010 11:35:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DBZxfu086105; Wed, 13 Oct 2010 11:35:59 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DBZxtN086101; Wed, 13 Oct 2010 11:35:59 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131135.o9DBZxtN086101@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 11:35:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213769 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 11:35:59 -0000 Author: rpaulo Date: Wed Oct 13 11:35:59 2010 New Revision: 213769 URL: http://svn.freebsd.org/changeset/base/213769 Log: The canonical way to print __func__ when using KASSERT() is to write ("%s", __func__). This avoids clang's -Wformat-string warnings. Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part_ebr.c head/sys/geom/part/g_part_mbr.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Wed Oct 13 11:23:27 2010 (r213768) +++ head/sys/geom/part/g_part.c Wed Oct 13 11:35:59 2010 (r213769) @@ -1597,7 +1597,8 @@ g_part_ctlreq(struct gctl_req *req, stru (gpp.gpp_parms & G_PART_PARM_FLAGS) && strchr(gpp.gpp_flags, 'C') != NULL) ? 1 : 0; if (auto_commit) { - KASSERT(gpp.gpp_parms & G_PART_PARM_GEOM, (__func__)); + KASSERT(gpp.gpp_parms & G_PART_PARM_GEOM, ("%s", + __func__)); error = g_part_ctl_commit(req, &gpp); } } @@ -1737,11 +1738,11 @@ g_part_dumpconf(struct sbuf *sb, const c struct g_part_entry *entry; struct g_part_table *table; - KASSERT(sb != NULL && gp != NULL, (__func__)); + KASSERT(sb != NULL && gp != NULL, ("%s", __func__)); table = gp->softc; if (indent == NULL) { - KASSERT(cp == NULL && pp != NULL, (__func__)); + KASSERT(cp == NULL && pp != NULL, ("%s", __func__)); entry = pp->private; if (entry == NULL) return; @@ -1756,7 +1757,7 @@ g_part_dumpconf(struct sbuf *sb, const c */ G_PART_DUMPCONF(table, entry, sb, indent); } else if (cp != NULL) { /* Consumer configuration. */ - KASSERT(pp == NULL, (__func__)); + KASSERT(pp == NULL, ("%s", __func__)); /* none */ } else if (pp != NULL) { /* Provider configuration. */ entry = pp->private; @@ -1799,11 +1800,11 @@ g_part_orphan(struct g_consumer *cp) struct g_part_table *table; pp = cp->provider; - KASSERT(pp != NULL, (__func__)); + KASSERT(pp != NULL, ("%s", __func__)); G_PART_TRACE((G_T_TOPOLOGY, "%s(%s)", __func__, pp->name)); g_topology_assert(); - KASSERT(pp->error != 0, (__func__)); + KASSERT(pp->error != 0, ("%s", __func__)); table = cp->geom->softc; if (table != NULL && table->gpt_opened) g_access(cp, -1, -1, -1); Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Wed Oct 13 11:23:27 2010 (r213768) +++ head/sys/geom/part/g_part_ebr.c Wed Oct 13 11:35:59 2010 (r213769) @@ -221,8 +221,8 @@ g_part_ebr_add(struct g_part_table *base if (baseentry->gpe_deleted) bzero(&entry->ent, sizeof(entry->ent)); - KASSERT(baseentry->gpe_start <= start, (__func__)); - KASSERT(baseentry->gpe_end >= start + size - 1, (__func__)); + KASSERT(baseentry->gpe_start <= start, ("%s", __func__)); + KASSERT(baseentry->gpe_end >= start + size - 1, ("%s", __func__)); baseentry->gpe_index = (start / sectors) + 1; baseentry->gpe_offset = (off_t)(start + sectors) * pp->sectorsize; baseentry->gpe_start = start; Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Wed Oct 13 11:23:27 2010 (r213768) +++ head/sys/geom/part/g_part_mbr.c Wed Oct 13 11:35:59 2010 (r213769) @@ -204,8 +204,8 @@ g_part_mbr_add(struct g_part_table *base if (baseentry->gpe_deleted) bzero(&entry->ent, sizeof(entry->ent)); - KASSERT(baseentry->gpe_start <= start, (__func__)); - KASSERT(baseentry->gpe_end >= start + size - 1, (__func__)); + KASSERT(baseentry->gpe_start <= start, ("%s", __func__)); + KASSERT(baseentry->gpe_end >= start + size - 1, ("%s", __func__)); baseentry->gpe_start = start; baseentry->gpe_end = start + size - 1; entry->ent.dp_start = start; From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 11:37:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8FEB1065674; Wed, 13 Oct 2010 11:37:12 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95D338FC0C; Wed, 13 Oct 2010 11:37:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DBbCvl086191; Wed, 13 Oct 2010 11:37:12 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DBbCPg086187; Wed, 13 Oct 2010 11:37:12 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131137.o9DBbCPg086187@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 11:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213770 - in head/sys/dev: kbd kbdmux syscons X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 11:37:12 -0000 Author: rpaulo Date: Wed Oct 13 11:37:12 2010 New Revision: 213770 URL: http://svn.freebsd.org/changeset/base/213770 Log: Explicitly tell the compiler that we don't care about the return value of kbdd_ioctl(). Modified: head/sys/dev/kbd/kbd.c head/sys/dev/kbdmux/kbdmux.c head/sys/dev/syscons/syscons.c Modified: head/sys/dev/kbd/kbd.c ============================================================================== --- head/sys/dev/kbd/kbd.c Wed Oct 13 11:35:59 2010 (r213769) +++ head/sys/dev/kbd/kbd.c Wed Oct 13 11:37:12 2010 (r213770) @@ -224,7 +224,7 @@ kbd_register(keyboard_t *kbd) strcpy(ki.kb_name, kbd->kb_name); ki.kb_unit = kbd->kb_unit; - kbdd_ioctl(mux, KBADDKBD, (caddr_t) &ki); + (void)kbdd_ioctl(mux, KBADDKBD, (caddr_t) &ki); } return (index); @@ -241,7 +241,7 @@ kbd_register(keyboard_t *kbd) strcpy(ki.kb_name, kbd->kb_name); ki.kb_unit = kbd->kb_unit; - kbdd_ioctl(mux, KBADDKBD, (caddr_t) &ki); + (void)kbdd_ioctl(mux, KBADDKBD, (caddr_t) &ki); } return (index); @@ -1148,7 +1148,7 @@ genkbd_diag(keyboard_t *kbd, int level) (s) |= l ## DOWN; \ (s) ^= l ## ED; \ i = (s) & LOCK_MASK; \ - kbdd_ioctl((k), KDSETLED, (caddr_t)&i); \ + (void)kbdd_ioctl((k), KDSETLED, (caddr_t)&i); \ } static u_int @@ -1308,7 +1308,7 @@ genkbd_keyaction(keyboard_t *kbd, int ke #else state &= ~CLKED; i = state & LOCK_MASK; - kbdd_ioctl(kbd, KDSETLED, (caddr_t)&i); + (void)kbdd_ioctl(kbd, KDSETLED, (caddr_t)&i); #endif break; case SLK: @@ -1344,7 +1344,7 @@ genkbd_keyaction(keyboard_t *kbd, int ke #else state |= CLKED; i = state & LOCK_MASK; - kbdd_ioctl(kbd, KDSETLED, (caddr_t)&i); + (void)kbdd_ioctl(kbd, KDSETLED, (caddr_t)&i); #endif break; case SLK: Modified: head/sys/dev/kbdmux/kbdmux.c ============================================================================== --- head/sys/dev/kbdmux/kbdmux.c Wed Oct 13 11:35:59 2010 (r213769) +++ head/sys/dev/kbdmux/kbdmux.c Wed Oct 13 11:37:12 2010 (r213770) @@ -1115,7 +1115,7 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd /* KDSETLED on all slave keyboards */ SLIST_FOREACH(k, &state->ks_kbds, next) - kbdd_ioctl(k->kbd, KDSETLED, arg); + (void)kbdd_ioctl(k->kbd, KDSETLED, arg); KBDMUX_UNLOCK(state); break; @@ -1146,7 +1146,7 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd /* KDSKBSTATE on all slave keyboards */ SLIST_FOREACH(k, &state->ks_kbds, next) - kbdd_ioctl(k->kbd, KDSKBSTATE, arg); + (void)kbdd_ioctl(k->kbd, KDSKBSTATE, arg); KBDMUX_UNLOCK(state); @@ -1192,7 +1192,7 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd /* perform command on all slave keyboards */ SLIST_FOREACH(k, &state->ks_kbds, next) - kbdd_ioctl(k->kbd, cmd, arg); + (void)kbdd_ioctl(k->kbd, cmd, arg); KBDMUX_UNLOCK(state); break; @@ -1205,7 +1205,7 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd /* perform command on all slave keyboards */ SLIST_FOREACH(k, &state->ks_kbds, next) - kbdd_ioctl(k->kbd, cmd, arg); + (void)kbdd_ioctl(k->kbd, cmd, arg); KBDMUX_UNLOCK(state); /* FALLTHROUGH */ Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Wed Oct 13 11:35:59 2010 (r213769) +++ head/sys/dev/syscons/syscons.c Wed Oct 13 11:37:12 2010 (r213770) @@ -475,7 +475,7 @@ sc_attach_unit(int unit, int flags) scrn_timer(sc); /* set up the keyboard */ - kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); + (void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); update_kbd_state(scp, scp->status, LOCK_MASK); printf("%s%d: %s <%d virtual consoles, flags=0x%x>\n", @@ -584,7 +584,7 @@ sctty_open(struct tty *tp) #ifndef __sparc64__ if (sc->kbd != NULL) { key.keynum = KEYCODE_BS; - kbdd_ioctl(sc->kbd, GIO_KEYMAPENT, (caddr_t)&key); + (void)kbdd_ioctl(sc->kbd, GIO_KEYMAPENT, (caddr_t)&key); tp->t_termios.c_cc[VERASE] = key.key.map[0]; } #endif @@ -643,7 +643,7 @@ sctty_close(struct tty *tp) #endif scp->kbd_mode = K_XLATE; if (scp == scp->sc->cur_scp) - kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); + (void)kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); DPRINTF(5, ("done.\n")); } } @@ -1222,7 +1222,7 @@ sctty_ioctl(struct tty *tp, u_long cmd, case K_CODE: /* switch to CODE mode */ scp->kbd_mode = *(int *)data; if (scp == sc->cur_scp) - kbdd_ioctl(sc->kbd, KDSKBMODE, data); + (void)kbdd_ioctl(sc->kbd, KDSKBMODE, data); return 0; default: return EINVAL; @@ -1336,7 +1336,7 @@ sctty_ioctl(struct tty *tp, u_long cmd, } sc->kbd = kbd_get_keyboard(i); /* sc->kbd == newkbd */ sc->keyboard = i; - kbdd_ioctl(sc->kbd, KDSKBMODE, + (void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&sc->cur_scp->kbd_mode); update_kbd_state(sc->cur_scp, sc->cur_scp->status, LOCK_MASK); @@ -1649,14 +1649,14 @@ sc_cngetc(struct consdev *cd) /* we shall always use the keyboard in the XLATE mode here */ cur_mode = scp->kbd_mode; scp->kbd_mode = K_XLATE; - kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); + (void)kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); kbdd_poll(scp->sc->kbd, TRUE); c = scgetc(scp->sc, SCGETC_CN | SCGETC_NONBLOCK); kbdd_poll(scp->sc->kbd, FALSE); scp->kbd_mode = cur_mode; - kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); + (void)kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); kbdd_disable(scp->sc->kbd); splx(s); @@ -1756,7 +1756,7 @@ scrn_timer(void *arg) sc->keyboard = sc_allocate_keyboard(sc, -1); if (sc->keyboard >= 0) { sc->kbd = kbd_get_keyboard(sc->keyboard); - kbdd_ioctl(sc->kbd, KDSKBMODE, + (void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&sc->cur_scp->kbd_mode); update_kbd_state(sc->cur_scp, sc->cur_scp->status, LOCK_MASK); @@ -2551,7 +2551,7 @@ exchange_scr(sc_softc_t *sc) /* set up the keyboard for the new screen */ if (sc->old_scp->kbd_mode != scp->kbd_mode) - kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); + (void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); update_kbd_state(scp, scp->status, LOCK_MASK); mark_all(scp); @@ -3334,7 +3334,7 @@ next_code: case NLK: case CLK: case ALK: break; case SLK: - kbdd_ioctl(sc->kbd, KDGKBSTATE, (caddr_t)&f); + (void)kbdd_ioctl(sc->kbd, KDGKBSTATE, (caddr_t)&f); if (f & SLKED) { scp->status |= SLKED; } else { @@ -3764,7 +3764,7 @@ sc_allocate_keyboard(sc_softc_t *sc, int strcpy(ki.kb_name, k->kb_name); ki.kb_unit = k->kb_unit; - kbdd_ioctl(k0, KBADDKBD, (caddr_t) &ki); + (void)kbdd_ioctl(k0, KBADDKBD, (caddr_t) &ki); } } else idx0 = kbd_allocate("*", unit, (void *)&sc->keyboard, sckbdevent, sc); From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 11:37:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 416A6106564A; Wed, 13 Oct 2010 11:37:40 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F8E98FC20; Wed, 13 Oct 2010 11:37:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DBbeHS086234; Wed, 13 Oct 2010 11:37:40 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DBbe5w086232; Wed, 13 Oct 2010 11:37:40 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131137.o9DBbe5w086232@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 11:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213771 - head/sys/fs/msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 11:37:40 -0000 Author: rpaulo Date: Wed Oct 13 11:37:39 2010 New Revision: 213771 URL: http://svn.freebsd.org/changeset/base/213771 Log: Ignore the return value of DE_INTERNALIZE(). Modified: head/sys/fs/msdosfs/msdosfs_denode.c Modified: head/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_denode.c Wed Oct 13 11:37:12 2010 (r213770) +++ head/sys/fs/msdosfs/msdosfs_denode.c Wed Oct 13 11:37:39 2010 (r213771) @@ -240,7 +240,7 @@ deget(pmp, dirclust, diroffset, depp) *depp = NULL; return (error); } - DE_INTERNALIZE(ldep, direntptr); + (void)DE_INTERNALIZE(ldep, direntptr); brelse(bp); } From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 11:38:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D65F106566C; Wed, 13 Oct 2010 11:38:25 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B5768FC0A; Wed, 13 Oct 2010 11:38:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DBcPe7086322; Wed, 13 Oct 2010 11:38:25 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DBcPoc086320; Wed, 13 Oct 2010 11:38:25 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131138.o9DBcPoc086320@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 11:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213772 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 11:38:25 -0000 Author: rpaulo Date: Wed Oct 13 11:38:24 2010 New Revision: 213772 URL: http://svn.freebsd.org/changeset/base/213772 Log: Mark acpi_bus_number() as __unused. This allows clang to this file without any warnings. Modified: head/sys/dev/acpica/Osd/OsdHardware.c Modified: head/sys/dev/acpica/Osd/OsdHardware.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdHardware.c Wed Oct 13 11:37:39 2010 (r213771) +++ head/sys/dev/acpica/Osd/OsdHardware.c Wed Oct 13 11:38:24 2010 (r213772) @@ -126,7 +126,7 @@ AcpiOsWritePciConfiguration (ACPI_PCI_ID /* * Depth-first recursive case for finding the bus, given the slot/function. */ -static int +static int __unused acpi_bus_number(ACPI_HANDLE root, ACPI_HANDLE curr, ACPI_PCI_ID *PciId) { ACPI_HANDLE parent; From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 11:39:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D85051065670; Wed, 13 Oct 2010 11:39:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C570B8FC18; Wed, 13 Oct 2010 11:39:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DBdblq086397; Wed, 13 Oct 2010 11:39:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DBdbpn086396; Wed, 13 Oct 2010 11:39:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010131139.o9DBdbpn086396@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 13 Oct 2010 11:39: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: r213773 - stable/8/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 11:39:38 -0000 Author: kib Date: Wed Oct 13 11:39:36 2010 New Revision: 213773 URL: http://svn.freebsd.org/changeset/base/213773 Log: MFC r213476: Add cross-references to lrand48(3) and arc4random(3) from rand(3) and random(3). MFC r213477: Missed space. Modified: stable/8/lib/libc/stdlib/rand.3 stable/8/lib/libc/stdlib/random.3 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/stdlib/rand.3 ============================================================================== --- stable/8/lib/libc/stdlib/rand.3 Wed Oct 13 11:38:24 2010 (r213772) +++ stable/8/lib/libc/stdlib/rand.3 Wed Oct 13 11:39:36 2010 (r213773) @@ -32,7 +32,7 @@ .\" @(#)rand.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 25, 1999 +.Dd October 6, 2010 .Dt RAND 3 .Os .Sh NAME @@ -100,7 +100,16 @@ provides the same functionality as A pointer to the context value .Fa ctx must be supplied by the caller. +.Pp +For better generator quality, use +.Xr random 3 +or +.Xr lrand48 3 . +Applications requiring cryptographic quality randomness should use +.Xr arc4random 3 . .Sh SEE ALSO +.Xr arc4random 3 , +.Xr lrand48 3 , .Xr random 3 , .Xr random 4 .Sh STANDARDS Modified: stable/8/lib/libc/stdlib/random.3 ============================================================================== --- stable/8/lib/libc/stdlib/random.3 Wed Oct 13 11:38:24 2010 (r213772) +++ stable/8/lib/libc/stdlib/random.3 Wed Oct 13 11:39:36 2010 (r213773) @@ -173,6 +173,7 @@ detects that the state information has b messages are printed on the standard error output. .Sh SEE ALSO .Xr arc4random 3 , +.Xr lrand48 3 , .Xr rand 3 , .Xr srand 3 , .Xr random 4 From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 11:42:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E3EF1065670; Wed, 13 Oct 2010 11:42:35 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep11.mx.upcmail.net (fep11.mx.upcmail.net [62.179.121.31]) by mx1.freebsd.org (Postfix) with ESMTP id 53BBB8FC0C; Wed, 13 Oct 2010 11:42:33 +0000 (UTC) Received: from edge02.upcmail.net ([192.168.13.237]) by viefep11-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20101013114231.ENMG4509.viefep11-int.chello.at@edge02.upcmail.net>; Wed, 13 Oct 2010 13:42:31 +0200 Received: from mole.fafoe.narf.at ([213.47.85.26]) by edge02.upcmail.net with edge id JBiU1f03A0a5KZh02BiVKx; Wed, 13 Oct 2010 13:42:30 +0200 X-SourceIP: 213.47.85.26 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id A92676D439; Wed, 13 Oct 2010 13:42:28 +0200 (CEST) Date: Wed, 13 Oct 2010 13:42:28 +0200 From: Stefan Farfeleder To: Rui Paulo Message-ID: <20101013114228.GH1717@mole.fafoe.narf.at> References: <201010131135.o9DBZxtN086101@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201010131135.o9DBZxtN086101@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Cloudmark-Analysis: v=1.1 cv=FfKqumoxTXZ+9nPf2j1EcRvkwAYRHfr8aJLFveX/caA= c=1 sm=0 a=Bl3KpXD6Ah4A:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=J4qtPDVFNDVRddusnmIA:9 a=mTHYEGksirRIrZlfgbe1tsk2UVwA:4 a=CjuIK1q_8ugA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213769 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 11:42:35 -0000 On Wed, Oct 13, 2010 at 11:35:59AM +0000, Rui Paulo wrote: > Author: rpaulo > Date: Wed Oct 13 11:35:59 2010 > New Revision: 213769 > URL: http://svn.freebsd.org/changeset/base/213769 > > Log: > The canonical way to print __func__ when using KASSERT() is to write > ("%s", __func__). This avoids clang's -Wformat-string warnings. > That's a stupid warning, clang should know the value of __func__. Stefan From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 12:47:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EB9A1065697; Wed, 13 Oct 2010 12:47:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D56858FC2C; Wed, 13 Oct 2010 12:47:57 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 8ADD046BA2; Wed, 13 Oct 2010 08:47:57 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0898F8A01D; Wed, 13 Oct 2010 08:47:56 -0400 (EDT) From: John Baldwin To: Rui Paulo Date: Wed, 13 Oct 2010 08:47:53 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201010131138.o9DBcPoc086320@svn.freebsd.org> In-Reply-To: <201010131138.o9DBcPoc086320@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201010130847.53992.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 13 Oct 2010 08:47:56 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, jkim@freebsd.org Subject: Re: svn commit: r213772 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 12:47:58 -0000 On Wednesday, October 13, 2010 7:38:25 am Rui Paulo wrote: > Author: rpaulo > Date: Wed Oct 13 11:38:24 2010 > New Revision: 213772 > URL: http://svn.freebsd.org/changeset/base/213772 > > Log: > Mark acpi_bus_number() as __unused. This allows clang to this file > without any warnings. Actually, I think this should have been removed when AcpiOsDerivePciId() was removed during the update to ACPICA 20100915. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 13:17:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8219E10656B1; Wed, 13 Oct 2010 13:17:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 709C38FC13; Wed, 13 Oct 2010 13:17:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DDHcTi088508; Wed, 13 Oct 2010 13:17:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DDHcB7088506; Wed, 13 Oct 2010 13:17:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010131317.o9DDHcB7088506@svn.freebsd.org> From: John Baldwin Date: Wed, 13 Oct 2010 13:17:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213774 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 13:17:38 -0000 Author: jhb Date: Wed Oct 13 13:17:38 2010 New Revision: 213774 URL: http://svn.freebsd.org/changeset/base/213774 Log: Suggest that DEBUG_FLAGS be used to enable extra debugging rather than frobbing CFLAGS directly. DEBUG_FLAGS is something that can be specified on the make command line without having to edit the Makefile directly. Submitted by: Garrett Cooper Modified: head/bin/sh/Makefile Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Wed Oct 13 11:39:36 2010 (r213773) +++ head/bin/sh/Makefile Wed Oct 13 13:17:38 2010 (r213774) @@ -21,7 +21,7 @@ LDADD= -ll -ledit -ltermcap LFLAGS= -8 # 8-bit lex scanner for arithmetic CFLAGS+=-DSHELL -I. -I${.CURDIR} # for debug: -# CFLAGS+= -g -DDEBUG=3 +# DEBUG_FLAGS+= -g -DDEBUG=3 WARNS?= 2 WFORMAT=0 From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 13:22:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91BE1106566B; Wed, 13 Oct 2010 13:22:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F76B8FC0A; Wed, 13 Oct 2010 13:22:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DDMBgw088651; Wed, 13 Oct 2010 13:22:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DDMBoQ088648; Wed, 13 Oct 2010 13:22:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201010131322.o9DDMBoQ088648@svn.freebsd.org> From: John Baldwin Date: Wed, 13 Oct 2010 13:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213775 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 13:22:11 -0000 Author: jhb Date: Wed Oct 13 13:22:11 2010 New Revision: 213775 URL: http://svn.freebsd.org/changeset/base/213775 Log: Make DEBUG traces 64-bit clean: - Use %t to print ptrdiff_t values. - Cast a ptrdiff_t value explicitly to int for a field width specifier. While here, sort includes. Submitted by: Garrett Cooper Modified: head/bin/sh/expand.c head/bin/sh/jobs.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Wed Oct 13 13:17:38 2010 (r213774) +++ head/bin/sh/expand.c Wed Oct 13 13:22:11 2010 (r213775) @@ -43,14 +43,15 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include -#include -#include +#include +#include #include +#include #include +#include #include +#include /* * Routines to expand arguments to commands. We have to deal with @@ -497,9 +498,9 @@ expbackq(union node *cmd, int quoted, in exitstatus = waitforjob(in.jp, (int *)NULL); if (quoted == 0) recordregion(startloc, dest - stackblock(), 0); - TRACE(("evalbackq: size=%d: \"%.*s\"\n", - (dest - stackblock()) - startloc, - (dest - stackblock()) - startloc, + TRACE(("expbackq: size=%td: \"%.*s\"\n", + ((dest - stackblock()) - startloc), + (int)((dest - stackblock()) - startloc), stackblock() + startloc)); expdest = dest; INTON; Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Wed Oct 13 13:17:38 2010 (r213774) +++ head/bin/sh/jobs.c Wed Oct 13 13:22:11 2010 (r213775) @@ -38,18 +38,18 @@ static char sccsid[] = "@(#)jobs.c 8.5 ( #include __FBSDID("$FreeBSD$"); -#include -#include -#include -#include -#include -#include +#include #include -#include -#include #include +#include +#include +#include +#include +#include #include -#include +#include +#include +#include #include "shell.h" #if JOBS @@ -680,7 +680,7 @@ makejob(union node *node __unused, int n jp->ps = &jp->ps0; } INTON; - TRACE(("makejob(%p, %d) returns %%%d\n", (void *)node, nprocs, + TRACE(("makejob(%p, %d) returns %%%td\n", (void *)node, nprocs, jp - jobtab + 1)); return jp; } @@ -766,7 +766,7 @@ forkshell(struct job *jp, union node *n, pid_t pid; pid_t pgrp; - TRACE(("forkshell(%%%d, %p, %d) called\n", jp - jobtab, (void *)n, + TRACE(("forkshell(%%%td, %p, %d) called\n", jp - jobtab, (void *)n, mode)); INTOFF; if (mode == FORK_BG) @@ -903,7 +903,7 @@ waitforjob(struct job *jp, int *origstat int st; INTOFF; - TRACE(("waitforjob(%%%d) called\n", jp - jobtab + 1)); + TRACE(("waitforjob(%%%td) called\n", jp - jobtab + 1)); while (jp->state == 0) if (dowait(1, jp) == -1) dotrap(); @@ -1004,7 +1004,7 @@ dowait(int block, struct job *job) if (stopped) { /* stopped or done */ int state = done? JOBDONE : JOBSTOPPED; if (jp->state != state) { - TRACE(("Job %d: changing state from %d to %d\n", jp - jobtab + 1, jp->state, state)); + TRACE(("Job %td: changing state from %d to %d\n", jp - jobtab + 1, jp->state, state)); jp->state = state; if (jp != job) { if (done && !jp->remembered && From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 13:31:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66944106564A; Wed, 13 Oct 2010 13:31:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 1FDA68FC13; Wed, 13 Oct 2010 13:31:18 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id B81EE46B06; Wed, 13 Oct 2010 09:31:17 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2712C8A009; Wed, 13 Oct 2010 09:31:16 -0400 (EDT) From: John Baldwin To: Gennady Proskurin Date: Wed, 13 Oct 2010 09:05:04 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201010090807.o9987nG0030939@svn.freebsd.org> <4CB03A82.6040701@freebsd.org> <20101012210804.GA4286@gpr.nnz-home.ru> In-Reply-To: <20101012210804.GA4286@gpr.nnz-home.ru> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010130905.04784.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 13 Oct 2010 09:31:16 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans , Andriy Gapon Subject: Re: svn commit: r213648 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 13:31:18 -0000 On Tuesday, October 12, 2010 5:08:04 pm Gennady Proskurin wrote: > On Sat, Oct 09, 2010 at 12:48:50PM +0300, Andriy Gapon wrote: > > on 09/10/2010 12:33 Bruce Evans said the following: > > > On Sat, 9 Oct 2010, Andriy Gapon wrote: > > > > > >> Log: > > >> panic_cpu variable should be volatile > > >> > > >> This is to prevent caching of its value in a register when it is checked > > >> and modified by multiple CPUs in parallel. > > >> Also, move the variable into the scope of the only function that uses it. > > >> > > >> Reviewed by: jhb > > >> Hint from: mdf > > >> MFC after: 1 week > > > > > > I doubt that this is either necessary or sufficient. Most variables > > > aren't volatile while they are locked by a mutex. But panic() cannot use > > > normal mutex locking, so it should access this variable using atomic > > > ops with memory barriers. The compiler part of the memory barriers > > > effectively make _all_ variables temporily volatile. However, 2 of the > > > the 4 accesses to this variable doesn't use an atomic op. > > > > > > % #ifdef SMP > > > % /* > > > % * We don't want multiple CPU's to panic at the same time, so we > > > % * use panic_cpu as a simple spinlock. We have to keep checking > > > % * panic_cpu if we are spinning in case the panic on the first > > > % * CPU is canceled. > > > % */ > > > % if (panic_cpu != PCPU_GET(cpuid)) > > > > > > This access doesn't use an atomic op. > > > > > > % while (atomic_cmpset_int(&panic_cpu, NOCPU, > > > % PCPU_GET(cpuid)) == 0) > > > > > > This access uses an atomic op. Not all atomic ops use memory barriers, > > > at least on i386. However, this one does, at least on i386. > > > > > > (I'm always confused about what atomic_any() without acq or release > > > means. Do they mean that you don't want a memory barrier (this is > > > what the mostly give, at least on i386), and if so, what use are > > > they? There are far too many atomic ops, for far too many never-used > > > widths, with alternative spellings to encourage using a wrong one. > > > cmpset is is especially confusing since it you can spell it as cmpset, > > > cmpset_acq or compset_rel and always get the barrier, at least on > > > i386. At least cmpset only supports 1 width, at least on i386.) > > > > > > % while (panic_cpu != NOCPU) > > > > > > This access doesn't use an atomic op. > > > > > > % ; /* nothing */ > > > % #endif > > > % ... > > > % #ifdef RESTARTABLE_PANICS > > > % /* See if the user aborted the panic, in which case we continue. */ > > > % if (panicstr == NULL) { > > > % #ifdef SMP > > > % atomic_store_rel_int(&panic_cpu, NOCPU); > > > > > > This access uses an atomic op with a memory barrier, at least on i386. > > > Now its rel semantics are clear. > > > > > > panicstr is non-volatile and never accessed by an atomic op, so it probably > > > strictly needs to be declared volatile even more than panic_cpu. I think > > > > I agree about panicstr. > > But I am not sure if we have places in code (beyond panic function) itself where > > volatile vs. non-volatile would make any actual difference. > > But still. > > > > > the only thing that makes it work now is that it is bogusly pubic, and > > > compilers can't analyze the whole program yet -- if they could, then they > > > would see that it is only set in panic(). > > > > > > % #endif > > > % return; > > > % } > > > % #endif > > > % #endif > > > > > > Now, why don't the partial memory barriers prevent caching the variable? > > > > > > % if (panic_cpu != PCPU_GET(cpuid)) > > > % while (atomic_cmpset_int(&panic_cpu, NOCPU, > > > % PCPU_GET(cpuid)) == 0) > > > % while (panic_cpu != NOCPU) > > > % ; /* nothing */ > > > > > > The very first access can't reasonably use a cachec value. atomic_cmpset() > > > can change panic_cpu, so even without the memory barrier, panic_cpu must > > > be reloaded for the third access the first time. But then when the third > > > access is repeated in the second while loop, the missing atomic op with > > > barrier makes things very broken. panic_cpu isn't changed by the loop, > > > and the compiler thinks that it isn't changed by anything else either, so > > > the compiler may reduce the loop to: > > > > > > % if (panic_cpu != NOCPU) > > > % for (;;) > > > % ; /* nothing */ > > > > > > Yes, it's exactly the last loop that had the problem. > > On amd64 with -O2: > > .loc 1 544 0 > > movl panic_cpu(%rip), %eax > > .LVL134: > > .p2align 4,,7 > > .L210: > > cmpl $255, %eax > > jne .L210 > > jmp .L225 > > > > > except I've seen claims that even an endless for loop can be optimized > > > to nothing. Declaring panic_cpu as volatile prevents the compiler doing > > > this, but I think it is insufficient. We really do want to see panic_cpu > > > changed by other CPUs, and what is the point of atomic_load_acq*() if not > > > to use for this -- if declaring things volatile were sufficient, then we > > > could just use *(volatile *)&var. atomic_load/store_acq/rel*() on i386 > > > > I discussed this with kib and the idea is that atomic operation is not needed in > > that place and volatile is sufficient, because we don't need barrier semantics > > there and only want to ensure that variable is reloaded from memory. > > If I understand correctly, without acquiring barrier, variable is not > guaranteed to be loaded from memory, it can end up with some stale value from > cpu's cache or pipeline. If incorrect value will be checked in the first "if" > operator, it can lead to skiping all the atomic synchronization. > The same about writing to variable, without barrier new value may be written to > some local cpu cache and not be seen by readers until it is flushed from cache. No, a barrier does _not_ force any cache flushes. The point of the volatile is to serve as a compiler barrier. A memory barrier only enforces a ordering in memory operations in the CPU, it does not flush any caches or force a CPU to post writes to memory. It is weaker than that. :) For example, the sparcv9 manuals explicitly state something along the lines that any write may be held in the CPU's store buffer for an unspecified amount of time. Barriers do not alter that, nor would it really be useful for them to do so. What barriers allow you to do is order the operations on a lock cookie (such as mtx_lock in mutexes) with respect to operations on other memory locations (e.g. the data a lock protects). By using a specific set of barriers and protocols for accessing the lock cookie, you can ensure that the protected data is not accessed without holding the lock. However, for a standalone word, memory barriers do not buy you anything. And in fact, if one CPU has written to a variable and that write is still sitting in the store buffer, 'atomic_load_acq' on another CPU may still return a stale value. All that FreeBSD requires is that 'atomic_cmpset' will not report success using stale data. It can either fail or block waiting for the write in a store buffer in another CPU to drain. We typically handle the 'fail' case by continuing to loop until we observe a new state or succesfully perform 'atomic_cmpset' (for an example, see setting of MTX_CONTESTED in mtx_lock). Currently we do not have 'atomic_load()' and 'atomic_store()' variants without memory barriers since 'x = y' is atomic (in that it is performed as a single operation). However, there are cases where 'x = y' needs a compiler memory barrier (but not a CPU one). (e.g. if 'y' can be updated by a signal handler in userland, or an interrupt in the kernel.) That is what 'volatile' is for. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 13:31:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0CEB106566B; Wed, 13 Oct 2010 13:31:19 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9C5E68FC15; Wed, 13 Oct 2010 13:31:19 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 42D1046BA9; Wed, 13 Oct 2010 09:31:19 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 18C288A01D; Wed, 13 Oct 2010 09:31:18 -0400 (EDT) From: John Baldwin To: Bruce Evans Date: Wed, 13 Oct 2010 09:07:59 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201010121924.o9CJOgwn059485@svn.freebsd.org> <20101013040543.GB13694@dragon.NUXI.org> <20101013152037.S2102@besplex.bde.org> In-Reply-To: <20101013152037.S2102@besplex.bde.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010130907.59715.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 13 Oct 2010 09:31:18 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David O'Brien Subject: Re: svn commit: r213744 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 13:31:19 -0000 On Wednesday, October 13, 2010 12:29:27 am Bruce Evans wrote: > On Tue, 12 Oct 2010, David O'Brien wrote: > > > On Wed, Oct 13, 2010 at 02:18:33PM +1100, Bruce Evans wrote: > >> On Tue, 12 Oct 2010, David E. O'Brien wrote: > >>> Log: > >>> If DEBUG is 3 or greater, disable STATICization of functions. > >>> Also correct the documented location of the trace file. > >> > >> Private functions should always be static, which no `#define STATIC static' > > [..] > >> In theory, the debugging info should make it possible for debuggers > >> to restore the semantics of not-explictly-inline functions by virtualizing > >> them, but gdb's debugging info and/or gdb are too primitive to do this > >> (gdb doesn't allow putting a breakpoint at a deleted static function, > > > > This is actually what my motivation is -- trying to set breakpoints and > > finding GDB was unable to. > > > >> Of course, debugging and profiling are magic, > >> but I don't want to have to adorn all functions with STATICs and > >> __attributes() (and pragmas for othercc...) to recover historical/normal > >> or variant debugging or profiling of them. > > > > I agree, and would not add STATIC's to a program's code that didn't > > already have them. But in this case we inherited it from 4.4BSD. > > I'm just making it actually do something other than being a gratuitous > > spelling change. > > > > I believe I've made things more consistent with r213760. > > Add __noinline or whatever attributes to STATIC (but keep static in > it) for the DEBUG >= 3 case if you are going that far. __noinline > should be a syntax error for variables, so this should also find any > STATICs still on variables. The spelling fix of changing STATIC to > what it actually means > (ASSORTED_HACKS_FOR_DEBUGGING_BUT_NOW_ONLY_FOR_FUNCTIONS) goes too far > for me. To be honest, I think changing STATIC is excessive churn. The "right" fix is to use 'make DEBUG_FLAGS="-g -DDEBUG=2 -fno-inline"'. I often use 'make DEBUG_FLAGS="-g -fno-inline"' to workaround excessive inlining when debugging. I think all of the STATIC changes should just be backed out. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 14:02:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B37D1065674; Wed, 13 Oct 2010 14:02:45 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 788608FC13; Wed, 13 Oct 2010 14:02:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DE2jgA089581; Wed, 13 Oct 2010 14:02:45 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DE2jh3089579; Wed, 13 Oct 2010 14:02:45 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201010131402.o9DE2jh3089579@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 13 Oct 2010 14:02: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: r213776 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 14:02:45 -0000 Author: jh Date: Wed Oct 13 14:02:45 2010 New Revision: 213776 URL: http://svn.freebsd.org/changeset/base/213776 Log: MFC r200036 by scottl: Fix several cases where the periph lock was held over malloc. PR: kern/130735 Modified: stable/8/sys/cam/scsi/scsi_cd.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_cd.c Wed Oct 13 13:22:11 2010 (r213775) +++ stable/8/sys/cam/scsi/scsi_cd.c Wed Oct 13 14:02:45 2010 (r213776) @@ -2671,12 +2671,10 @@ cdioctl(struct disk *dp, u_long cmd, voi authinfo = (struct dvd_authinfo *)addr; - cam_periph_lock(periph); if (cmd == DVDIOCREPORTKEY) error = cdreportkey(periph, authinfo); else error = cdsendkey(periph, authinfo); - cam_periph_unlock(periph); break; } case DVDIOCREADSTRUCTURE: { @@ -2684,9 +2682,7 @@ cdioctl(struct disk *dp, u_long cmd, voi dvdstruct = (struct dvd_struct *)addr; - cam_periph_lock(periph); error = cdreaddvdstructure(periph, dvdstruct); - cam_periph_unlock(periph); break; } @@ -3732,8 +3728,6 @@ cdreportkey(struct cam_periph *periph, s databuf = NULL; lba = 0; - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); - switch (authinfo->format) { case DVD_REPORT_AGID: length = sizeof(struct scsi_report_key_data_agid); @@ -3759,9 +3753,7 @@ cdreportkey(struct cam_periph *periph, s length = 0; break; default: - error = EINVAL; - goto bailout; - break; /* NOTREACHED */ + return (EINVAL); } if (length != 0) { @@ -3769,6 +3761,8 @@ cdreportkey(struct cam_periph *periph, s } else databuf = NULL; + cam_periph_lock(periph); + ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); scsi_report_key(&ccb->csio, /* retries */ cd_retry_count, @@ -3869,12 +3863,14 @@ cdreportkey(struct cam_periph *periph, s goto bailout; break; /* NOTREACHED */ } + bailout: + xpt_release_ccb(ccb); + cam_periph_unlock(periph); + if (databuf != NULL) free(databuf, M_DEVBUF); - xpt_release_ccb(ccb); - return(error); } @@ -3889,8 +3885,6 @@ cdsendkey(struct cam_periph *periph, str error = 0; databuf = NULL; - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); - switch(authinfo->format) { case DVD_SEND_CHALLENGE: { struct scsi_report_key_data_challenge *challenge_data; @@ -3942,11 +3936,12 @@ cdsendkey(struct cam_periph *periph, str break; } default: - error = EINVAL; - goto bailout; - break; /* NOTREACHED */ + return (EINVAL); } + cam_periph_lock(periph); + ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); + scsi_send_key(&ccb->csio, /* retries */ cd_retry_count, /* cbfcnp */ cddone, @@ -3961,13 +3956,12 @@ cdsendkey(struct cam_periph *periph, str error = cdrunccb(ccb, cderror, /*cam_flags*/CAM_RETRY_SELTO, /*sense_flags*/SF_RETRY_UA); -bailout: + xpt_release_ccb(ccb); + cam_periph_unlock(periph); if (databuf != NULL) free(databuf, M_DEVBUF); - xpt_release_ccb(ccb); - return(error); } @@ -3985,8 +3979,6 @@ cdreaddvdstructure(struct cam_periph *pe /* The address is reserved for many of the formats */ address = 0; - ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); - switch(dvdstruct->format) { case DVD_STRUCT_PHYSICAL: length = sizeof(struct scsi_read_dvd_struct_data_physical); @@ -4004,13 +3996,7 @@ cdreaddvdstructure(struct cam_periph *pe length = sizeof(struct scsi_read_dvd_struct_data_manufacturer); break; case DVD_STRUCT_CMI: - error = ENODEV; - goto bailout; -#ifdef notyet - length = sizeof(struct scsi_read_dvd_struct_data_copy_manage); - address = dvdstruct->address; -#endif - break; /* NOTREACHED */ + return (ENODEV); case DVD_STRUCT_PROTDISCID: length = sizeof(struct scsi_read_dvd_struct_data_prot_discid); break; @@ -4027,21 +4013,9 @@ cdreaddvdstructure(struct cam_periph *pe length = sizeof(struct scsi_read_dvd_struct_data_spare_area); break; case DVD_STRUCT_RMD_LAST: - error = ENODEV; - goto bailout; -#ifdef notyet - length = sizeof(struct scsi_read_dvd_struct_data_rmd_borderout); - address = dvdstruct->address; -#endif - break; /* NOTREACHED */ + return (ENODEV); case DVD_STRUCT_RMD_RMA: - error = ENODEV; - goto bailout; -#ifdef notyet - length = sizeof(struct scsi_read_dvd_struct_data_rmd); - address = dvdstruct->address; -#endif - break; /* NOTREACHED */ + return (ENODEV); case DVD_STRUCT_PRERECORDED: length = sizeof(struct scsi_read_dvd_struct_data_leadin); break; @@ -4049,13 +4023,7 @@ cdreaddvdstructure(struct cam_periph *pe length = sizeof(struct scsi_read_dvd_struct_data_disc_id); break; case DVD_STRUCT_DCB: - error = ENODEV; - goto bailout; -#ifdef notyet - length = sizeof(struct scsi_read_dvd_struct_data_dcb); - address = dvdstruct->address; -#endif - break; /* NOTREACHED */ + return (ENODEV); case DVD_STRUCT_LIST: /* * This is the maximum allocation length for the READ DVD @@ -4067,9 +4035,7 @@ cdreaddvdstructure(struct cam_periph *pe length = 65535; break; default: - error = EINVAL; - goto bailout; - break; /* NOTREACHED */ + return (EINVAL); } if (length != 0) { @@ -4077,6 +4043,9 @@ cdreaddvdstructure(struct cam_periph *pe } else databuf = NULL; + cam_periph_lock(periph); + ccb = cdgetccb(periph, CAM_PRIORITY_NORMAL); + scsi_read_dvd_structure(&ccb->csio, /* retries */ cd_retry_count, /* cbfcnp */ cddone, @@ -4164,13 +4133,14 @@ cdreaddvdstructure(struct cam_periph *pe min(sizeof(dvdstruct->data), dvdstruct->length)); break; } + bailout: + xpt_release_ccb(ccb); + cam_periph_unlock(periph); if (databuf != NULL) free(databuf, M_DEVBUF); - xpt_release_ccb(ccb); - return(error); } From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 14:27:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FE4C106566B; Wed, 13 Oct 2010 14:27:48 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DDB58FC0C; Wed, 13 Oct 2010 14:27:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DERm62090176; Wed, 13 Oct 2010 14:27:48 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DERm1Z090174; Wed, 13 Oct 2010 14:27:48 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201010131427.o9DERm1Z090174@svn.freebsd.org> From: Roman Divacky Date: Wed, 13 Oct 2010 14:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213777 - head/contrib/llvm/tools/clang/lib/Sema X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 14:27:48 -0000 Author: rdivacky Date: Wed Oct 13 14:27:47 2010 New Revision: 213777 URL: http://svn.freebsd.org/changeset/base/213777 Log: Extend this check for const unsigned char *. Approved by: rpaulo (mentor) Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Wed Oct 13 14:02:45 2010 (r213776) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Wed Oct 13 14:27:47 2010 (r213777) @@ -1519,10 +1519,14 @@ CheckPrintfHandler::HandlePrintfSpecifie // Now type check the data expression that matches the // format specifier. const Expr *Ex = getDataArg(argIndex); + QualType Pointee = S.Context.UnsignedCharTy; + Pointee.addConst(); + QualType constType = (CS.getKind() == ConversionSpecifier::bArg) ? S.Context.IntTy : S.Context.getPointerType(Pointee); QualType type = (CS.getKind() == ConversionSpecifier::bArg) ? S.Context.IntTy : S.Context.getPointerType(S.Context.UnsignedCharTy); - //const analyze_printf::ArgTypeResult &ATR = S.Context.IntTy; + const analyze_printf::ArgTypeResult &ConstATR = constType; const analyze_printf::ArgTypeResult &ATR = type; - if (ATR.isValid() && !ATR.matchesType(S.Context, Ex->getType())) + if (ATR.isValid() && !ATR.matchesType(S.Context, Ex->getType()) && + !ConstATR.matchesType(S.Context, Ex->getType())) S.Diag(getLocationOfByte(CS.getStart()), diag::warn_printf_conversion_argument_type_mismatch) << ATR.getRepresentativeType(S.Context) << Ex->getType() From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 14:37:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 508F6106564A; Wed, 13 Oct 2010 14:37:53 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F3C38FC1B; Wed, 13 Oct 2010 14:37:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DEbrrZ090487; Wed, 13 Oct 2010 14:37:53 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DEbrG5090485; Wed, 13 Oct 2010 14:37:53 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131437.o9DEbrG5090485@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 14:37:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213778 - head/sys/dev/if_ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 14:37:53 -0000 Author: rpaulo Date: Wed Oct 13 14:37:52 2010 New Revision: 213778 URL: http://svn.freebsd.org/changeset/base/213778 Log: WPA_CSE_WEP104 was being incorrectly checked. Found with: clang Modified: head/sys/dev/if_ndis/if_ndis.c Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Wed Oct 13 14:27:47 2010 (r213777) +++ head/sys/dev/if_ndis/if_ndis.c Wed Oct 13 14:37:52 2010 (r213778) @@ -2115,7 +2115,7 @@ ndis_set_cipher(sc, cipher) len = sizeof(arg); - if (cipher == WPA_CSE_WEP40 || WPA_CSE_WEP104) { + if (cipher == WPA_CSE_WEP40 || cipher == WPA_CSE_WEP104) { if (!(ic->ic_cryptocaps & IEEE80211_CRYPTO_WEP)) return (ENOTSUP); arg = NDIS_80211_WEPSTAT_ENC1ENABLED; From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 14:39:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1BFB106566B; Wed, 13 Oct 2010 14:39:54 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B04D88FC0A; Wed, 13 Oct 2010 14:39:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DEdsY9090574; Wed, 13 Oct 2010 14:39:54 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DEdssc090571; Wed, 13 Oct 2010 14:39:54 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131439.o9DEdssc090571@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 14:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213779 - head/sys/dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 14:39:54 -0000 Author: rpaulo Date: Wed Oct 13 14:39:54 2010 New Revision: 213779 URL: http://svn.freebsd.org/changeset/base/213779 Log: Fix a brain-o: wrong case statement semantics. Found with: clang Modified: head/sys/dev/sound/pci/envy24ht.c head/sys/dev/sound/pci/spicds.c Modified: head/sys/dev/sound/pci/envy24ht.c ============================================================================== --- head/sys/dev/sound/pci/envy24ht.c Wed Oct 13 14:37:52 2010 (r213778) +++ head/sys/dev/sound/pci/envy24ht.c Wed Oct 13 14:39:54 2010 (r213779) @@ -2236,7 +2236,8 @@ envy24ht_putcfg(struct sc_info *sc) else printf("not implemented\n"); switch (sc->adcn) { - case 0x01 || 0x02: + case 0x01: + case 0x02: printf(" ADC #: "); printf("%d\n", sc->adcn); break; Modified: head/sys/dev/sound/pci/spicds.c ============================================================================== --- head/sys/dev/sound/pci/spicds.c Wed Oct 13 14:37:52 2010 (r213778) +++ head/sys/dev/sound/pci/spicds.c Wed Oct 13 14:39:54 2010 (r213779) @@ -283,7 +283,8 @@ spicds_set(struct spicds_info *codec, in case SPICDS_TYPE_WM8770: left = left + 27; break; - case SPICDS_TYPE_AK4381 || SPICDS_TYPE_AK4396: + case SPICDS_TYPE_AK4381: + case SPICDS_TYPE_AK4396: left = left * 255 / 100; break; default: From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 14:41:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C0351065670; Wed, 13 Oct 2010 14:41:53 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A9BE8FC08; Wed, 13 Oct 2010 14:41:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DEfr7S090653; Wed, 13 Oct 2010 14:41:53 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DEfrVf090651; Wed, 13 Oct 2010 14:41:53 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131441.o9DEfrVf090651@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 14:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213780 - head/sys/dev/hptrr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 14:41:53 -0000 Author: rpaulo Date: Wed Oct 13 14:41:52 2010 New Revision: 213780 URL: http://svn.freebsd.org/changeset/base/213780 Log: Pass a format string to make_dev(). Modified: head/sys/dev/hptrr/hptrr_osm_bsd.c Modified: head/sys/dev/hptrr/hptrr_osm_bsd.c ============================================================================== --- head/sys/dev/hptrr/hptrr_osm_bsd.c Wed Oct 13 14:39:54 2010 (r213779) +++ head/sys/dev/hptrr/hptrr_osm_bsd.c Wed Oct 13 14:41:52 2010 (r213780) @@ -1178,7 +1178,7 @@ static void hpt_final_init(void *dummy) } make_dev(&hpt_cdevsw, DRIVER_MINOR, UID_ROOT, GID_OPERATOR, - S_IRUSR | S_IWUSR, driver_name); + S_IRUSR | S_IWUSR, "%s", driver_name); } #if defined(KLD_MODULE) && (__FreeBSD_version >= 503000) From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 14:44:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B63C5106566C; Wed, 13 Oct 2010 14:44:38 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A43B48FC08; Wed, 13 Oct 2010 14:44:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DEic7O090764; Wed, 13 Oct 2010 14:44:38 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DEicut090760; Wed, 13 Oct 2010 14:44:38 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131444.o9DEicut090760@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 14:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213781 - in head/sys/modules: cryptodev sysvipc/sysvmsg sysvipc/sysvsem X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 14:44:38 -0000 Author: rpaulo Date: Wed Oct 13 14:44:38 2010 New Revision: 213781 URL: http://svn.freebsd.org/changeset/base/213781 Log: Add opt_compat.h to SRCS. Modified: head/sys/modules/cryptodev/Makefile head/sys/modules/sysvipc/sysvmsg/Makefile head/sys/modules/sysvipc/sysvsem/Makefile Modified: head/sys/modules/cryptodev/Makefile ============================================================================== --- head/sys/modules/cryptodev/Makefile Wed Oct 13 14:41:52 2010 (r213780) +++ head/sys/modules/cryptodev/Makefile Wed Oct 13 14:44:38 2010 (r213781) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../opencrypto KMOD = cryptodev SRCS = cryptodev.c -SRCS += bus_if.h device_if.h +SRCS += bus_if.h device_if.h opt_compat.h .include Modified: head/sys/modules/sysvipc/sysvmsg/Makefile ============================================================================== --- head/sys/modules/sysvipc/sysvmsg/Makefile Wed Oct 13 14:41:52 2010 (r213780) +++ head/sys/modules/sysvipc/sysvmsg/Makefile Wed Oct 13 14:44:38 2010 (r213781) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../../kern KMOD= sysvmsg -SRCS= sysv_msg.c opt_sysvipc.h +SRCS= sysv_msg.c opt_sysvipc.h opt_compat.h .include Modified: head/sys/modules/sysvipc/sysvsem/Makefile ============================================================================== --- head/sys/modules/sysvipc/sysvsem/Makefile Wed Oct 13 14:41:52 2010 (r213780) +++ head/sys/modules/sysvipc/sysvsem/Makefile Wed Oct 13 14:44:38 2010 (r213781) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../../kern KMOD= sysvsem -SRCS= sysv_sem.c opt_sysvipc.h +SRCS= sysv_sem.c opt_sysvipc.h opt_compat.h .include From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 14:57:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BBA61065670; Wed, 13 Oct 2010 14:57:13 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A4568FC1B; Wed, 13 Oct 2010 14:57:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DEvD94091088; Wed, 13 Oct 2010 14:57:13 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DEvDw6091086; Wed, 13 Oct 2010 14:57:13 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131457.o9DEvDw6091086@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 14:57:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213782 - head/sys/contrib/ipfilter/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 14:57:13 -0000 Author: rpaulo Date: Wed Oct 13 14:57:13 2010 New Revision: 213782 URL: http://svn.freebsd.org/changeset/base/213782 Log: Pass a format string to make_dev(). Found by: clang Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Oct 13 14:44:38 2010 (r213781) +++ head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Wed Oct 13 14:57:13 2010 (r213782) @@ -204,7 +204,7 @@ ipf_modload() } if (!c) c = str; - ipf_devs[i] = make_dev(&ipl_cdevsw, i, 0, 0, 0600, c); + ipf_devs[i] = make_dev(&ipl_cdevsw, i, 0, 0, 0600, "%s", c); } error = ipf_pfil_hook(); From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 16:22:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0208106564A; Wed, 13 Oct 2010 16:22:11 +0000 (UTC) (envelope-from gprspb@mail.ru) Received: from smtp5.mail.ru (smtp5.mail.ru [94.100.176.132]) by mx1.freebsd.org (Postfix) with ESMTP id 16B278FC0A; Wed, 13 Oct 2010 16:22:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=41T83mqKJUhhWvbMGuFkZDY4V/3zW37vpQdO4dgMM5g=; b=hHqbOA8TIyzgLGOlDHxIlGP0TgjoaujP9jdRTLKLFMVmbnhS3mhOgbpSVtNDcUOl1A8PZlonwGvhzh3+ggCqrdVDzDRR8krApd8H1rIaKT0Edx8Qq81iVPeFEuXYnmvi; Received: from [93.185.182.46] (port=4799 helo=gpr.nnz-home.ru) by smtp5.mail.ru with asmtp (TLSv1:AES256-SHA:256) id 1P645f-0002Le-00; Wed, 13 Oct 2010 20:22:08 +0400 Received: from gpr by gpr.nnz-home.ru with local (Exim 4.72 (FreeBSD)) (envelope-from ) id 1P645I-0001NC-4X; Wed, 13 Oct 2010 20:21:44 +0400 Date: Wed, 13 Oct 2010 20:21:44 +0400 From: Gennady Proskurin To: John Baldwin Message-ID: <20101013162144.GA5254@gpr.nnz-home.ru> References: <201010090807.o9987nG0030939@svn.freebsd.org> <4CB03A82.6040701@freebsd.org> <20101012210804.GA4286@gpr.nnz-home.ru> <201010130905.04784.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201010130905.04784.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Mras: Ok Cc: Gennady Proskurin , src-committers@freebsd.org, svn-src-all@freebsd.org, Andriy Gapon , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r213648 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 16:22:11 -0000 Thank you and Bruce for explanation. The key point here (which I did not understand) is that "something == PCPU_GET(cpuid))" may be true only if "something" is set by the current cpu, in which case its value is not stale. On Wed, Oct 13, 2010 at 09:05:04AM -0400, John Baldwin wrote: > On Tuesday, October 12, 2010 5:08:04 pm Gennady Proskurin wrote: > > On Sat, Oct 09, 2010 at 12:48:50PM +0300, Andriy Gapon wrote: > > > on 09/10/2010 12:33 Bruce Evans said the following: > > > > On Sat, 9 Oct 2010, Andriy Gapon wrote: > > > > > > > >> Log: > > > >> panic_cpu variable should be volatile > > > >> > > > >> This is to prevent caching of its value in a register when it is checked > > > >> and modified by multiple CPUs in parallel. > > > >> Also, move the variable into the scope of the only function that uses it. > > > >> > > > >> Reviewed by: jhb > > > >> Hint from: mdf > > > >> MFC after: 1 week > > > > > > > > I doubt that this is either necessary or sufficient. Most variables > > > > aren't volatile while they are locked by a mutex. But panic() cannot use > > > > normal mutex locking, so it should access this variable using atomic > > > > ops with memory barriers. The compiler part of the memory barriers > > > > effectively make _all_ variables temporily volatile. However, 2 of the > > > > the 4 accesses to this variable doesn't use an atomic op. > > > > > > > > % #ifdef SMP > > > > % /* > > > > % * We don't want multiple CPU's to panic at the same time, so we > > > > % * use panic_cpu as a simple spinlock. We have to keep checking > > > > % * panic_cpu if we are spinning in case the panic on the first > > > > % * CPU is canceled. > > > > % */ > > > > % if (panic_cpu != PCPU_GET(cpuid)) > > > > > > > > This access doesn't use an atomic op. > > > > > > > > % while (atomic_cmpset_int(&panic_cpu, NOCPU, > > > > % PCPU_GET(cpuid)) == 0) > > > > > > > > This access uses an atomic op. Not all atomic ops use memory barriers, > > > > at least on i386. However, this one does, at least on i386. > > > > > > > > (I'm always confused about what atomic_any() without acq or release > > > > means. Do they mean that you don't want a memory barrier (this is > > > > what the mostly give, at least on i386), and if so, what use are > > > > they? There are far too many atomic ops, for far too many never-used > > > > widths, with alternative spellings to encourage using a wrong one. > > > > cmpset is is especially confusing since it you can spell it as cmpset, > > > > cmpset_acq or compset_rel and always get the barrier, at least on > > > > i386. At least cmpset only supports 1 width, at least on i386.) > > > > > > > > % while (panic_cpu != NOCPU) > > > > > > > > This access doesn't use an atomic op. > > > > > > > > % ; /* nothing */ > > > > % #endif > > > > % ... > > > > % #ifdef RESTARTABLE_PANICS > > > > % /* See if the user aborted the panic, in which case we continue. */ > > > > % if (panicstr == NULL) { > > > > % #ifdef SMP > > > > % atomic_store_rel_int(&panic_cpu, NOCPU); > > > > > > > > This access uses an atomic op with a memory barrier, at least on i386. > > > > Now its rel semantics are clear. > > > > > > > > panicstr is non-volatile and never accessed by an atomic op, so it probably > > > > strictly needs to be declared volatile even more than panic_cpu. I think > > > > > > I agree about panicstr. > > > But I am not sure if we have places in code (beyond panic function) itself where > > > volatile vs. non-volatile would make any actual difference. > > > But still. > > > > > > > the only thing that makes it work now is that it is bogusly pubic, and > > > > compilers can't analyze the whole program yet -- if they could, then they > > > > would see that it is only set in panic(). > > > > > > > > % #endif > > > > % return; > > > > % } > > > > % #endif > > > > % #endif > > > > > > > > Now, why don't the partial memory barriers prevent caching the variable? > > > > > > > > % if (panic_cpu != PCPU_GET(cpuid)) > > > > % while (atomic_cmpset_int(&panic_cpu, NOCPU, > > > > % PCPU_GET(cpuid)) == 0) > > > > % while (panic_cpu != NOCPU) > > > > % ; /* nothing */ > > > > > > > > The very first access can't reasonably use a cachec value. atomic_cmpset() > > > > can change panic_cpu, so even without the memory barrier, panic_cpu must > > > > be reloaded for the third access the first time. But then when the third > > > > access is repeated in the second while loop, the missing atomic op with > > > > barrier makes things very broken. panic_cpu isn't changed by the loop, > > > > and the compiler thinks that it isn't changed by anything else either, so > > > > the compiler may reduce the loop to: > > > > > > > > % if (panic_cpu != NOCPU) > > > > % for (;;) > > > > % ; /* nothing */ > > > > > > > > > Yes, it's exactly the last loop that had the problem. > > > On amd64 with -O2: > > > .loc 1 544 0 > > > movl panic_cpu(%rip), %eax > > > .LVL134: > > > .p2align 4,,7 > > > .L210: > > > cmpl $255, %eax > > > jne .L210 > > > jmp .L225 > > > > > > > except I've seen claims that even an endless for loop can be optimized > > > > to nothing. Declaring panic_cpu as volatile prevents the compiler doing > > > > this, but I think it is insufficient. We really do want to see panic_cpu > > > > changed by other CPUs, and what is the point of atomic_load_acq*() if not > > > > to use for this -- if declaring things volatile were sufficient, then we > > > > could just use *(volatile *)&var. atomic_load/store_acq/rel*() on i386 > > > > > > I discussed this with kib and the idea is that atomic operation is not needed in > > > that place and volatile is sufficient, because we don't need barrier semantics > > > there and only want to ensure that variable is reloaded from memory. > > > > If I understand correctly, without acquiring barrier, variable is not > > guaranteed to be loaded from memory, it can end up with some stale value from > > cpu's cache or pipeline. If incorrect value will be checked in the first "if" > > operator, it can lead to skiping all the atomic synchronization. > > The same about writing to variable, without barrier new value may be written to > > some local cpu cache and not be seen by readers until it is flushed from cache. > > No, a barrier does _not_ force any cache flushes. The point of the volatile > is to serve as a compiler barrier. A memory barrier only enforces a ordering > in memory operations in the CPU, it does not flush any caches or force a CPU > to post writes to memory. It is weaker than that. :) For example, the > sparcv9 manuals explicitly state something along the lines that any write may > be held in the CPU's store buffer for an unspecified amount of time. > Barriers do not alter that, nor would it really be useful for them to do so. > What barriers allow you to do is order the operations on a lock cookie (such > as mtx_lock in mutexes) with respect to operations on other memory locations > (e.g. the data a lock protects). By using a specific set of barriers and > protocols for accessing the lock cookie, you can ensure that the protected > data is not accessed without holding the lock. However, for a standalone > word, memory barriers do not buy you anything. And in fact, if one CPU has > written to a variable and that write is still sitting in the store buffer, > 'atomic_load_acq' on another CPU may still return a stale value. All that > FreeBSD requires is that 'atomic_cmpset' will not report success using stale > data. It can either fail or block waiting for the write in a store buffer in > another CPU to drain. We typically handle the 'fail' case by continuing to > loop until we observe a new state or succesfully perform 'atomic_cmpset' > (for an example, see setting of MTX_CONTESTED in mtx_lock). > > Currently we do not have 'atomic_load()' and 'atomic_store()' variants without > memory barriers since 'x = y' is atomic (in that it is performed as a single > operation). However, there are cases where 'x = y' needs a compiler memory > barrier (but not a CPU one). (e.g. if 'y' can be updated by a signal handler > in userland, or an interrupt in the kernel.) That is what 'volatile' is for. > > -- > John Baldwin > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 16:26:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 8F879106566B; Wed, 13 Oct 2010 16:26:56 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Wed, 13 Oct 2010 12:26:46 -0400 User-Agent: KMail/1.6.2 References: <201010131138.o9DBcPoc086320@svn.freebsd.org> <201010130847.53992.jhb@freebsd.org> In-Reply-To: <201010130847.53992.jhb@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010131226.49260.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo Subject: Re: svn commit: r213772 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 16:26:56 -0000 On Wednesday 13 October 2010 08:47 am, John Baldwin wrote: > On Wednesday, October 13, 2010 7:38:25 am Rui Paulo wrote: > > Author: rpaulo > > Date: Wed Oct 13 11:38:24 2010 > > New Revision: 213772 > > URL: http://svn.freebsd.org/changeset/base/213772 > > > > Log: > > Mark acpi_bus_number() as __unused. This allows clang to this > > file without any warnings. > > Actually, I think this should have been removed when > AcpiOsDerivePciId() was removed during the update to ACPICA > 20100915. Yes, you're right. I'll fix that. Thanks, Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 16:30:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DCA71065674; Wed, 13 Oct 2010 16:30:41 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 621B38FC0C; Wed, 13 Oct 2010 16:30:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DGUfwg093021; Wed, 13 Oct 2010 16:30:41 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DGUfj4093019; Wed, 13 Oct 2010 16:30:41 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201010131630.o9DGUfj4093019@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 13 Oct 2010 16:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213783 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 16:30:41 -0000 Author: jkim Date: Wed Oct 13 16:30:41 2010 New Revision: 213783 URL: http://svn.freebsd.org/changeset/base/213783 Log: Remove acpi_bus_number() completely. It had to be removed in r212761. Pointed out by: jhb Modified: head/sys/dev/acpica/Osd/OsdHardware.c Modified: head/sys/dev/acpica/Osd/OsdHardware.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdHardware.c Wed Oct 13 14:57:13 2010 (r213782) +++ head/sys/dev/acpica/Osd/OsdHardware.c Wed Oct 13 16:30:41 2010 (r213783) @@ -122,58 +122,3 @@ AcpiOsWritePciConfiguration (ACPI_PCI_ID return (AE_OK); } - -/* - * Depth-first recursive case for finding the bus, given the slot/function. - */ -static int __unused -acpi_bus_number(ACPI_HANDLE root, ACPI_HANDLE curr, ACPI_PCI_ID *PciId) -{ - ACPI_HANDLE parent; - ACPI_STATUS status; - ACPI_OBJECT_TYPE type; - UINT32 adr; - int bus, slot, func, class, subclass, header; - - /* Try to get the _BBN object of the root, otherwise assume it is 0. */ - bus = 0; - if (root == curr) { - status = acpi_GetInteger(root, "_BBN", &bus); - if (ACPI_FAILURE(status) && bootverbose) - printf("acpi_bus_number: root bus has no _BBN, assuming 0\n"); - return (bus); - } - status = AcpiGetParent(curr, &parent); - if (ACPI_FAILURE(status)) - return (bus); - - /* First, recurse up the tree until we find the host bus. */ - bus = acpi_bus_number(root, parent, PciId); - - /* Validate parent bus device type. */ - if (ACPI_FAILURE(AcpiGetType(parent, &type)) || type != ACPI_TYPE_DEVICE) { - printf("acpi_bus_number: not a device, type %d\n", type); - return (bus); - } - - /* Get the parent's slot and function. */ - status = acpi_GetInteger(parent, "_ADR", &adr); - if (ACPI_FAILURE(status)) - return (bus); - slot = ACPI_HIWORD(adr); - func = ACPI_LOWORD(adr); - - /* Is this a PCI-PCI or Cardbus-PCI bridge? */ - class = pci_cfgregread(bus, slot, func, PCIR_CLASS, 1); - if (class != PCIC_BRIDGE) - return (bus); - subclass = pci_cfgregread(bus, slot, func, PCIR_SUBCLASS, 1); - - /* Find the header type, masking off the multifunction bit. */ - header = pci_cfgregread(bus, slot, func, PCIR_HDRTYPE, 1) & PCIM_HDRTYPE; - if (header == PCIM_HDRTYPE_BRIDGE && subclass == PCIS_BRIDGE_PCI) - bus = pci_cfgregread(bus, slot, func, PCIR_SECBUS_1, 1); - else if (header == PCIM_HDRTYPE_CARDBUS && subclass == PCIS_BRIDGE_CARDBUS) - bus = pci_cfgregread(bus, slot, func, PCIR_SECBUS_2, 1); - return (bus); -} From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 16:34:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CCF6106566B; Wed, 13 Oct 2010 16:34:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41DFD8FC08; Wed, 13 Oct 2010 16:34:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DGY9Ch093162; Wed, 13 Oct 2010 16:34:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DGY9bF093160; Wed, 13 Oct 2010 16:34:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201010131634.o9DGY9bF093160@svn.freebsd.org> From: Warner Losh Date: Wed, 13 Oct 2010 16:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213784 - head/lib/libz X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 16:34:09 -0000 Author: imp Date: Wed Oct 13 16:34:08 2010 New Revision: 213784 URL: http://svn.freebsd.org/changeset/base/213784 Log: Revert 212517 to restore pristine state of this file Modified: head/lib/libz/minigzip.c Modified: head/lib/libz/minigzip.c ============================================================================== --- head/lib/libz/minigzip.c Wed Oct 13 16:30:41 2010 (r213783) +++ head/lib/libz/minigzip.c Wed Oct 13 16:34:08 2010 (r213784) @@ -13,8 +13,6 @@ * or in pipe mode. */ -#include -__FBSDID("$FreeBSD$"); /* @(#) $Id$ */ #include "zlib.h" From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 16:57:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55B051065672; Wed, 13 Oct 2010 16:57:07 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 447968FC1B; Wed, 13 Oct 2010 16:57:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DGv7lr093721; Wed, 13 Oct 2010 16:57:07 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DGv7PI093718; Wed, 13 Oct 2010 16:57:07 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131657.o9DGv7PI093718@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 16:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213785 - in head/lib/libc: net sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 16:57:07 -0000 Author: rpaulo Date: Wed Oct 13 16:57:06 2010 New Revision: 213785 URL: http://svn.freebsd.org/changeset/base/213785 Log: Clang related fixes: * When calling syslog(), pass a format string. * Define YY_NO_INPUT on nslexer.l Submitted by: Norberto Lopes Modified: head/lib/libc/net/nslexer.l head/lib/libc/sys/stack_protector.c Modified: head/lib/libc/net/nslexer.l ============================================================================== --- head/lib/libc/net/nslexer.l Wed Oct 13 16:34:08 2010 (r213784) +++ head/lib/libc/net/nslexer.l Wed Oct 13 16:57:06 2010 (r213785) @@ -53,6 +53,7 @@ static char *rcsid = #include "nsparser.h" +#define YY_NO_INPUT #define YY_NO_UNPUT %} Modified: head/lib/libc/sys/stack_protector.c ============================================================================== --- head/lib/libc/sys/stack_protector.c Wed Oct 13 16:34:08 2010 (r213784) +++ head/lib/libc/sys/stack_protector.c Wed Oct 13 16:57:06 2010 (r213785) @@ -92,7 +92,7 @@ __fail(const char *msg) (void)sigprocmask(SIG_BLOCK, &mask, NULL); /* This may fail on a chroot jail... */ - syslog(LOG_CRIT, msg); + syslog(LOG_CRIT, "%s", msg); (void)memset(&sa, 0, sizeof(sa)); (void)sigemptyset(&sa.sa_mask); From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 17:01:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 234481065672; Wed, 13 Oct 2010 17:01:34 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11A8D8FC08; Wed, 13 Oct 2010 17:01:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DH1XT1093867; Wed, 13 Oct 2010 17:01:33 GMT (envelope-from rdivacky@svn.freebsd.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DH1XHB093865; Wed, 13 Oct 2010 17:01:33 GMT (envelope-from rdivacky@svn.freebsd.org) Message-Id: <201010131701.o9DH1XHB093865@svn.freebsd.org> From: Roman Divacky Date: Wed, 13 Oct 2010 17:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213786 - head/contrib/llvm/tools/clang/lib/Sema X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 17:01:34 -0000 Author: rdivacky Date: Wed Oct 13 17:01:33 2010 New Revision: 213786 URL: http://svn.freebsd.org/changeset/base/213786 Log: Actually, check for any kind of "C string type". Approved by: rpaulo (mentor) Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Wed Oct 13 16:57:06 2010 (r213785) +++ head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp Wed Oct 13 17:01:33 2010 (r213786) @@ -1519,14 +1519,10 @@ CheckPrintfHandler::HandlePrintfSpecifie // Now type check the data expression that matches the // format specifier. const Expr *Ex = getDataArg(argIndex); - QualType Pointee = S.Context.UnsignedCharTy; - Pointee.addConst(); - QualType constType = (CS.getKind() == ConversionSpecifier::bArg) ? S.Context.IntTy : S.Context.getPointerType(Pointee); - QualType type = (CS.getKind() == ConversionSpecifier::bArg) ? S.Context.IntTy : S.Context.getPointerType(S.Context.UnsignedCharTy); - const analyze_printf::ArgTypeResult &ConstATR = constType; - const analyze_printf::ArgTypeResult &ATR = type; - if (ATR.isValid() && !ATR.matchesType(S.Context, Ex->getType()) && - !ConstATR.matchesType(S.Context, Ex->getType())) + const analyze_printf::ArgTypeResult &ATR = + (CS.getKind() == ConversionSpecifier::bArg) ? + ArgTypeResult(S.Context.IntTy) : ArgTypeResult::CStrTy; + if (ATR.isValid() && !ATR.matchesType(S.Context, Ex->getType())) S.Diag(getLocationOfByte(CS.getStart()), diag::warn_printf_conversion_argument_type_mismatch) << ATR.getRepresentativeType(S.Context) << Ex->getType() From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 17:06:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC6C41065670; Wed, 13 Oct 2010 17:06:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB71C8FC1D; Wed, 13 Oct 2010 17:06:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DH6PIT093998; Wed, 13 Oct 2010 17:06:25 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DH6PMa093996; Wed, 13 Oct 2010 17:06:25 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201010131706.o9DH6PMa093996@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 13 Oct 2010 17:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213787 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 17:06:26 -0000 Author: jkim Date: Wed Oct 13 17:06:25 2010 New Revision: 213787 URL: http://svn.freebsd.org/changeset/base/213787 Log: Clean up unused headers. Modified: head/sys/dev/acpica/Osd/OsdHardware.c Modified: head/sys/dev/acpica/Osd/OsdHardware.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdHardware.c Wed Oct 13 17:01:33 2010 (r213786) +++ head/sys/dev/acpica/Osd/OsdHardware.c Wed Oct 13 17:06:25 2010 (r213787) @@ -34,12 +34,8 @@ __FBSDID("$FreeBSD$"); #include -#include -#include #include #include -#include -#include /* * ACPICA's rather gung-ho approach to hardware resource ownership is a little From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 17:09:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FAC91065672; Wed, 13 Oct 2010 17:09:17 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F29358FC18; Wed, 13 Oct 2010 17:09:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DH9GCG094088; Wed, 13 Oct 2010 17:09:16 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DH9G2j094086; Wed, 13 Oct 2010 17:09:16 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131709.o9DH9G2j094086@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 17:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213788 - head/sys/contrib/ngatm/netnatm/api X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 17:09:17 -0000 Author: rpaulo Date: Wed Oct 13 17:09:16 2010 New Revision: 213788 URL: http://svn.freebsd.org/changeset/base/213788 Log: Fix several cases were a conditional operator was used instead of a bitwise operator. Found with: clang Modified: head/sys/contrib/ngatm/netnatm/api/cc_conn.c Modified: head/sys/contrib/ngatm/netnatm/api/cc_conn.c ============================================================================== --- head/sys/contrib/ngatm/netnatm/api/cc_conn.c Wed Oct 13 17:06:25 2010 (r213787) +++ head/sys/contrib/ngatm/netnatm/api/cc_conn.c Wed Oct 13 17:09:16 2010 (r213788) @@ -977,25 +977,25 @@ cc_conn_sig_handle(struct ccconn *conn, /* * attributes */ - if (conn->dirty_attr && CCDIRTY_AAL) + if (conn->dirty_attr & CCDIRTY_AAL) resp->connect.aal = conn->aal; - if (conn->dirty_attr && CCDIRTY_BLLI) + if (conn->dirty_attr & CCDIRTY_BLLI) resp->connect.blli = conn->blli[conn->blli_selector - 1]; - if (conn->dirty_attr && CCDIRTY_CONNID) + if (conn->dirty_attr & CCDIRTY_CONNID) resp->connect.connid = conn->connid; /* XXX NOTIFY */ - if (conn->dirty_attr && CCDIRTY_EETD) + if (conn->dirty_attr & CCDIRTY_EETD) resp->connect.eetd = conn->eetd; /* XXX GIT */ /* XXX UU */ - if (conn->dirty_attr && CCDIRTY_TRAFFIC) + if (conn->dirty_attr & CCDIRTY_TRAFFIC) resp->connect.traffic = conn->traffic; - if (conn->dirty_attr && CCDIRTY_EXQOS) + if (conn->dirty_attr & CCDIRTY_EXQOS) resp->connect.exqos = conn->exqos; - if (conn->dirty_attr && CCDIRTY_ABRSETUP) + if (conn->dirty_attr & CCDIRTY_ABRSETUP) resp->connect.abrsetup = conn->abrsetup; - if (conn->dirty_attr && CCDIRTY_ABRADD) + if (conn->dirty_attr & CCDIRTY_ABRADD) resp->connect.abradd = conn->abradd; /* From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 17:09:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB501106566C; Wed, 13 Oct 2010 17:09:53 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D907E8FC15; Wed, 13 Oct 2010 17:09:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DH9r6O094135; Wed, 13 Oct 2010 17:09:53 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DH9rCV094130; Wed, 13 Oct 2010 17:09:53 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131709.o9DH9rCV094130@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 17:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213789 - in head/sys/contrib/ngatm/netnatm: msg sig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 17:09:54 -0000 Author: rpaulo Date: Wed Oct 13 17:09:53 2010 New Revision: 213789 URL: http://svn.freebsd.org/changeset/base/213789 Log: Properly tell the compiler that we want to ignore the return value of certain macros. Modified: head/sys/contrib/ngatm/netnatm/msg/privmsg.c head/sys/contrib/ngatm/netnatm/msg/uni_ie.c head/sys/contrib/ngatm/netnatm/sig/sig_call.c head/sys/contrib/ngatm/netnatm/sig/sig_reset.c Modified: head/sys/contrib/ngatm/netnatm/msg/privmsg.c ============================================================================== --- head/sys/contrib/ngatm/netnatm/msg/privmsg.c Wed Oct 13 17:09:16 2010 (r213788) +++ head/sys/contrib/ngatm/netnatm/msg/privmsg.c Wed Oct 13 17:09:53 2010 (r213789) @@ -145,7 +145,7 @@ uni_decode_body_internal(enum uni_msgtyp msg->b_rptr = msg->b_wptr; else msg->b_rptr += ielen; - UNI_SAVE_IERR(cx, ietype, hdr.act, UNI_IERR_UNK); + (void)UNI_SAVE_IERR(cx, ietype, hdr.act, UNI_IERR_UNK); err = -1; continue; } @@ -200,16 +200,16 @@ uni_decode_body_internal(enum uni_msgtyp * Unexpected but recognized. * Q.2931 5.6.8.3 */ - UNI_SAVE_IERR(cx, ietype, hdr.act, UNI_IERR_UNK); + (void)UNI_SAVE_IERR(cx, ietype, hdr.act, UNI_IERR_UNK); err = -1; break; case DEC_ERR: /* bad IE */ if (iedecl->flags & UNIFL_ACCESS) /* this may be wrong: 5.6.8.2 */ - UNI_SAVE_IERR(cx, ietype, hdr.act, UNI_IERR_ACC); + (void)UNI_SAVE_IERR(cx, ietype, hdr.act, UNI_IERR_ACC); else - UNI_SAVE_IERR(cx, ietype, hdr.act, UNI_IERR_BAD); + (void)UNI_SAVE_IERR(cx, ietype, hdr.act, UNI_IERR_BAD); err = -1; break; Modified: head/sys/contrib/ngatm/netnatm/msg/uni_ie.c ============================================================================== --- head/sys/contrib/ngatm/netnatm/msg/uni_ie.c Wed Oct 13 17:09:16 2010 (r213788) +++ head/sys/contrib/ngatm/netnatm/msg/uni_ie.c Wed Oct 13 17:09:53 2010 (r213789) @@ -214,7 +214,7 @@ uni_encode_msg_hdr(struct uni_msg *msg, { u_char byte; - uni_msg_ensure(msg, 9); + (void)uni_msg_ensure(msg, 9); APP_BYTE(msg, cx->pnni ? PNNI_PROTO : UNI_PROTO); APP_BYTE(msg, 3); @@ -652,7 +652,7 @@ uni_encode_ie_hdr(struct uni_msg *msg, e { u_char byte; - uni_msg_ensure(msg, 4 + len); + (void)uni_msg_ensure(msg, 4 + len); *msg->b_wptr++ = type; byte = 0x80 | (h->coding << 5); Modified: head/sys/contrib/ngatm/netnatm/sig/sig_call.c ============================================================================== --- head/sys/contrib/ngatm/netnatm/sig/sig_call.c Wed Oct 13 17:09:16 2010 (r213788) +++ head/sys/contrib/ngatm/netnatm/sig/sig_call.c Wed Oct 13 17:09:53 2010 (r213789) @@ -398,7 +398,7 @@ un0_setup(struct call *c, struct uni_msg if (IE_ISGOOD(u->u.setup.epref) && u->u.setup.epref.flag == 1) { IE_SETERROR(u->u.setup.epref); - UNI_SAVE_IERR(&c->uni->cx, UNI_IE_EPREF, + (void)UNI_SAVE_IERR(&c->uni->cx, UNI_IE_EPREF, u->u.setup.epref.h.act, UNI_IERR_BAD); } uni_mandate_epref(c->uni, &u->u.setup.epref); @@ -578,7 +578,7 @@ u1n6_call_proc(struct call *c, struct un (cp->epref.flag != 1 || cp->epref.epref != c->msg_setup.epref.epref)) { IE_SETERROR(cp->epref); - UNI_SAVE_IERR(&c->uni->cx, UNI_IE_EPREF, + (void)UNI_SAVE_IERR(&c->uni->cx, UNI_IE_EPREF, cp->epref.h.act, UNI_IERR_BAD); } } @@ -763,7 +763,7 @@ unx_alerting(struct call *c, struct uni_ (al->epref.flag != 1 || al->epref.epref != c->msg_setup.epref.epref)) { IE_SETERROR(al->epref); - UNI_SAVE_IERR(&c->uni->cx, UNI_IE_EPREF, + (void)UNI_SAVE_IERR(&c->uni->cx, UNI_IE_EPREF, al->epref.h.act, UNI_IERR_BAD); } } @@ -1065,7 +1065,7 @@ unx_connect(struct call *c, struct uni_m if (IE_ISGOOD(co->epref) && co->epref.flag != 1) { IE_SETERROR(co->epref); - UNI_SAVE_IERR(&c->uni->cx, UNI_IE_EPREF, + (void)UNI_SAVE_IERR(&c->uni->cx, UNI_IE_EPREF, co->epref.h.act, UNI_IERR_BAD); } } @@ -2757,7 +2757,7 @@ unx_add_party(struct call *c, struct uni if (IE_ISGOOD(u->u.add_party.epref) && p == NULL && u->u.add_party.epref.flag) { IE_SETERROR(u->u.add_party.epref); - UNI_SAVE_IERR(&c->uni->cx, UNI_IE_EPREF, + (void)UNI_SAVE_IERR(&c->uni->cx, UNI_IE_EPREF, u->u.add_party.epref.h.act, UNI_IERR_BAD); } @@ -2802,7 +2802,7 @@ un10n8_add_party_ack(struct call *c, str if (IE_ISGOOD(u->u.add_party_ack.epref)) { if (u->u.add_party_ack.epref.flag == 0) { IE_SETERROR(u->u.add_party_ack.epref); - UNI_SAVE_IERR(&c->uni->cx, UNI_IE_EPREF, + (void)UNI_SAVE_IERR(&c->uni->cx, UNI_IE_EPREF, u->u.add_party_ack.epref.h.act, UNI_IERR_BAD); } else { p = uni_find_partyx(c, u->u.add_party_ack.epref.epref, 1); @@ -2902,7 +2902,7 @@ unx_party_alerting(struct call *c, struc if (IE_ISGOOD(u->u.party_alerting.epref)) { if (u->u.party_alerting.epref.flag == 0) { IE_SETERROR(u->u.party_alerting.epref); - UNI_SAVE_IERR(&c->uni->cx, UNI_IE_EPREF, + (void)UNI_SAVE_IERR(&c->uni->cx, UNI_IE_EPREF, u->u.party_alerting.epref.h.act, UNI_IERR_BAD); } else { p = uni_find_partyx(c, u->u.party_alerting.epref.epref, 1); Modified: head/sys/contrib/ngatm/netnatm/sig/sig_reset.c ============================================================================== --- head/sys/contrib/ngatm/netnatm/sig/sig_reset.c Wed Oct 13 17:09:16 2010 (r213788) +++ head/sys/contrib/ngatm/netnatm/sig/sig_reset.c Wed Oct 13 17:09:53 2010 (r213789) @@ -270,7 +270,7 @@ start_restart_ack(struct uni *uni, struc */ if (u->u.restart_ack.restart.rclass == UNI_RESTART_ALL && IE_ISGOOD(u->u.restart_ack.connid)) { - UNI_SAVE_IERR(&uni->cx, UNI_IE_CONNID, + (void)UNI_SAVE_IERR(&uni->cx, UNI_IE_CONNID, u->u.restart_ack.connid.h.act, UNI_IERR_UNK); } else if ((u->u.restart_ack.restart.rclass == UNI_RESTART_PATH || @@ -547,7 +547,7 @@ response_restart(struct uni *uni, struct */ if (u->u.restart.restart.rclass == UNI_RESTART_ALL && IE_ISGOOD(u->u.restart.connid)) { - UNI_SAVE_IERR(&uni->cx, UNI_IE_CONNID, + (void)UNI_SAVE_IERR(&uni->cx, UNI_IE_CONNID, u->u.restart.connid.h.act, UNI_IERR_UNK); } else if ((u->u.restart.restart.rclass == UNI_RESTART_PATH || From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 17:12:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33E63106566C; Wed, 13 Oct 2010 17:12:24 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 222138FC14; Wed, 13 Oct 2010 17:12:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DHCOC0094237; Wed, 13 Oct 2010 17:12:24 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DHCOlp094235; Wed, 13 Oct 2010 17:12:24 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131712.o9DHCOlp094235@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 17:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213790 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 17:12:24 -0000 Author: rpaulo Date: Wed Oct 13 17:12:23 2010 New Revision: 213790 URL: http://svn.freebsd.org/changeset/base/213790 Log: In zfs_post_common(), use %d instead of %hhu. Found with: clang Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c Wed Oct 13 17:09:53 2010 (r213789) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c Wed Oct 13 17:12:23 2010 (r213790) @@ -350,7 +350,7 @@ zfs_post_common(spa_t *spa, vdev_t *vd, snprintf(class, sizeof(class), "%s.%s.%s", FM_RSRC_RESOURCE, ZFS_ERROR_CLASS, name); - sbuf_printf(&sb, " %s=%hhu", FM_VERSION, FM_RSRC_VERSION); + sbuf_printf(&sb, " %s=%d", FM_VERSION, FM_RSRC_VERSION); sbuf_printf(&sb, " %s=%s", FM_CLASS, class); sbuf_printf(&sb, " %s=%ju", FM_EREPORT_PAYLOAD_ZFS_POOL_GUID, spa_guid(spa)); From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 17:13:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70E121065670; Wed, 13 Oct 2010 17:13:43 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F91A8FC0C; Wed, 13 Oct 2010 17:13:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DHDhUS094304; Wed, 13 Oct 2010 17:13:43 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DHDhgW094301; Wed, 13 Oct 2010 17:13:43 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131713.o9DHDhgW094301@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 17:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213791 - head/sys/cddl/compat/opensolaris/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 17:13:43 -0000 Author: rpaulo Date: Wed Oct 13 17:13:43 2010 New Revision: 213791 URL: http://svn.freebsd.org/changeset/base/213791 Log: Pass a format string to panic() and to taskqueue_start_threads(). Found with: clang Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Wed Oct 13 17:12:23 2010 (r213790) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Wed Oct 13 17:13:43 2010 (r213791) @@ -48,7 +48,7 @@ vcmn_err(int ce, const char *fmt, va_lis panic("Solaris: unknown severity level"); } if (ce == CE_PANIC) - panic(buf); + panic("%s", buf); if (ce != CE_IGNORE) vprintf(buf, adx); } Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Wed Oct 13 17:12:23 2010 (r213790) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Wed Oct 13 17:13:43 2010 (r213791) @@ -73,7 +73,7 @@ taskq_create(const char *name, int nthre tq = kmem_alloc(sizeof(*tq), KM_SLEEP); tq->tq_queue = taskqueue_create(name, M_WAITOK, taskqueue_thread_enqueue, &tq->tq_queue); - (void) taskqueue_start_threads(&tq->tq_queue, nthreads, pri, name); + (void) taskqueue_start_threads(&tq->tq_queue, nthreads, pri, "%s", name); return ((taskq_t *)tq); } From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 17:16:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAA80106566C; Wed, 13 Oct 2010 17:16:08 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A97DF8FC0A; Wed, 13 Oct 2010 17:16:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DHG8tq094398; Wed, 13 Oct 2010 17:16:08 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DHG8jw094396; Wed, 13 Oct 2010 17:16:08 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131716.o9DHG8jw094396@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 17:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213792 - head/sys/contrib/pf/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 17:16:08 -0000 Author: rpaulo Date: Wed Oct 13 17:16:08 2010 New Revision: 213792 URL: http://svn.freebsd.org/changeset/base/213792 Log: Ignore the return value of ADDCARRY(). Modified: head/sys/contrib/pf/netinet/in4_cksum.c Modified: head/sys/contrib/pf/netinet/in4_cksum.c ============================================================================== --- head/sys/contrib/pf/netinet/in4_cksum.c Wed Oct 13 17:13:43 2010 (r213791) +++ head/sys/contrib/pf/netinet/in4_cksum.c Wed Oct 13 17:16:08 2010 (r213792) @@ -75,7 +75,7 @@ #include #define ADDCARRY(x) (x > 65535 ? x -= 65535 : x) -#define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);} +#define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; (void)ADDCARRY(sum);} int in4_cksum(struct mbuf *, u_int8_t, int, int); From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 17:17:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61DD71065673; Wed, 13 Oct 2010 17:17:50 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50D228FC13; Wed, 13 Oct 2010 17:17:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DHHo4X094461; Wed, 13 Oct 2010 17:17:50 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DHHobD094458; Wed, 13 Oct 2010 17:17:50 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131717.o9DHHobD094458@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 17:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213793 - in head/sys/dev: ce cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 17:17:50 -0000 Author: rpaulo Date: Wed Oct 13 17:17:50 2010 New Revision: 213793 URL: http://svn.freebsd.org/changeset/base/213793 Log: Don't do a logical AND of the result of strcmp() with a constant. Found with: clang Modified: head/sys/dev/ce/if_ce.c head/sys/dev/cp/if_cp.c Modified: head/sys/dev/ce/if_ce.c ============================================================================== --- head/sys/dev/ce/if_ce.c Wed Oct 13 17:16:08 2010 (r213792) +++ head/sys/dev/ce/if_ce.c Wed Oct 13 17:17:50 2010 (r213793) @@ -1313,7 +1313,7 @@ static int ce_ioctl (struct cdev *dev, u IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); IFP2SP(d->ifp)->pp_flags |= PP_KEEPALIVE; d->ifp->if_flags |= PP_CISCO; - } else if (! strcmp ("fr", (char*)data) && PP_FR) { + } else if (! strcmp ("fr", (char*)data)) { d->ifp->if_flags &= ~(PP_CISCO); IFP2SP(d->ifp)->pp_flags |= PP_FR | PP_KEEPALIVE; } else if (! strcmp ("ppp", (char*)data)) { Modified: head/sys/dev/cp/if_cp.c ============================================================================== --- head/sys/dev/cp/if_cp.c Wed Oct 13 17:16:08 2010 (r213792) +++ head/sys/dev/cp/if_cp.c Wed Oct 13 17:17:50 2010 (r213793) @@ -1052,7 +1052,7 @@ static int cp_ioctl (struct cdev *dev, u IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); IFP2SP(d->ifp)->pp_flags |= PP_KEEPALIVE; d->ifp->if_flags |= PP_CISCO; - } else if (! strcmp ("fr", (char*)data) && PP_FR) { + } else if (! strcmp ("fr", (char*)data)) { d->ifp->if_flags &= ~(PP_CISCO); IFP2SP(d->ifp)->pp_flags |= PP_FR | PP_KEEPALIVE; } else if (! strcmp ("ppp", (char*)data)) { From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 17:21:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09CE1106566C; Wed, 13 Oct 2010 17:21:22 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC5088FC08; Wed, 13 Oct 2010 17:21:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DHLL0B094582; Wed, 13 Oct 2010 17:21:21 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DHLL9M094573; Wed, 13 Oct 2010 17:21:21 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131721.o9DHLL9M094573@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 17:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213794 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 17:21:22 -0000 Author: rpaulo Date: Wed Oct 13 17:21:21 2010 New Revision: 213794 URL: http://svn.freebsd.org/changeset/base/213794 Log: When calling panic(), always pass a format string. Modified: head/sys/netgraph/ng_UI.c head/sys/netgraph/ng_async.c head/sys/netgraph/ng_frame_relay.c head/sys/netgraph/ng_gif_demux.c head/sys/netgraph/ng_iface.c head/sys/netgraph/ng_rfc1490.c head/sys/netgraph/ng_socket.c head/sys/netgraph/ng_tty.c Modified: head/sys/netgraph/ng_UI.c ============================================================================== --- head/sys/netgraph/ng_UI.c Wed Oct 13 17:17:50 2010 (r213793) +++ head/sys/netgraph/ng_UI.c Wed Oct 13 17:21:21 2010 (r213794) @@ -197,7 +197,7 @@ ng_UI_rcvdata(hook_p hook, item_p item) mtod(m, u_char *)[0] = HDLC_UI; NG_FWD_NEW_DATA(error, item, priv->downlink, m); /* m -> NULL */ } else - panic(__func__); + panic("%s", __func__); done: NG_FREE_M(m); /* does nothing if m == NULL */ @@ -234,7 +234,7 @@ ng_UI_disconnect(hook_p hook) else if (hook == priv->uplink) priv->uplink = NULL; else - panic(__func__); + panic("%s", __func__); /* * If we are not already shutting down, * and we have no more hooks, then DO shut down. Modified: head/sys/netgraph/ng_async.c ============================================================================== --- head/sys/netgraph/ng_async.c Wed Oct 13 17:17:50 2010 (r213793) +++ head/sys/netgraph/ng_async.c Wed Oct 13 17:21:21 2010 (r213794) @@ -256,7 +256,7 @@ nga_rcvdata(hook_p hook, item_p item) return (nga_rcv_sync(sc, item)); if (hook == sc->async) return (nga_rcv_async(sc, item)); - panic(__func__); + panic("%s", __func__); } /* @@ -372,7 +372,7 @@ nga_disconnect(hook_p hook) else if (hook == sc->sync) hookp = &sc->sync; else - panic(__func__); + panic("%s", __func__); if (!*hookp) panic("%s 2", __func__); *hookp = NULL; Modified: head/sys/netgraph/ng_frame_relay.c ============================================================================== --- head/sys/netgraph/ng_frame_relay.c Wed Oct 13 17:17:50 2010 (r213793) +++ head/sys/netgraph/ng_frame_relay.c Wed Oct 13 17:21:21 2010 (r213794) @@ -396,7 +396,7 @@ ngfrm_rcvdata(hook_p hook, item_p item) data[3] |= BYTEX_EA; break; default: - panic(__func__); + panic("%s", __func__); } /* Send it */ Modified: head/sys/netgraph/ng_gif_demux.c ============================================================================== --- head/sys/netgraph/ng_gif_demux.c Wed Oct 13 17:17:50 2010 (r213793) +++ head/sys/netgraph/ng_gif_demux.c Wed Oct 13 17:21:21 2010 (r213794) @@ -391,7 +391,7 @@ ng_gif_demux_disconnect(hook_p hook) else { iffam = get_iffam_from_hook(priv, hook); if (iffam == NULL) - panic(__func__); + panic("%s", __func__); *get_hook_from_iffam(priv, iffam) = NULL; } Modified: head/sys/netgraph/ng_iface.c ============================================================================== --- head/sys/netgraph/ng_iface.c Wed Oct 13 17:17:50 2010 (r213793) +++ head/sys/netgraph/ng_iface.c Wed Oct 13 17:21:21 2010 (r213794) @@ -821,7 +821,7 @@ ng_iface_disconnect(hook_p hook) const iffam_p iffam = get_iffam_from_hook(priv, hook); if (iffam == NULL) - panic(__func__); + panic("%s", __func__); *get_hook_from_iffam(priv, iffam) = NULL; return (0); } Modified: head/sys/netgraph/ng_rfc1490.c ============================================================================== --- head/sys/netgraph/ng_rfc1490.c Wed Oct 13 17:17:50 2010 (r213793) +++ head/sys/netgraph/ng_rfc1490.c Wed Oct 13 17:21:21 2010 (r213794) @@ -440,7 +440,7 @@ switch_on_etype: etype = ntohs(*((const mtod(m, u_char *)[7] = 0x07; NG_FWD_NEW_DATA(error, item, priv->downlink, m); } else - panic(__func__); + panic("%s", __func__); done: if (item) @@ -485,7 +485,7 @@ ng_rfc1490_disconnect(hook_p hook) else if (hook == priv->ethernet) priv->ethernet = NULL; else - panic(__func__); + panic("%s", __func__); return (0); } Modified: head/sys/netgraph/ng_socket.c ============================================================================== --- head/sys/netgraph/ng_socket.c Wed Oct 13 17:17:50 2010 (r213793) +++ head/sys/netgraph/ng_socket.c Wed Oct 13 17:21:21 2010 (r213794) @@ -621,7 +621,7 @@ ng_detach_common(struct ngpcb *pcbp, int priv->datasock = NULL; break; default: - panic(__func__); + panic("%s", __func__); } pcbp->sockdata = NULL; Modified: head/sys/netgraph/ng_tty.c ============================================================================== --- head/sys/netgraph/ng_tty.c Wed Oct 13 17:17:50 2010 (r213793) +++ head/sys/netgraph/ng_tty.c Wed Oct 13 17:21:21 2010 (r213794) @@ -211,7 +211,7 @@ ngt_disconnect(hook_p hook) const sc_p sc = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); if (hook != sc->hook) - panic(__func__); + panic("%s", __func__); NGTLOCK(sc); sc->hook = NULL; @@ -317,7 +317,7 @@ ngt_rcvdata(hook_p hook, item_p item) struct mbuf *m; if (hook != sc->hook) - panic(__func__); + panic("%s", __func__); NGI_GET_M(item, m); NG_FREE_ITEM(item); From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 17:28:01 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 008B010656A3; Wed, 13 Oct 2010 17:28:01 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id A9BA78FC14; Wed, 13 Oct 2010 17:28:00 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 61FB09CB089; Wed, 13 Oct 2010 19:27:58 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dzJbIx+j0jkR; Wed, 13 Oct 2010 19:27:57 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id C26F79CB4D5; Wed, 13 Oct 2010 19:27:57 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id o9DHRvU6022117; Wed, 13 Oct 2010 19:27:57 +0200 (CEST) (envelope-from rdivacky) Date: Wed, 13 Oct 2010 19:27:57 +0200 From: Roman Divacky To: Rui Paulo Message-ID: <20101013172757.GA21579@freebsd.org> References: <201010131717.o9DHHobD094458@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201010131717.o9DHHobD094458@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r213793 - in head/sys/dev: ce cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 17:28:01 -0000 On Wed, Oct 13, 2010 at 05:17:50PM +0000, Rui Paulo wrote: > Author: rpaulo > Date: Wed Oct 13 17:17:50 2010 > New Revision: 213793 > URL: http://svn.freebsd.org/changeset/base/213793 > > Log: > Don't do a logical AND of the result of strcmp() with a constant. > > Found with: clang > > Modified: > head/sys/dev/ce/if_ce.c > head/sys/dev/cp/if_cp.c > > Modified: head/sys/dev/ce/if_ce.c > ============================================================================== > --- head/sys/dev/ce/if_ce.c Wed Oct 13 17:16:08 2010 (r213792) > +++ head/sys/dev/ce/if_ce.c Wed Oct 13 17:17:50 2010 (r213793) > @@ -1313,7 +1313,7 @@ static int ce_ioctl (struct cdev *dev, u > IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); > IFP2SP(d->ifp)->pp_flags |= PP_KEEPALIVE; > d->ifp->if_flags |= PP_CISCO; > - } else if (! strcmp ("fr", (char*)data) && PP_FR) { > + } else if (! strcmp ("fr", (char*)data)) { this is wrong I think... the PP_FR was used for compiling in/out support for something.. see the comment: /* If we don't have Cronyx's sppp version, we don't have fr support via sppp */ #ifndef PP_FR #define PP_FR 0 #endif note that PP_FR is used in some other places as a flag. I guess that by compiling with something like make -DPP_FR=42 some magic would happen. anyway - this does not look like a bug but like an intent, please revert. roman From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 17:38:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 596FA1065670; Wed, 13 Oct 2010 17:38:24 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 483488FC0A; Wed, 13 Oct 2010 17:38:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DHcOiM094973; Wed, 13 Oct 2010 17:38:24 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DHcORn094970; Wed, 13 Oct 2010 17:38:24 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010131738.o9DHcORn094970@svn.freebsd.org> From: Rui Paulo Date: Wed, 13 Oct 2010 17:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213795 - in head/sys/dev: ce cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 17:38:24 -0000 Author: rpaulo Date: Wed Oct 13 17:38:23 2010 New Revision: 213795 URL: http://svn.freebsd.org/changeset/base/213795 Log: Revert r213793. Modified: head/sys/dev/ce/if_ce.c head/sys/dev/cp/if_cp.c Modified: head/sys/dev/ce/if_ce.c ============================================================================== --- head/sys/dev/ce/if_ce.c Wed Oct 13 17:21:21 2010 (r213794) +++ head/sys/dev/ce/if_ce.c Wed Oct 13 17:38:23 2010 (r213795) @@ -1313,7 +1313,7 @@ static int ce_ioctl (struct cdev *dev, u IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); IFP2SP(d->ifp)->pp_flags |= PP_KEEPALIVE; d->ifp->if_flags |= PP_CISCO; - } else if (! strcmp ("fr", (char*)data)) { + } else if (! strcmp ("fr", (char*)data) && PP_FR) { d->ifp->if_flags &= ~(PP_CISCO); IFP2SP(d->ifp)->pp_flags |= PP_FR | PP_KEEPALIVE; } else if (! strcmp ("ppp", (char*)data)) { Modified: head/sys/dev/cp/if_cp.c ============================================================================== --- head/sys/dev/cp/if_cp.c Wed Oct 13 17:21:21 2010 (r213794) +++ head/sys/dev/cp/if_cp.c Wed Oct 13 17:38:23 2010 (r213795) @@ -1052,7 +1052,7 @@ static int cp_ioctl (struct cdev *dev, u IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); IFP2SP(d->ifp)->pp_flags |= PP_KEEPALIVE; d->ifp->if_flags |= PP_CISCO; - } else if (! strcmp ("fr", (char*)data)) { + } else if (! strcmp ("fr", (char*)data) && PP_FR) { d->ifp->if_flags &= ~(PP_CISCO); IFP2SP(d->ifp)->pp_flags |= PP_FR | PP_KEEPALIVE; } else if (! strcmp ("ppp", (char*)data)) { From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 17:55:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D26761065673; Wed, 13 Oct 2010 17:55:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C13DB8FC17; Wed, 13 Oct 2010 17:55:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DHtJfK095360; Wed, 13 Oct 2010 17:55:19 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DHtJFi095358; Wed, 13 Oct 2010 17:55:19 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010131755.o9DHtJFi095358@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 13 Oct 2010 17:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213796 - head/sys/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 17:55:19 -0000 Author: yongari Date: Wed Oct 13 17:55:19 2010 New Revision: 213796 URL: http://svn.freebsd.org/changeset/base/213796 Log: Rewrite interrupt handler to give fairness for both RX and TX. Previously rl(4) continuously checked whether there are RX events or TX completions in forever loop. This caused TX starvation under high RX load as well as consuming too much CPU cycles in the interrupt handler. If interrupt was shared with other devices which may be always true due to USB devices in these days, rl(4) also tried to process the interrupt. This means polling(4) was the only way to mitigate the these issues. To address these issues, rl(4) now disables interrupts when it knows the interrupt is ours and limit the number of iteration of the loop to 16. The interrupt would be enabled again before exiting interrupt handler if the driver is still running. Because RX buffer is 64KB in size, the number of iterations in the loop has nothing to do with number of RX packets being processed. This change ensures sending TX frames under high RX load. RX handler drops a driver lock to pass received frames to upper stack such that there is a window that user can down the interface. So rl(4) now checks whether driver is still running before serving RX or TX completion in the loop. While I'm here, exit interrupt handler when driver initialized controller. With this change, now rl(4) can send frames under high RX load even though the TX performance is still not good(rl(4) controllers can't queue more than 4 frames at a time so low TX performance was one of design issue of rl(4) controllers). It's much better than previous TX starvation and you should not notice RX performance drop with this change. Controller still shows poor performance under high network load but for many cases it's now usable without resorting to polling(4). MFC after: 2 weeks Modified: head/sys/pci/if_rl.c Modified: head/sys/pci/if_rl.c ============================================================================== --- head/sys/pci/if_rl.c Wed Oct 13 17:38:23 2010 (r213795) +++ head/sys/pci/if_rl.c Wed Oct 13 17:55:19 2010 (r213796) @@ -1620,6 +1620,7 @@ rl_intr(void *arg) struct rl_softc *sc = arg; struct ifnet *ifp = sc->rl_ifp; uint16_t status; + int count; RL_LOCK(sc); @@ -1631,30 +1632,41 @@ rl_intr(void *arg) goto done_locked; #endif - for (;;) { + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + goto done_locked2; + status = CSR_READ_2(sc, RL_ISR); + if (status == 0xffff || (status & RL_INTRS) == 0) + goto done_locked; + /* + * Ours, disable further interrupts. + */ + CSR_WRITE_2(sc, RL_IMR, 0); + for (count = 16; count > 0; count--) { + CSR_WRITE_2(sc, RL_ISR, status); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (status & (RL_ISR_RX_OK | RL_ISR_RX_ERR)) + rl_rxeof(sc); + if (status & (RL_ISR_TX_OK | RL_ISR_TX_ERR)) + rl_txeof(sc); + if (status & RL_ISR_SYSTEM_ERR) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + rl_init_locked(sc); + RL_UNLOCK(sc); + return; + } + } status = CSR_READ_2(sc, RL_ISR); /* If the card has gone away, the read returns 0xffff. */ - if (status == 0xffff) + if (status == 0xffff || (status & RL_INTRS) == 0) break; - if (status != 0) - CSR_WRITE_2(sc, RL_ISR, status); - if ((status & RL_INTRS) == 0) - break; - if (status & RL_ISR_RX_OK) - rl_rxeof(sc); - if (status & RL_ISR_RX_ERR) - rl_rxeof(sc); - if ((status & RL_ISR_TX_OK) || (status & RL_ISR_TX_ERR)) - rl_txeof(sc); - if (status & RL_ISR_SYSTEM_ERR) { - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - rl_init_locked(sc); - } } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) rl_start_locked(ifp); +done_locked2: + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + CSR_WRITE_2(sc, RL_IMR, RL_INTRS); done_locked: RL_UNLOCK(sc); } From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 17:55:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2042106566C; Wed, 13 Oct 2010 17:55:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9105E8FC16; Wed, 13 Oct 2010 17:55:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DHtrIj095406; Wed, 13 Oct 2010 17:55:53 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DHtrc2095404; Wed, 13 Oct 2010 17:55:53 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201010131755.o9DHtrc2095404@svn.freebsd.org> From: Dimitry Andric Date: Wed, 13 Oct 2010 17:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213797 - head/sys/crypto/aesni X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 17:55:53 -0000 Author: dim Date: Wed Oct 13 17:55:53 2010 New Revision: 213797 URL: http://svn.freebsd.org/changeset/base/213797 Log: Change two missed instances of 'retq' in aeskeys_i386.S to 'retl', which makes it possible to assemble this file with gas from newer binutils. Reviewed by: kib Modified: head/sys/crypto/aesni/aeskeys_i386.S Modified: head/sys/crypto/aesni/aeskeys_i386.S ============================================================================== --- head/sys/crypto/aesni/aeskeys_i386.S Wed Oct 13 17:55:19 2010 (r213796) +++ head/sys/crypto/aesni/aeskeys_i386.S Wed Oct 13 17:55:53 2010 (r213797) @@ -52,7 +52,7 @@ _key_expansion_256a: pxor %xmm1,%xmm0 movaps %xmm0,(%edx) addl $0x10,%edx - retq + retl .cfi_endproc END(_key_expansion_128) @@ -76,7 +76,7 @@ ENTRY(_key_expansion_192a) shufps $0b01001110,%xmm2,%xmm1 movaps %xmm1,0x10(%edx) addl $0x20,%edx - retq + retl .cfi_endproc END(_key_expansion_192a) From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 17:59:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id E507C106564A; Wed, 13 Oct 2010 17:59:51 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Roman Divacky Date: Wed, 13 Oct 2010 13:59:42 -0400 User-Agent: KMail/1.6.2 References: <201010131717.o9DHHobD094458@svn.freebsd.org> <20101013172757.GA21579@freebsd.org> In-Reply-To: <20101013172757.GA21579@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_QOftMZ1MEke0rjl" Message-Id: <201010131359.44590.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo Subject: Re: svn commit: r213793 - in head/sys/dev: ce cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 17:59:52 -0000 --Boundary-00=_QOftMZ1MEke0rjl Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wednesday 13 October 2010 01:27 pm, Roman Divacky wrote: > On Wed, Oct 13, 2010 at 05:17:50PM +0000, Rui Paulo wrote: > > Author: rpaulo > > Date: Wed Oct 13 17:17:50 2010 > > New Revision: 213793 > > URL: http://svn.freebsd.org/changeset/base/213793 > > > > Log: > > Don't do a logical AND of the result of strcmp() with a > > constant. > > > > Found with: clang > > > > Modified: > > head/sys/dev/ce/if_ce.c > > head/sys/dev/cp/if_cp.c > > > > Modified: head/sys/dev/ce/if_ce.c > > ================================================================= > >============= --- head/sys/dev/ce/if_ce.c Wed Oct 13 17:16:08 > > 2010 (r213792) +++ head/sys/dev/ce/if_ce.c Wed Oct 13 17:17:50 > > 2010 (r213793) @@ -1313,7 +1313,7 @@ static int ce_ioctl (struct > > cdev *dev, u IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); > > IFP2SP(d->ifp)->pp_flags |= PP_KEEPALIVE; > > d->ifp->if_flags |= PP_CISCO; > > - } else if (! strcmp ("fr", (char*)data) && PP_FR) { > > + } else if (! strcmp ("fr", (char*)data)) { > > this is wrong I think... the PP_FR was used for compiling in/out > support for something.. see the comment: > > /* If we don't have Cronyx's sppp version, we don't have fr support > via sppp */ #ifndef PP_FR > #define PP_FR 0 > #endif > > note that PP_FR is used in some other places as a flag. I guess > that by compiling with something like make -DPP_FR=42 some magic > would happen. > > anyway - this does not look like a bug but like an intent, please > revert. I think the attached patch should do. Jung-uk Kim --Boundary-00=_QOftMZ1MEke0rjl Content-Type: text/plain; charset="iso-8859-1"; name="cronyx.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cronyx.diff" Index: sys/dev/ce/if_ce.c =================================================================== --- sys/dev/ce/if_ce.c (revision 213782) +++ sys/dev/ce/if_ce.c (working copy) @@ -1313,9 +1313,11 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); IFP2SP(d->ifp)->pp_flags |= PP_KEEPALIVE; d->ifp->if_flags |= PP_CISCO; - } else if (! strcmp ("fr", (char*)data) && PP_FR) { +#if PP_FR > 0 + } else if (! strcmp ("fr", (char*)data)) { d->ifp->if_flags &= ~(PP_CISCO); IFP2SP(d->ifp)->pp_flags |= PP_FR | PP_KEEPALIVE; +#endif } else if (! strcmp ("ppp", (char*)data)) { IFP2SP(d->ifp)->pp_flags &= ~PP_FR; IFP2SP(d->ifp)->pp_flags &= ~PP_KEEPALIVE; Index: sys/dev/cp/if_cp.c =================================================================== --- sys/dev/cp/if_cp.c (revision 213782) +++ sys/dev/cp/if_cp.c (working copy) @@ -1052,9 +1052,11 @@ static int cp_ioctl (struct cdev *dev, u_long cmd, IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); IFP2SP(d->ifp)->pp_flags |= PP_KEEPALIVE; d->ifp->if_flags |= PP_CISCO; - } else if (! strcmp ("fr", (char*)data) && PP_FR) { +#if PP_FR > 0 + } else if (! strcmp ("fr", (char*)data)) { d->ifp->if_flags &= ~(PP_CISCO); IFP2SP(d->ifp)->pp_flags |= PP_FR | PP_KEEPALIVE; +#endif } else if (! strcmp ("ppp", (char*)data)) { IFP2SP(d->ifp)->pp_flags &= ~PP_FR; IFP2SP(d->ifp)->pp_flags &= ~PP_KEEPALIVE; --Boundary-00=_QOftMZ1MEke0rjl-- From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 18:23:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A9511065672; Wed, 13 Oct 2010 18:23:43 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 498618FC0C; Wed, 13 Oct 2010 18:23:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DINhEI096250; Wed, 13 Oct 2010 18:23:43 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DINhwT096248; Wed, 13 Oct 2010 18:23:43 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010131823.o9DINhwT096248@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 13 Oct 2010 18:23:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213798 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 18:23:43 -0000 Author: obrien Date: Wed Oct 13 18:23:43 2010 New Revision: 213798 URL: http://svn.freebsd.org/changeset/base/213798 Log: If one wishes to set breakpoints of static the functions here, they cannot be inlined. Submitted by: jhb Modified: head/bin/sh/Makefile Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Wed Oct 13 17:55:53 2010 (r213797) +++ head/bin/sh/Makefile Wed Oct 13 18:23:43 2010 (r213798) @@ -21,7 +21,7 @@ LDADD= -ll -ledit -ltermcap LFLAGS= -8 # 8-bit lex scanner for arithmetic CFLAGS+=-DSHELL -I. -I${.CURDIR} # for debug: -# DEBUG_FLAGS+= -g -DDEBUG=3 +# DEBUG_FLAGS+= -g -DDEBUG=3 -fno-inline WARNS?= 2 WFORMAT=0 From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 19:46:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id B07121065675; Wed, 13 Oct 2010 19:46:18 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Wed, 13 Oct 2010 15:46:08 -0400 User-Agent: KMail/1.6.2 References: <201010131439.o9DEdssc090571@svn.freebsd.org> In-Reply-To: <201010131439.o9DEdssc090571@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010131546.10130.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Rui Paulo Subject: Re: svn commit: r213779 - head/sys/dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 19:46:19 -0000 On Wednesday 13 October 2010 10:39 am, Rui Paulo wrote: > Author: rpaulo > Date: Wed Oct 13 14:39:54 2010 > New Revision: 213779 > URL: http://svn.freebsd.org/changeset/base/213779 > > Log: > Fix a brain-o: wrong case statement semantics. > > Found with: clang > > Modified: > head/sys/dev/sound/pci/envy24ht.c > head/sys/dev/sound/pci/spicds.c > > Modified: head/sys/dev/sound/pci/envy24ht.c > =================================================================== >=========== --- head/sys/dev/sound/pci/envy24ht.c Wed Oct 13 > 14:37:52 2010 (r213778) +++ head/sys/dev/sound/pci/envy24ht.c Wed > Oct 13 14:39:54 2010 (r213779) @@ -2236,7 +2236,8 @@ > envy24ht_putcfg(struct sc_info *sc) > else > printf("not implemented\n"); > switch (sc->adcn) { > - case 0x01 || 0x02: > + case 0x01: > + case 0x02: > printf(" ADC #: "); > printf("%d\n", sc->adcn); > break; > > Modified: head/sys/dev/sound/pci/spicds.c > =================================================================== >=========== --- head/sys/dev/sound/pci/spicds.c Wed Oct 13 14:37:52 > 2010 (r213778) +++ head/sys/dev/sound/pci/spicds.c Wed Oct 13 > 14:39:54 2010 (r213779) @@ -283,7 +283,8 @@ spicds_set(struct > spicds_info *codec, in case SPICDS_TYPE_WM8770: > left = left + 27; > break; > - case SPICDS_TYPE_AK4381 || SPICDS_TYPE_AK4396: > + case SPICDS_TYPE_AK4381: > + case SPICDS_TYPE_AK4396: > left = left * 255 / 100; > break; > default: Although it was rediscovered by clang, spicds.c patch actually known to fix a problem. Please see kern/146758. Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 20:03:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2810D106566B; Wed, 13 Oct 2010 20:03:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D66798FC08; Wed, 13 Oct 2010 20:03:10 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 6BFCE46BA4; Wed, 13 Oct 2010 16:03:10 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id DE05E8A009; Wed, 13 Oct 2010 16:03:08 -0400 (EDT) From: John Baldwin To: Gennady Proskurin Date: Wed, 13 Oct 2010 15:46:09 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201010090807.o9987nG0030939@svn.freebsd.org> <201010130905.04784.jhb@freebsd.org> <20101013162144.GA5254@gpr.nnz-home.ru> In-Reply-To: <20101013162144.GA5254@gpr.nnz-home.ru> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010131546.09750.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 13 Oct 2010 16:03:09 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon , Bruce Evans Subject: Re: svn commit: r213648 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 20:03:11 -0000 On Wednesday, October 13, 2010 12:21:44 pm Gennady Proskurin wrote: > Thank you and Bruce for explanation. > The key point here (which I did not understand) is that > "something == PCPU_GET(cpuid))" may be true only if "something" is set by the > current cpu, in which case its value is not stale. Yes. mtx_owned() (and mtx_assert()) depend on a similar "feature" in that stale values don't hurt. > On Wed, Oct 13, 2010 at 09:05:04AM -0400, John Baldwin wrote: > > On Tuesday, October 12, 2010 5:08:04 pm Gennady Proskurin wrote: > > > On Sat, Oct 09, 2010 at 12:48:50PM +0300, Andriy Gapon wrote: > > > > on 09/10/2010 12:33 Bruce Evans said the following: > > > > > On Sat, 9 Oct 2010, Andriy Gapon wrote: > > > > > > > > > >> Log: > > > > >> panic_cpu variable should be volatile > > > > >> > > > > >> This is to prevent caching of its value in a register when it is checked > > > > >> and modified by multiple CPUs in parallel. > > > > >> Also, move the variable into the scope of the only function that uses it. > > > > >> > > > > >> Reviewed by: jhb > > > > >> Hint from: mdf > > > > >> MFC after: 1 week > > > > > > > > > > I doubt that this is either necessary or sufficient. Most variables > > > > > aren't volatile while they are locked by a mutex. But panic() cannot use > > > > > normal mutex locking, so it should access this variable using atomic > > > > > ops with memory barriers. The compiler part of the memory barriers > > > > > effectively make _all_ variables temporily volatile. However, 2 of the > > > > > the 4 accesses to this variable doesn't use an atomic op. > > > > > > > > > > % #ifdef SMP > > > > > % /* > > > > > % * We don't want multiple CPU's to panic at the same time, so we > > > > > % * use panic_cpu as a simple spinlock. We have to keep checking > > > > > % * panic_cpu if we are spinning in case the panic on the first > > > > > % * CPU is canceled. > > > > > % */ > > > > > % if (panic_cpu != PCPU_GET(cpuid)) > > > > > > > > > > This access doesn't use an atomic op. > > > > > > > > > > % while (atomic_cmpset_int(&panic_cpu, NOCPU, > > > > > % PCPU_GET(cpuid)) == 0) > > > > > > > > > > This access uses an atomic op. Not all atomic ops use memory barriers, > > > > > at least on i386. However, this one does, at least on i386. > > > > > > > > > > (I'm always confused about what atomic_any() without acq or release > > > > > means. Do they mean that you don't want a memory barrier (this is > > > > > what the mostly give, at least on i386), and if so, what use are > > > > > they? There are far too many atomic ops, for far too many never-used > > > > > widths, with alternative spellings to encourage using a wrong one. > > > > > cmpset is is especially confusing since it you can spell it as cmpset, > > > > > cmpset_acq or compset_rel and always get the barrier, at least on > > > > > i386. At least cmpset only supports 1 width, at least on i386.) > > > > > > > > > > % while (panic_cpu != NOCPU) > > > > > > > > > > This access doesn't use an atomic op. > > > > > > > > > > % ; /* nothing */ > > > > > % #endif > > > > > % ... > > > > > % #ifdef RESTARTABLE_PANICS > > > > > % /* See if the user aborted the panic, in which case we continue. */ > > > > > % if (panicstr == NULL) { > > > > > % #ifdef SMP > > > > > % atomic_store_rel_int(&panic_cpu, NOCPU); > > > > > > > > > > This access uses an atomic op with a memory barrier, at least on i386. > > > > > Now its rel semantics are clear. > > > > > > > > > > panicstr is non-volatile and never accessed by an atomic op, so it probably > > > > > strictly needs to be declared volatile even more than panic_cpu. I think > > > > > > > > I agree about panicstr. > > > > But I am not sure if we have places in code (beyond panic function) itself where > > > > volatile vs. non-volatile would make any actual difference. > > > > But still. > > > > > > > > > the only thing that makes it work now is that it is bogusly pubic, and > > > > > compilers can't analyze the whole program yet -- if they could, then they > > > > > would see that it is only set in panic(). > > > > > > > > > > % #endif > > > > > % return; > > > > > % } > > > > > % #endif > > > > > % #endif > > > > > > > > > > Now, why don't the partial memory barriers prevent caching the variable? > > > > > > > > > > % if (panic_cpu != PCPU_GET(cpuid)) > > > > > % while (atomic_cmpset_int(&panic_cpu, NOCPU, > > > > > % PCPU_GET(cpuid)) == 0) > > > > > % while (panic_cpu != NOCPU) > > > > > % ; /* nothing */ > > > > > > > > > > The very first access can't reasonably use a cachec value. atomic_cmpset() > > > > > can change panic_cpu, so even without the memory barrier, panic_cpu must > > > > > be reloaded for the third access the first time. But then when the third > > > > > access is repeated in the second while loop, the missing atomic op with > > > > > barrier makes things very broken. panic_cpu isn't changed by the loop, > > > > > and the compiler thinks that it isn't changed by anything else either, so > > > > > the compiler may reduce the loop to: > > > > > > > > > > % if (panic_cpu != NOCPU) > > > > > % for (;;) > > > > > % ; /* nothing */ > > > > > > > > > > > > Yes, it's exactly the last loop that had the problem. > > > > On amd64 with -O2: > > > > .loc 1 544 0 > > > > movl panic_cpu(%rip), %eax > > > > .LVL134: > > > > .p2align 4,,7 > > > > .L210: > > > > cmpl $255, %eax > > > > jne .L210 > > > > jmp .L225 > > > > > > > > > except I've seen claims that even an endless for loop can be optimized > > > > > to nothing. Declaring panic_cpu as volatile prevents the compiler doing > > > > > this, but I think it is insufficient. We really do want to see panic_cpu > > > > > changed by other CPUs, and what is the point of atomic_load_acq*() if not > > > > > to use for this -- if declaring things volatile were sufficient, then we > > > > > could just use *(volatile *)&var. atomic_load/store_acq/rel*() on i386 > > > > > > > > I discussed this with kib and the idea is that atomic operation is not needed in > > > > that place and volatile is sufficient, because we don't need barrier semantics > > > > there and only want to ensure that variable is reloaded from memory. > > > > > > If I understand correctly, without acquiring barrier, variable is not > > > guaranteed to be loaded from memory, it can end up with some stale value from > > > cpu's cache or pipeline. If incorrect value will be checked in the first "if" > > > operator, it can lead to skiping all the atomic synchronization. > > > The same about writing to variable, without barrier new value may be written to > > > some local cpu cache and not be seen by readers until it is flushed from cache. > > > > No, a barrier does _not_ force any cache flushes. The point of the volatile > > is to serve as a compiler barrier. A memory barrier only enforces a ordering > > in memory operations in the CPU, it does not flush any caches or force a CPU > > to post writes to memory. It is weaker than that. :) For example, the > > sparcv9 manuals explicitly state something along the lines that any write may > > be held in the CPU's store buffer for an unspecified amount of time. > > Barriers do not alter that, nor would it really be useful for them to do so. > > What barriers allow you to do is order the operations on a lock cookie (such > > as mtx_lock in mutexes) with respect to operations on other memory locations > > (e.g. the data a lock protects). By using a specific set of barriers and > > protocols for accessing the lock cookie, you can ensure that the protected > > data is not accessed without holding the lock. However, for a standalone > > word, memory barriers do not buy you anything. And in fact, if one CPU has > > written to a variable and that write is still sitting in the store buffer, > > 'atomic_load_acq' on another CPU may still return a stale value. All that > > FreeBSD requires is that 'atomic_cmpset' will not report success using stale > > data. It can either fail or block waiting for the write in a store buffer in > > another CPU to drain. We typically handle the 'fail' case by continuing to > > loop until we observe a new state or succesfully perform 'atomic_cmpset' > > (for an example, see setting of MTX_CONTESTED in mtx_lock). > > > > Currently we do not have 'atomic_load()' and 'atomic_store()' variants without > > memory barriers since 'x = y' is atomic (in that it is performed as a single > > operation). However, there are cases where 'x = y' needs a compiler memory > > barrier (but not a CPU one). (e.g. if 'y' can be updated by a signal handler > > in userland, or an interrupt in the kernel.) That is what 'volatile' is for. > > > > -- > > John Baldwin > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > > > -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 20:03:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF7C2106564A; Wed, 13 Oct 2010 20:03:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7ABA28FC0C; Wed, 13 Oct 2010 20:03:12 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 2348946BA2; Wed, 13 Oct 2010 16:03:12 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0187B8A01D; Wed, 13 Oct 2010 16:03:11 -0400 (EDT) From: John Baldwin To: "Jung-uk Kim" Date: Wed, 13 Oct 2010 15:46:44 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201010131717.o9DHHobD094458@svn.freebsd.org> <20101013172757.GA21579@freebsd.org> <201010131359.44590.jkim@FreeBSD.org> In-Reply-To: <201010131359.44590.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201010131546.45048.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 13 Oct 2010 16:03:11 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, Roman Divacky , src-committers@freebsd.org, Rui Paulo , svn-src-all@freebsd.org Subject: Re: svn commit: r213793 - in head/sys/dev: ce cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 20:03:12 -0000 On Wednesday, October 13, 2010 1:59:42 pm Jung-uk Kim wrote: > On Wednesday 13 October 2010 01:27 pm, Roman Divacky wrote: > > On Wed, Oct 13, 2010 at 05:17:50PM +0000, Rui Paulo wrote: > > > Author: rpaulo > > > Date: Wed Oct 13 17:17:50 2010 > > > New Revision: 213793 > > > URL: http://svn.freebsd.org/changeset/base/213793 > > > > > > Log: > > > Don't do a logical AND of the result of strcmp() with a > > > constant. > > > > > > Found with: clang > > > > > > Modified: > > > head/sys/dev/ce/if_ce.c > > > head/sys/dev/cp/if_cp.c > > > > > > Modified: head/sys/dev/ce/if_ce.c > > > ================================================================= > > >============= --- head/sys/dev/ce/if_ce.c Wed Oct 13 17:16:08 > > > 2010 (r213792) +++ head/sys/dev/ce/if_ce.c Wed Oct 13 17:17:50 > > > 2010 (r213793) @@ -1313,7 +1313,7 @@ static int ce_ioctl (struct > > > cdev *dev, u IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); > > > IFP2SP(d->ifp)->pp_flags |= PP_KEEPALIVE; > > > d->ifp->if_flags |= PP_CISCO; > > > - } else if (! strcmp ("fr", (char*)data) && PP_FR) { > > > + } else if (! strcmp ("fr", (char*)data)) { > > > > this is wrong I think... the PP_FR was used for compiling in/out > > support for something.. see the comment: > > > > /* If we don't have Cronyx's sppp version, we don't have fr support > > via sppp */ #ifndef PP_FR > > #define PP_FR 0 > > #endif > > > > note that PP_FR is used in some other places as a flag. I guess > > that by compiling with something like make -DPP_FR=42 some magic > > would happen. > > > > anyway - this does not look like a bug but like an intent, please > > revert. > > I think the attached patch should do. This is certainly more obvious and readable. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 20:08:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E5121065670; Wed, 13 Oct 2010 20:08:03 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C1818FC1B; Wed, 13 Oct 2010 20:08:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DK83HO098738; Wed, 13 Oct 2010 20:08:03 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DK839r098729; Wed, 13 Oct 2010 20:08:03 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201010132008.o9DK839r098729@svn.freebsd.org> From: Benedict Reuschling Date: Wed, 13 Oct 2010 20:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213799 - head/usr.bin/truss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 20:08:03 -0000 Author: bcr (doc committer) Date: Wed Oct 13 20:08:02 2010 New Revision: 213799 URL: http://svn.freebsd.org/changeset/base/213799 Log: s/sytem/system in comments, no functional changes. Reviewed by: alfred@ Modified: head/usr.bin/truss/amd64-fbsd.c head/usr.bin/truss/amd64-fbsd32.c head/usr.bin/truss/i386-fbsd.c head/usr.bin/truss/ia64-fbsd.c head/usr.bin/truss/mips-fbsd.c head/usr.bin/truss/powerpc-fbsd.c head/usr.bin/truss/powerpc64-fbsd.c head/usr.bin/truss/sparc64-fbsd.c Modified: head/usr.bin/truss/amd64-fbsd.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd.c Wed Oct 13 18:23:43 2010 (r213798) +++ head/usr.bin/truss/amd64-fbsd.c Wed Oct 13 20:08:02 2010 (r213799) @@ -257,7 +257,7 @@ amd64_syscall_entry(struct trussinfo *tr * And when the system call is done, we handle it here. * Currently, no attempt is made to ensure that the system calls * match -- this needs to be fixed (and is, in fact, why S_SCX includes - * the sytem call number instead of, say, an error status). + * the system call number instead of, say, an error status). */ long Modified: head/usr.bin/truss/amd64-fbsd32.c ============================================================================== --- head/usr.bin/truss/amd64-fbsd32.c Wed Oct 13 18:23:43 2010 (r213798) +++ head/usr.bin/truss/amd64-fbsd32.c Wed Oct 13 20:08:02 2010 (r213799) @@ -260,7 +260,7 @@ amd64_fbsd32_syscall_entry(struct trussi * And when the system call is done, we handle it here. * Currently, no attempt is made to ensure that the system calls * match -- this needs to be fixed (and is, in fact, why S_SCX includes - * the sytem call number instead of, say, an error status). + * the system call number instead of, say, an error status). */ long Modified: head/usr.bin/truss/i386-fbsd.c ============================================================================== --- head/usr.bin/truss/i386-fbsd.c Wed Oct 13 18:23:43 2010 (r213798) +++ head/usr.bin/truss/i386-fbsd.c Wed Oct 13 20:08:02 2010 (r213799) @@ -250,7 +250,7 @@ i386_syscall_entry(struct trussinfo *tru * And when the system call is done, we handle it here. * Currently, no attempt is made to ensure that the system calls * match -- this needs to be fixed (and is, in fact, why S_SCX includes - * the sytem call number instead of, say, an error status). + * the system call number instead of, say, an error status). */ long Modified: head/usr.bin/truss/ia64-fbsd.c ============================================================================== --- head/usr.bin/truss/ia64-fbsd.c Wed Oct 13 18:23:43 2010 (r213798) +++ head/usr.bin/truss/ia64-fbsd.c Wed Oct 13 20:08:02 2010 (r213799) @@ -231,7 +231,7 @@ ia64_syscall_entry(struct trussinfo *tru * And when the system call is done, we handle it here. * Currently, no attempt is made to ensure that the system calls * match -- this needs to be fixed (and is, in fact, why S_SCX includes - * the sytem call number instead of, say, an error status). + * the system call number instead of, say, an error status). */ long Modified: head/usr.bin/truss/mips-fbsd.c ============================================================================== --- head/usr.bin/truss/mips-fbsd.c Wed Oct 13 18:23:43 2010 (r213798) +++ head/usr.bin/truss/mips-fbsd.c Wed Oct 13 20:08:02 2010 (r213799) @@ -276,7 +276,7 @@ mips_syscall_entry(struct trussinfo *tru * And when the system call is done, we handle it here. * Currently, no attempt is made to ensure that the system calls * match -- this needs to be fixed (and is, in fact, why S_SCX includes - * the sytem call number instead of, say, an error status). + * the system call number instead of, say, an error status). */ long Modified: head/usr.bin/truss/powerpc-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc-fbsd.c Wed Oct 13 18:23:43 2010 (r213798) +++ head/usr.bin/truss/powerpc-fbsd.c Wed Oct 13 20:08:02 2010 (r213799) @@ -262,7 +262,7 @@ powerpc_syscall_entry(struct trussinfo * * And when the system call is done, we handle it here. * Currently, no attempt is made to ensure that the system calls * match -- this needs to be fixed (and is, in fact, why S_SCX includes - * the sytem call number instead of, say, an error status). + * the system call number instead of, say, an error status). */ long Modified: head/usr.bin/truss/powerpc64-fbsd.c ============================================================================== --- head/usr.bin/truss/powerpc64-fbsd.c Wed Oct 13 18:23:43 2010 (r213798) +++ head/usr.bin/truss/powerpc64-fbsd.c Wed Oct 13 20:08:02 2010 (r213799) @@ -250,7 +250,7 @@ powerpc64_syscall_entry(struct trussinfo * And when the system call is done, we handle it here. * Currently, no attempt is made to ensure that the system calls * match -- this needs to be fixed (and is, in fact, why S_SCX includes - * the sytem call number instead of, say, an error status). + * the system call number instead of, say, an error status). */ long Modified: head/usr.bin/truss/sparc64-fbsd.c ============================================================================== --- head/usr.bin/truss/sparc64-fbsd.c Wed Oct 13 18:23:43 2010 (r213798) +++ head/usr.bin/truss/sparc64-fbsd.c Wed Oct 13 20:08:02 2010 (r213799) @@ -274,7 +274,7 @@ sparc64_syscall_entry(struct trussinfo * * And when the system call is done, we handle it here. * Currently, no attempt is made to ensure that the system calls * match -- this needs to be fixed (and is, in fact, why S_SCX includes - * the sytem call number instead of, say, an error status). + * the system call number instead of, say, an error status). */ long From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 20:30:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C9E3106566B; Wed, 13 Oct 2010 20:30:33 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id 3DD0C8FC0A; Wed, 13 Oct 2010 20:30:33 +0000 (UTC) Received: from d.earth.lavabit.com (d.earth.lavabit.com [192.168.111.13]) by karen.lavabit.com (Postfix) with ESMTP id 8BC2211B99F; Wed, 13 Oct 2010 15:30:32 -0500 (CDT) Received: from rui-macbook.lan (bl16-140-224.dsl.telepac.pt [188.81.140.224]) by lavabit.com with ESMTP id DWBS3EJCA1CQ; Wed, 13 Oct 2010 15:30:32 -0500 References: <201010131439.o9DEdssc090571@svn.freebsd.org> <201010131546.10130.jkim@FreeBSD.org> In-Reply-To: <201010131546.10130.jkim@FreeBSD.org> Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii Message-Id: Content-Transfer-Encoding: quoted-printable From: Rui Paulo Date: Wed, 13 Oct 2010 21:30:28 +0100 To: Jung-uk Kim X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@FreeBSD.org Subject: Re: svn commit: r213779 - head/sys/dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 20:30:33 -0000 On 13 Oct 2010, at 20:46, Jung-uk Kim wrote: > On Wednesday 13 October 2010 10:39 am, Rui Paulo wrote: >> Author: rpaulo >> Date: Wed Oct 13 14:39:54 2010 >> New Revision: 213779 >> URL: http://svn.freebsd.org/changeset/base/213779 >>=20 >> Log: >> Fix a brain-o: wrong case statement semantics. >>=20 >> Found with: clang >>=20 >> Modified: >> head/sys/dev/sound/pci/envy24ht.c >> head/sys/dev/sound/pci/spicds.c >>=20 >> Modified: head/sys/dev/sound/pci/envy24ht.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- = head/sys/dev/sound/pci/envy24ht.c Wed Oct 13 >> 14:37:52 2010 (r213778) +++ head/sys/dev/sound/pci/envy24ht.c = Wed >> Oct 13 14:39:54 2010 (r213779) @@ -2236,7 +2236,8 @@ >> envy24ht_putcfg(struct sc_info *sc) >> else >> printf("not implemented\n"); >> switch (sc->adcn) { >> - case 0x01 || 0x02: >> + case 0x01: >> + case 0x02: >> printf(" ADC #: "); >> printf("%d\n", sc->adcn); >> break; >>=20 >> Modified: head/sys/dev/sound/pci/spicds.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head/sys/dev/sound/pci/spicds.c = Wed Oct 13 14:37:52 >> 2010 (r213778) +++ head/sys/dev/sound/pci/spicds.c Wed Oct 13 >> 14:39:54 2010 (r213779) @@ -283,7 +283,8 @@ spicds_set(struct >> spicds_info *codec, in case SPICDS_TYPE_WM8770: >> left =3D left + 27; >> break; >> - case SPICDS_TYPE_AK4381 || SPICDS_TYPE_AK4396: >> + case SPICDS_TYPE_AK4381: >> + case SPICDS_TYPE_AK4396: >> left =3D left * 255 / 100; >> break; >> default: >=20 > Although it was rediscovered by clang, spicds.c patch actually known=20= > to fix a problem. Please see kern/146758. I read the PR and the mailing list posts, but I don't see what problem = does "case SPICDS_TYPE_AK4381 || SPICDS_TYPE_AK4396:" fix. Regards, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 20:35:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7BBC106566B; Wed, 13 Oct 2010 20:35:34 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B273E8FC0A; Wed, 13 Oct 2010 20:35:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DKZYkX099646; Wed, 13 Oct 2010 20:35:34 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DKZY8f099630; Wed, 13 Oct 2010 20:35:34 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201010132035.o9DKZY8f099630@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 13 Oct 2010 20:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213800 - in vendor-sys/acpica/dist: . common compiler events include include/platform os_specific/service_layers tests/misc tools/acpiexec tools/acpisrc utilities X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 20:35:35 -0000 Author: jkim Date: Wed Oct 13 20:35:34 2010 New Revision: 213800 URL: http://svn.freebsd.org/changeset/base/213800 Log: Import ACPICA 20101013. Added: vendor-sys/acpica/dist/compiler/aslmessages.h (contents, props changed) vendor-sys/acpica/dist/tools/acpiexec/aetables.h (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/common/adisasm.c vendor-sys/acpica/dist/compiler/aslanalyze.c vendor-sys/acpica/dist/compiler/aslcodegen.c vendor-sys/acpica/dist/compiler/aslcompile.c vendor-sys/acpica/dist/compiler/aslcompiler.h vendor-sys/acpica/dist/compiler/asldefine.h vendor-sys/acpica/dist/compiler/aslmain.c vendor-sys/acpica/dist/compiler/aslresource.c vendor-sys/acpica/dist/compiler/aslrestype1.c vendor-sys/acpica/dist/compiler/aslrestype1i.c vendor-sys/acpica/dist/compiler/aslrestype2d.c vendor-sys/acpica/dist/compiler/aslrestype2e.c vendor-sys/acpica/dist/compiler/aslrestype2q.c vendor-sys/acpica/dist/compiler/aslrestype2w.c vendor-sys/acpica/dist/compiler/asltypes.h vendor-sys/acpica/dist/compiler/aslutils.c vendor-sys/acpica/dist/compiler/dtcompile.c vendor-sys/acpica/dist/compiler/dttemplate.c vendor-sys/acpica/dist/events/evxfregn.c vendor-sys/acpica/dist/include/acapps.h vendor-sys/acpica/dist/include/aclocal.h vendor-sys/acpica/dist/include/acpixf.h vendor-sys/acpica/dist/include/platform/acenv.h vendor-sys/acpica/dist/os_specific/service_layers/osunixdir.c vendor-sys/acpica/dist/os_specific/service_layers/osunixxf.c vendor-sys/acpica/dist/os_specific/service_layers/oswindir.c vendor-sys/acpica/dist/os_specific/service_layers/oswinxf.c vendor-sys/acpica/dist/osunixxf.c vendor-sys/acpica/dist/tests/misc/badcode.asl vendor-sys/acpica/dist/tools/acpiexec/Makefile vendor-sys/acpica/dist/tools/acpiexec/aemain.c vendor-sys/acpica/dist/tools/acpiexec/aetables.c vendor-sys/acpica/dist/tools/acpiexec/osunixdir.c vendor-sys/acpica/dist/tools/acpisrc/asmain.c vendor-sys/acpica/dist/tools/acpisrc/osunixdir.c vendor-sys/acpica/dist/utilities/utglobal.c vendor-sys/acpica/dist/utilities/utids.c vendor-sys/acpica/dist/utilities/utosi.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Wed Oct 13 20:08:02 2010 (r213799) +++ vendor-sys/acpica/dist/changes.txt Wed Oct 13 20:35:34 2010 (r213800) @@ -1,4 +1,64 @@ ---------------------------------------- +13 October 2010. Summary of changes for version 20101013: + +This release is available at www.acpica.org/downloads + +1) ACPI CA Core Subsystem: + +Added support to clear the PCIEXP_WAKE event. When clearing ACPI events, now +clear the PCIEXP_WAKE_STS bit in the ACPI PM1 Status Register, via +HwClearAcpiStatus. Original change from Colin King. ACPICA BZ 880. + +Changed the type of the predefined namespace object _TZ from ThermalZone to +Device. This was found to be confusing to the host software that processes +the various thermal zones, since _TZ is not really a ThermalZone. However, a +Notify() can still be performed on it. ACPICA BZ 876. Suggestion from Rui +Zhang. + +Added Windows Vista SP2 to the list of supported _OSI strings. The actual +string is "Windows 2006 SP2". + +Eliminated duplicate code in AcpiUtExecute* functions. Now that the nsrepair +code automatically repairs _HID-related strings, this type of code is no +longer needed in Execute_HID, Execute_CID, and Execute_UID. ACPICA BZ 878. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 89.9K Code, 19.0K Data, 108.9K Total + Debug Version: 166.3K Code, 52.1K Data, 218.4K Total + Current Release: + Non-Debug Version: 89.9K Code, 19.0K Data, 108.9K Total + Debug Version: 166.3K Code, 52.1K Data, 218.4K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented additional compile-time validation for _HID strings. The +non-hex prefix (such as "PNP" or "ACPI") must be uppercase, and the length of +the string must be exactly seven or eight characters. For both _HID and _CID +strings, all characters must be alphanumeric. ACPICA BZ 874. + +iASL: Allow certain "null" resource descriptors. Some BIOS code creates +descriptors that are mostly or all zeros, with the expectation that they will +be filled in at runtime. iASL now allows this as long as there is a "resource +tag" (name) associated with the descriptor, which gives the ASL a handle +needed to modify the descriptor. ACPICA BZ 873. + +Added single-thread support to the generic Unix application OSL. Primarily +for iASL support, this change removes the use of semaphores in the single- +threaded ACPICA tools/applications - increasing performance. The +_MULTI_THREADED option was replaced by the (reverse) ACPI_SINGLE_THREADED +option. ACPICA BZ 879. + +AcpiExec: several fixes for the 64-bit version. Adds XSDT support and support +for 64-bit DSDT/FACS addresses in the FADT. Lin Ming. + +iASL: Moved all compiler messages to a new file, aslmessages.h. + +---------------------------------------- 15 September 2010. Summary of changes for version 20100915: This release is available at www.acpica.org/downloads Modified: vendor-sys/acpica/dist/common/adisasm.c ============================================================================== --- vendor-sys/acpica/dist/common/adisasm.c Wed Oct 13 20:08:02 2010 (r213799) +++ vendor-sys/acpica/dist/common/adisasm.c Wed Oct 13 20:35:34 2010 (r213800) @@ -612,10 +612,10 @@ AdDisassemblerHeader ( /* Header and input table info */ - AcpiOsPrintf ("/*\n * Intel ACPI Component Architecture\n"); - AcpiOsPrintf (" * AML Disassembler version %8.8X\n", ACPI_CA_VERSION); + AcpiOsPrintf ("/*\n"); + AcpiOsPrintf (ACPI_COMMON_HEADER ("AML Disassembler", " * ")); - AcpiOsPrintf (" *\n * Disassembly of %s, %s", Filename, ctime (&Timer)); + AcpiOsPrintf (" * Disassembly of %s, %s", Filename, ctime (&Timer)); AcpiOsPrintf (" *\n"); } Modified: vendor-sys/acpica/dist/compiler/aslanalyze.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslanalyze.c Wed Oct 13 20:08:02 2010 (r213799) +++ vendor-sys/acpica/dist/compiler/aslanalyze.c Wed Oct 13 20:35:34 2010 (r213800) @@ -658,6 +658,95 @@ AnMapObjTypeToBtype ( /******************************************************************************* * + * FUNCTION: AnCheckId + * + * PARAMETERS: Op - Current parse op + * Type - HID or CID + * + * RETURN: None + * + * DESCRIPTION: Perform various checks on _HID and _CID strings. Only limited + * checks can be performed on _CID strings. + * + ******************************************************************************/ + +#define ASL_TYPE_HID 0 +#define ASL_TYPE_CID 1 +#include + +static void +AnCheckId ( + ACPI_PARSE_OBJECT *Op, + ACPI_NAME Type) +{ + UINT32 i; + ACPI_SIZE Length; + UINT32 AlphaPrefixLength; + + + if (Op->Asl.ParseOpcode != PARSEOP_STRING_LITERAL) + { + return; + } + + Length = strlen (Op->Asl.Value.String); + + /* + * If _HID/_CID is a string, all characters must be alphanumeric. + * One of the things we want to catch here is the use of + * a leading asterisk in the string -- an odd construct + * that certain platform manufacturers are fond of. + */ + for (i = 0; Op->Asl.Value.String[i]; i++) + { + if (!isalnum ((int) Op->Asl.Value.String[i])) + { + AslError (ASL_ERROR, ASL_MSG_ALPHANUMERIC_STRING, + Op, Op->Asl.Value.String); + break; + } + } + + if (Type == ASL_TYPE_CID) + { + /* _CID strings are bus-specific, no more checks can be performed */ + + return; + } + + /* _HID String must be of the form "XXX####" or "ACPI####" */ + + if ((Length < 7) || (Length > 8)) + { + AslError (ASL_ERROR, ASL_MSG_HID_LENGTH, + Op, Op->Asl.Value.String); + return; + } + + /* _HID Length is valid, now check for uppercase (first 3 or 4 chars) */ + + AlphaPrefixLength = 3; + if (Length >= 8) + { + AlphaPrefixLength = 4; + } + + /* Ensure the alphabetic prefix is all uppercase */ + + for (i = 0; (i < AlphaPrefixLength) && Op->Asl.Value.String[i]; i++) + { + if (!isupper ((int) Op->Asl.Value.String[i])) + { + AslError (ASL_ERROR, ASL_MSG_UPPER_CASE, + Op, &Op->Asl.Value.String[i]); + break; + } + } +} + + +/******************************************************************************* + * * FUNCTION: AnMethodAnalysisWalkBegin * * PARAMETERS: ASL_WALK_CALLBACK @@ -983,23 +1072,29 @@ AnMethodAnalysisWalkBegin ( if (!ACPI_STRCMP (METHOD_NAME__HID, Op->Asl.NameSeg)) { Next = Op->Asl.Child->Asl.Next; - if (Next->Asl.ParseOpcode == PARSEOP_STRING_LITERAL) + AnCheckId (Next, ASL_TYPE_HID); + } + + /* Special typechecking for _CID */ + + else if (!ACPI_STRCMP (METHOD_NAME__CID, Op->Asl.NameSeg)) + { + Next = Op->Asl.Child->Asl.Next; + + if ((Next->Asl.ParseOpcode == PARSEOP_PACKAGE) || + (Next->Asl.ParseOpcode == PARSEOP_VAR_PACKAGE)) { - /* - * _HID is a string, all characters must be alphanumeric. - * One of the things we want to catch here is the use of - * a leading asterisk in the string. - */ - for (i = 0; Next->Asl.Value.String[i]; i++) + Next = Next->Asl.Child; + while (Next) { - if (!isalnum ((int) Next->Asl.Value.String[i])) - { - AslError (ASL_ERROR, ASL_MSG_ALPHANUMERIC_STRING, - Next, Next->Asl.Value.String); - break; - } + AnCheckId (Next, ASL_TYPE_CID); + Next = Next->Asl.Next; } } + else + { + AnCheckId (Next, ASL_TYPE_CID); + } } break; Modified: vendor-sys/acpica/dist/compiler/aslcodegen.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslcodegen.c Wed Oct 13 20:08:02 2010 (r213799) +++ vendor-sys/acpica/dist/compiler/aslcodegen.c Wed Oct 13 20:35:34 2010 (r213800) @@ -513,11 +513,11 @@ CgWriteTableHeader ( /* Compiler ID */ - strncpy (TableHeader.AslCompilerId, CompilerCreatorId, 4); + strncpy (TableHeader.AslCompilerId, ASL_CREATOR_ID, 4); /* Compiler version */ - TableHeader.AslCompilerRevision = CompilerCreatorRevision; + TableHeader.AslCompilerRevision = ASL_REVISION; /* Table length. Checksum zero for now, will rewrite later */ Modified: vendor-sys/acpica/dist/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslcompile.c Wed Oct 13 20:08:02 2010 (r213799) +++ vendor-sys/acpica/dist/compiler/aslcompile.c Wed Oct 13 20:35:34 2010 (r213800) @@ -117,6 +117,7 @@ #include #include #include "aslcompiler.h" +#include #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslcompile") @@ -155,6 +156,7 @@ AslCompilerSignon ( UINT32 FileId) { char *Prefix = ""; + char *UtilityName; /* Set line prefix depending on the destination file type */ @@ -192,36 +194,21 @@ AslCompilerSignon ( break; } - /* - * Compiler signon with copyright - */ - FlPrintFile (FileId, - "%s\n%s%s\n%s", - Prefix, - Prefix, IntelAcpiCA, - Prefix); - /* Running compiler or disassembler? */ if (Gbl_DisasmFlag) { - FlPrintFile (FileId, - "%s", DisassemblerId); + UtilityName = AML_DISASSEMBLER_NAME; } else { - FlPrintFile (FileId, - "%s", CompilerId); + UtilityName = ASL_COMPILER_NAME; } - /* Version, build date, copyright, compliance */ + /* Compiler signon with copyright */ - FlPrintFile (FileId, - " version %X [%s]\n%s%s\n%s%s\n%s\n", - (UINT32) ACPI_CA_VERSION, __DATE__, - Prefix, CompilerCopyright, - Prefix, CompilerCompliance, - Prefix); + FlPrintFile (FileId, "%s\n", Prefix); + FlPrintFile (FileId, ACPI_COMMON_HEADER (UtilityName, Prefix)); } Modified: vendor-sys/acpica/dist/compiler/aslcompiler.h ============================================================================== --- vendor-sys/acpica/dist/compiler/aslcompiler.h Wed Oct 13 20:08:02 2010 (r213799) +++ vendor-sys/acpica/dist/compiler/aslcompiler.h Wed Oct 13 20:35:34 2010 (r213800) @@ -147,6 +147,7 @@ #include "asldefine.h" #include "asltypes.h" +#include "aslmessages.h" #include "aslglobal.h" @@ -795,7 +796,8 @@ RsSmallAddressCheck ( ACPI_PARSE_OBJECT *MinOp, ACPI_PARSE_OBJECT *MaxOp, ACPI_PARSE_OBJECT *LengthOp, - ACPI_PARSE_OBJECT *AlignOp); + ACPI_PARSE_OBJECT *AlignOp, + ACPI_PARSE_OBJECT *Op); void RsLargeAddressCheck ( @@ -807,7 +809,8 @@ RsLargeAddressCheck ( ACPI_PARSE_OBJECT *MinOp, ACPI_PARSE_OBJECT *MaxOp, ACPI_PARSE_OBJECT *LengthOp, - ACPI_PARSE_OBJECT *GranOp); + ACPI_PARSE_OBJECT *GranOp, + ACPI_PARSE_OBJECT *Op); UINT16 RsGetStringDataLength ( Modified: vendor-sys/acpica/dist/compiler/asldefine.h ============================================================================== --- vendor-sys/acpica/dist/compiler/asldefine.h Wed Oct 13 20:08:02 2010 (r213799) +++ vendor-sys/acpica/dist/compiler/asldefine.h Wed Oct 13 20:35:34 2010 (r213800) @@ -122,15 +122,13 @@ /* * Compiler versions and names */ -#define CompilerCreatorRevision ACPI_CA_VERSION +#define ASL_REVISION ACPI_CA_VERSION +#define ASL_COMPILER_NAME "ASL Optimizing Compiler" +#define AML_DISASSEMBLER_NAME "AML Disassembler" +#define ASL_INVOCATION_NAME "iasl" +#define ASL_CREATOR_ID "INTL" -#define IntelAcpiCA "Intel ACPI Component Architecture" -#define CompilerId "ASL Optimizing Compiler" -#define DisassemblerId "AML Disassembler" -#define CompilerCopyright "Copyright (c) 2000 - 2010 Intel Corporation" -#define CompilerCompliance "Supports ACPI Specification Revision 4.0a" -#define CompilerName "iasl" -#define CompilerCreatorId "INTL" +#define ASL_COMPLIANCE "Supports ACPI Specification Revision 4.0a" /* Configuration constants */ Modified: vendor-sys/acpica/dist/compiler/aslmain.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslmain.c Wed Oct 13 20:08:02 2010 (r213799) +++ vendor-sys/acpica/dist/compiler/aslmain.c Wed Oct 13 20:35:34 2010 (r213800) @@ -296,7 +296,8 @@ Usage ( void) { - printf ("Usage: %s [Options] [Files]\n\n", CompilerName); + printf ("%s\n", ASL_COMPLIANCE); + printf ("Usage: %s [Options] [Files]\n\n", ASL_INVOCATION_NAME); Options (); } @@ -903,7 +904,7 @@ AslCommandLine ( if (argc < 2) { - AslCompilerSignon (ASL_FILE_STDOUT); + printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME)); Usage (); exit (1); } @@ -934,7 +935,7 @@ AslCommandLine ( if (Gbl_DoSignon) { - AslCompilerSignon (ASL_FILE_STDOUT); + printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME)); } /* Abort if anything went wrong on the command line */ Added: vendor-sys/acpica/dist/compiler/aslmessages.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/acpica/dist/compiler/aslmessages.h Wed Oct 13 20:35:34 2010 (r213800) @@ -0,0 +1,436 @@ + +/****************************************************************************** + * + * Module Name: aslmessages.h - Compiler error/warning messages + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + + +#ifndef __ASLMESSAGES_H +#define __ASLMESSAGES_H + + +#define ASL_WARNING 0 +#define ASL_WARNING2 1 +#define ASL_WARNING3 2 +#define ASL_ERROR 3 +#define ASL_REMARK 4 +#define ASL_OPTIMIZATION 5 +#define ASL_NUM_REPORT_LEVELS 6 + + +/* Values for all compiler messages */ + +typedef enum +{ + ASL_MSG_RESERVED = 0, + ASL_MSG_ALPHANUMERIC_STRING, + ASL_MSG_AML_NOT_IMPLEMENTED, + ASL_MSG_ARG_COUNT_HI, + ASL_MSG_ARG_COUNT_LO, + ASL_MSG_ARG_INIT, + ASL_MSG_BACKWARDS_OFFSET, + ASL_MSG_BITS_TO_BYTES, + ASL_MSG_BUFFER_LENGTH, + ASL_MSG_BYTES_TO_BITS, + ASL_MSG_CLOSE, + ASL_MSG_COMPILER_INTERNAL, + ASL_MSG_CONSTANT_EVALUATION, + ASL_MSG_CONSTANT_FOLDED, + ASL_MSG_CORE_EXCEPTION, + ASL_MSG_DEBUG_FILE_OPEN, + ASL_MSG_DEBUG_FILENAME, + ASL_MSG_DEPENDENT_NESTING, + ASL_MSG_DMA_CHANNEL, + ASL_MSG_DMA_LIST, + ASL_MSG_DUPLICATE_CASE, + ASL_MSG_DUPLICATE_ITEM, + ASL_MSG_EARLY_EOF, + ASL_MSG_ENCODING_LENGTH, + ASL_MSG_EX_INTERRUPT_LIST, + ASL_MSG_EX_INTERRUPT_LIST_MIN, + ASL_MSG_EX_INTERRUPT_NUMBER, + ASL_MSG_FIELD_ACCESS_WIDTH, + ASL_MSG_FIELD_UNIT_ACCESS_WIDTH, + ASL_MSG_FIELD_UNIT_OFFSET, + ASL_MSG_INCLUDE_FILE_OPEN, + ASL_MSG_INPUT_FILE_OPEN, + ASL_MSG_INTEGER_LENGTH, + ASL_MSG_INTEGER_OPTIMIZATION, + ASL_MSG_INTERRUPT_LIST, + ASL_MSG_INTERRUPT_NUMBER, + ASL_MSG_INVALID_CONSTANT_OP, + ASL_MSG_INVALID_EISAID, + ASL_MSG_INVALID_ESCAPE, + ASL_MSG_INVALID_OPERAND, + ASL_MSG_INVALID_PERFORMANCE, + ASL_MSG_INVALID_PRIORITY, + ASL_MSG_INVALID_STRING, + ASL_MSG_INVALID_TARGET, + ASL_MSG_INVALID_TIME, + ASL_MSG_INVALID_TYPE, + ASL_MSG_INVALID_UUID, + ASL_MSG_LIST_LENGTH_LONG, + ASL_MSG_LIST_LENGTH_SHORT, + ASL_MSG_LISTING_FILE_OPEN, + ASL_MSG_LISTING_FILENAME, + ASL_MSG_LOCAL_INIT, + ASL_MSG_LONG_LINE, + ASL_MSG_MEMORY_ALLOCATION, + ASL_MSG_MISSING_ENDDEPENDENT, + ASL_MSG_MISSING_STARTDEPENDENT, + ASL_MSG_MULTIPLE_TYPES, + ASL_MSG_NAME_EXISTS, + ASL_MSG_NAME_OPTIMIZATION, + ASL_MSG_NESTED_COMMENT, + ASL_MSG_NO_CASES, + ASL_MSG_NO_RETVAL, + ASL_MSG_NO_WHILE, + ASL_MSG_NON_ASCII, + ASL_MSG_NOT_EXIST, + ASL_MSG_NOT_FOUND, + ASL_MSG_NOT_METHOD, + ASL_MSG_NOT_PARAMETER, + ASL_MSG_NOT_REACHABLE, + ASL_MSG_OPEN, + ASL_MSG_OUTPUT_FILE_OPEN, + ASL_MSG_OUTPUT_FILENAME, + ASL_MSG_PACKAGE_LENGTH, + ASL_MSG_READ, + ASL_MSG_RECURSION, + ASL_MSG_REGION_BUFFER_ACCESS, + ASL_MSG_REGION_BYTE_ACCESS, + ASL_MSG_RESERVED_ARG_COUNT_HI, + ASL_MSG_RESERVED_ARG_COUNT_LO, + ASL_MSG_RESERVED_METHOD, + ASL_MSG_RESERVED_OPERAND_TYPE, + ASL_MSG_RESERVED_RETURN_VALUE, + ASL_MSG_RESERVED_USE, + ASL_MSG_RESERVED_WORD, + ASL_MSG_RESOURCE_FIELD, + ASL_MSG_RESOURCE_INDEX, + ASL_MSG_RESOURCE_LIST, + ASL_MSG_RESOURCE_SOURCE, + ASL_MSG_RETURN_TYPES, + ASL_MSG_SCOPE_FWD_REF, + ASL_MSG_SCOPE_TYPE, + ASL_MSG_SEEK, + ASL_MSG_SINGLE_NAME_OPTIMIZATION, + ASL_MSG_SOME_NO_RETVAL, + ASL_MSG_SWITCH_TYPE, + ASL_MSG_SYNC_LEVEL, + ASL_MSG_SYNTAX, + ASL_MSG_TABLE_SIGNATURE, + ASL_MSG_TOO_MANY_TEMPS, + ASL_MSG_UNKNOWN_RESERVED_NAME, + ASL_MSG_UNREACHABLE_CODE, + ASL_MSG_UNSUPPORTED, + ASL_MSG_VENDOR_LIST, + ASL_MSG_WRITE, + ASL_MSG_MULTIPLE_DEFAULT, + ASL_MSG_TIMEOUT, + ASL_MSG_RESULT_NOT_USED, + ASL_MSG_NOT_REFERENCED, + ASL_MSG_NON_ZERO, + ASL_MSG_STRING_LENGTH, + ASL_MSG_SERIALIZED, + ASL_MSG_COMPILER_RESERVED, + ASL_MSG_NAMED_OBJECT_IN_WHILE, + ASL_MSG_LOCAL_OUTSIDE_METHOD, + ASL_MSG_ALIGNMENT, + ASL_MSG_ISA_ADDRESS, + ASL_MSG_INVALID_MIN_MAX, + ASL_MSG_INVALID_LENGTH, + ASL_MSG_INVALID_LENGTH_FIXED, + ASL_MSG_INVALID_GRANULARITY, + ASL_MSG_INVALID_GRAN_FIXED, + ASL_MSG_INVALID_ACCESS_SIZE, + ASL_MSG_INVALID_ADDR_FLAGS, + ASL_MSG_NULL_DESCRIPTOR, + ASL_MSG_UPPER_CASE, + ASL_MSG_HID_LENGTH, + ASL_MSG_INVALID_FIELD_NAME, + ASL_MSG_INTEGER_SIZE, + ASL_MSG_INVALID_HEX_INTEGER, + ASL_MSG_BUFFER_ELEMENT, + ASL_MSG_RESERVED_VALUE, + ASL_MSG_FLAG_VALUE, + ASL_MSG_ZERO_VALUE, + ASL_MSG_UNKNOWN_TABLE, + ASL_MSG_UNKNOWN_SUBTABLE, + ASL_MSG_OEM_TABLE + +} ASL_MESSAGE_IDS; + + +#ifdef ASL_EXCEPTIONS + +/* Actual message strings for each compiler message */ + +char *AslMessages [] = { +/* The zeroth message is reserved */ "", +/* ASL_MSG_ALPHANUMERIC_STRING */ "String must be entirely alphanumeric", +/* ASL_MSG_AML_NOT_IMPLEMENTED */ "Opcode is not implemented in compiler AML code generator", +/* ASL_MSG_ARG_COUNT_HI */ "Too many arguments", +/* ASL_MSG_ARG_COUNT_LO */ "Too few arguments", +/* ASL_MSG_ARG_INIT */ "Method argument is not initialized", +/* ASL_MSG_BACKWARDS_OFFSET */ "Invalid backwards offset", +/* ASL_MSG_BITS_TO_BYTES */ "Field offset is in bits, but a byte offset is required", +/* ASL_MSG_BUFFER_LENGTH */ "Effective AML buffer length is zero", +/* ASL_MSG_BYTES_TO_BITS */ "Field offset is in bytes, but a bit offset is required", +/* ASL_MSG_CLOSE */ "Could not close file", +/* ASL_MSG_COMPILER_INTERNAL */ "Internal compiler error", +/* ASL_MSG_CONSTANT_EVALUATION */ "Could not evaluate constant expression", +/* ASL_MSG_CONSTANT_FOLDED */ "Constant expression evaluated and reduced", +/* ASL_MSG_CORE_EXCEPTION */ "From ACPI CA Subsystem", +/* ASL_MSG_DEBUG_FILE_OPEN */ "Could not open debug file", +/* ASL_MSG_DEBUG_FILENAME */ "Could not create debug filename", +/* ASL_MSG_DEPENDENT_NESTING */ "Dependent function macros cannot be nested",\ +/* ASL_MSG_DMA_CHANNEL */ "Invalid DMA channel (must be 0-7)", +/* ASL_MSG_DMA_LIST */ "Too many DMA channels (8 max)", +/* ASL_MSG_DUPLICATE_CASE */ "Case value already specified", +/* ASL_MSG_DUPLICATE_ITEM */ "Duplicate value in list", +/* ASL_MSG_EARLY_EOF */ "Premature end-of-file reached", +/* ASL_MSG_ENCODING_LENGTH */ "Package length too long to encode", +/* ASL_MSG_EX_INTERRUPT_LIST */ "Too many interrupts (255 max)", +/* ASL_MSG_EX_INTERRUPT_LIST_MIN */ "Too few interrupts (1 minimum required)", +/* ASL_MSG_EX_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 32 bits)", +/* ASL_MSG_FIELD_ACCESS_WIDTH */ "Access width is greater than region size", +/* ASL_MSG_FIELD_UNIT_ACCESS_WIDTH */ "Access width of Field Unit extends beyond region limit", +/* ASL_MSG_FIELD_UNIT_OFFSET */ "Field Unit extends beyond region limit", +/* ASL_MSG_INCLUDE_FILE_OPEN */ "Could not open include file", +/* ASL_MSG_INPUT_FILE_OPEN */ "Could not open input file", +/* ASL_MSG_INTEGER_LENGTH */ "64-bit integer in 32-bit table, truncating", +/* ASL_MSG_INTEGER_OPTIMIZATION */ "Integer optimized to single-byte AML opcode", +/* ASL_MSG_INTERRUPT_LIST */ "Too many interrupts (16 max)", +/* ASL_MSG_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 0-15)", +/* ASL_MSG_INVALID_CONSTANT_OP */ "Invalid operator in constant expression (not type 3/4/5)", +/* ASL_MSG_INVALID_EISAID */ "EISAID string must be of the form \"UUUXXXX\" (3 uppercase, 4 hex digits)", +/* ASL_MSG_INVALID_ESCAPE */ "Invalid or unknown escape sequence", +/* ASL_MSG_INVALID_OPERAND */ "Invalid operand", +/* ASL_MSG_INVALID_PERFORMANCE */ "Invalid performance/robustness value", +/* ASL_MSG_INVALID_PRIORITY */ "Invalid priority value", +/* ASL_MSG_INVALID_STRING */ "Invalid Hex/Octal Escape - Non-ASCII or NULL", +/* ASL_MSG_INVALID_TARGET */ "Target operand not allowed in constant expression", +/* ASL_MSG_INVALID_TIME */ "Time parameter too long (255 max)", +/* ASL_MSG_INVALID_TYPE */ "Invalid type", +/* ASL_MSG_INVALID_UUID */ "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"", +/* ASL_MSG_LIST_LENGTH_LONG */ "Initializer list longer than declared package length", +/* ASL_MSG_LIST_LENGTH_SHORT */ "Initializer list shorter than declared package length", +/* ASL_MSG_LISTING_FILE_OPEN */ "Could not open listing file", +/* ASL_MSG_LISTING_FILENAME */ "Could not create listing filename", +/* ASL_MSG_LOCAL_INIT */ "Method local variable is not initialized", +/* ASL_MSG_LONG_LINE */ "Splitting long input line", +/* ASL_MSG_MEMORY_ALLOCATION */ "Memory allocation failure", +/* ASL_MSG_MISSING_ENDDEPENDENT */ "Missing EndDependentFn() macro in dependent resource list", +/* ASL_MSG_MISSING_STARTDEPENDENT */ "Missing StartDependentFn() macro in dependent resource list", +/* ASL_MSG_MULTIPLE_TYPES */ "Multiple types", +/* ASL_MSG_NAME_EXISTS */ "Name already exists in scope", +/* ASL_MSG_NAME_OPTIMIZATION */ "NamePath optimized", +/* ASL_MSG_NESTED_COMMENT */ "Nested comment found", +/* ASL_MSG_NO_CASES */ "No Case statements under Switch", +/* ASL_MSG_NO_RETVAL */ "Called method returns no value", +/* ASL_MSG_NO_WHILE */ "No enclosing While statement", +/* ASL_MSG_NON_ASCII */ "Invalid characters found in file", +/* ASL_MSG_NOT_EXIST */ "Object does not exist", +/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from scope", +/* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke", +/* ASL_MSG_NOT_PARAMETER */ "Not a parameter, used as local only", +/* ASL_MSG_NOT_REACHABLE */ "Object is not accessible from this scope", +/* ASL_MSG_OPEN */ "Could not open file", +/* ASL_MSG_OUTPUT_FILE_OPEN */ "Could not open output AML file", +/* ASL_MSG_OUTPUT_FILENAME */ "Could not create output filename", +/* ASL_MSG_PACKAGE_LENGTH */ "Effective AML package length is zero", +/* ASL_MSG_READ */ "Could not read file", +/* ASL_MSG_RECURSION */ "Recursive method call", +/* ASL_MSG_REGION_BUFFER_ACCESS */ "Host Operation Region requires BufferAcc access", +/* ASL_MSG_REGION_BYTE_ACCESS */ "Host Operation Region requires ByteAcc access", +/* ASL_MSG_RESERVED_ARG_COUNT_HI */ "Reserved method has too many arguments", +/* ASL_MSG_RESERVED_ARG_COUNT_LO */ "Reserved method has too few arguments", +/* ASL_MSG_RESERVED_METHOD */ "Reserved name must be a control method", +/* ASL_MSG_RESERVED_OPERAND_TYPE */ "Invalid object type for reserved name", +/* ASL_MSG_RESERVED_RETURN_VALUE */ "Reserved method must return a value", +/* ASL_MSG_RESERVED_USE */ "Invalid use of reserved name", +/* ASL_MSG_RESERVED_WORD */ "Use of reserved name", +/* ASL_MSG_RESOURCE_FIELD */ "Resource field name cannot be used as a target", +/* ASL_MSG_RESOURCE_INDEX */ "Missing ResourceSourceIndex (required)", +/* ASL_MSG_RESOURCE_LIST */ "Too many resource items (internal error)", +/* ASL_MSG_RESOURCE_SOURCE */ "Missing ResourceSource string (required)", +/* ASL_MSG_RETURN_TYPES */ "Not all control paths return a value", +/* ASL_MSG_SCOPE_FWD_REF */ "Forward references from Scope operator not allowed", +/* ASL_MSG_SCOPE_TYPE */ "Existing object has invalid type for Scope operator", +/* ASL_MSG_SEEK */ "Could not seek file", +/* ASL_MSG_SINGLE_NAME_OPTIMIZATION */ "NamePath optimized to NameSeg (uses run-time search path)", +/* ASL_MSG_SOME_NO_RETVAL */ "Called method may not always return a value", +/* ASL_MSG_SWITCH_TYPE */ "Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer", +/* ASL_MSG_SYNC_LEVEL */ "SyncLevel must be in the range 0-15", +/* ASL_MSG_SYNTAX */ "", +/* ASL_MSG_TABLE_SIGNATURE */ "Invalid Table Signature", +/* ASL_MSG_TOO_MANY_TEMPS */ "Method requires too many temporary variables (_T_x)", +/* ASL_MSG_UNKNOWN_RESERVED_NAME */ "Unknown reserved name", +/* ASL_MSG_UNREACHABLE_CODE */ "Statement is unreachable", +/* ASL_MSG_UNSUPPORTED */ "Unsupported feature", +/* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)", +/* ASL_MSG_WRITE */ "Could not write file", +/* ASL_MSG_MULTIPLE_DEFAULT */ "More than one Default statement within Switch construct", +/* ASL_MSG_TIMEOUT */ "Possible operator timeout is ignored", +/* ASL_MSG_RESULT_NOT_USED */ "Result is not used, operator has no effect", +/* ASL_MSG_NOT_REFERENCED */ "Namespace object is not referenced", +/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero", +/* ASL_MSG_STRING_LENGTH */ "String literal too long", +/* ASL_MSG_SERIALIZED */ "Control Method marked Serialized", +/* ASL_MSG_COMPILER_RESERVED */ "Use of compiler reserved name", +/* ASL_MSG_NAMED_OBJECT_IN_WHILE */ "Creating a named object in a While loop", +/* ASL_MSG_LOCAL_OUTSIDE_METHOD */ "Local or Arg used outside a control method", +/* ASL_MSG_ALIGNMENT */ "Must be a multiple of alignment/granularity value", +/* ASL_MSG_ISA_ADDRESS */ "Maximum 10-bit ISA address (0x3FF)", +/* ASL_MSG_INVALID_MIN_MAX */ "Address Min is greater than Address Max", +/* ASL_MSG_INVALID_LENGTH */ "Length is larger than Min/Max window", +/* ASL_MSG_INVALID_LENGTH_FIXED */ "Length is not equal to fixed Min/Max window", +/* ASL_MSG_INVALID_GRANULARITY */ "Granularity must be zero or a power of two minus one", +/* ASL_MSG_INVALID_GRAN_FIXED */ "Granularity must be zero for fixed Min/Max", +/* ASL_MSG_INVALID_ACCESS_SIZE */ "Invalid AccessSize (Maximum is 4 - QWord access)", +/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags", +/* ASL_MSG_NULL_DESCRIPTOR */ "Min/Max/Length/Gran are all zero, but no resource tag", +/* ASL_MSG_UPPER_CASE */ "Non-hex letters must be upper case", +/* ASL_MSG_HID_LENGTH */ "_HID string must be exactly 7 or 8 characters", + +/* These messages are used by the data table compiler only */ + +/* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name", +/* ASL_MSG_INTEGER_SIZE */ "Integer too large for target", +/* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant", +/* ASL_MSG_BUFFER_ELEMENT */ "Invalid element in buffer initializer list", +/* ASL_MSG_RESERVED_VALUE */ "Reserved field must be zero", +/* ASL_MSG_FLAG_VALUE */ "Flag value is too large", +/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero", +/* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature", +/* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type", +/* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents" + +}; + + +char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = { + "Warning ", + "Warning ", + "Warning ", + "Error ", + "Remark ", + "Optimize" +}; + +#define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings above */ + +#endif /* ASL_EXCEPTIONS */ + +#endif /* __ASLMESSAGES_H */ Modified: vendor-sys/acpica/dist/compiler/aslresource.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslresource.c Wed Oct 13 20:08:02 2010 (r213799) +++ vendor-sys/acpica/dist/compiler/aslresource.c Wed Oct 13 20:35:34 2010 (r213800) @@ -139,6 +139,7 @@ * NULL, means "zero value for alignment is * OK, and means 64K alignment" (for * Memory24 descriptor) + * Op - Parent Op for entire construct * * RETURN: None. Adds error messages to error log if necessary * @@ -158,7 +159,8 @@ RsSmallAddressCheck ( ACPI_PARSE_OBJECT *MinOp, ACPI_PARSE_OBJECT *MaxOp, ACPI_PARSE_OBJECT *LengthOp, - ACPI_PARSE_OBJECT *AlignOp) + ACPI_PARSE_OBJECT *AlignOp, + ACPI_PARSE_OBJECT *Op) { if (Gbl_NoResourceChecking) @@ -166,6 +168,34 @@ RsSmallAddressCheck ( return; } + /* + * Check for a so-called "null descriptor". These are descriptors that are + * created with most fields set to zero. The intent is that the descriptor + * will be updated/completed at runtime via a BufferField. + * + * If the descriptor does NOT have a resource tag, it cannot be referenced + * by a BufferField and we will flag this as an error. Conversely, if + * the descriptor has a resource tag, we will assume that a BufferField + * will be used to dynamically update it, so no error. + * + * A possible enhancement to this check would be to verify that in fact + * a BufferField is created using the resource tag, and perhaps even + * verify that a Store is performed to the BufferField. + * + * Note: for these descriptors, Alignment is allowed to be zero + */ + if (!Minimum && !Maximum && !Length) + { + if (!Op->Asl.ExternalName) + { + /* No resource tag. Descriptor is fixed and is also illegal */ + + AslError (ASL_ERROR, ASL_MSG_NULL_DESCRIPTOR, Op, NULL); + } + + return; + } + /* Special case for Memory24, values are compressed */ if (Type == ACPI_RESOURCE_NAME_MEMORY24) @@ -230,6 +260,7 @@ RsSmallAddressCheck ( * MaxOp - Original Op for Address Max * LengthOp - Original Op for address range * GranOp - Original Op for address granularity + * Op - Parent Op for entire construct * * RETURN: None. Adds error messages to error log if necessary * @@ -259,7 +290,8 @@ RsLargeAddressCheck ( ACPI_PARSE_OBJECT *MinOp, ACPI_PARSE_OBJECT *MaxOp, ACPI_PARSE_OBJECT *LengthOp, - ACPI_PARSE_OBJECT *GranOp) + ACPI_PARSE_OBJECT *GranOp, + ACPI_PARSE_OBJECT *Op) { if (Gbl_NoResourceChecking) @@ -267,6 +299,32 @@ RsLargeAddressCheck ( return; } + /* + * Check for a so-called "null descriptor". These are descriptors that are + * created with most fields set to zero. The intent is that the descriptor + * will be updated/completed at runtime via a BufferField. + * + * If the descriptor does NOT have a resource tag, it cannot be referenced + * by a BufferField and we will flag this as an error. Conversely, if + * the descriptor has a resource tag, we will assume that a BufferField + * will be used to dynamically update it, so no error. + * + * A possible enhancement to this check would be to verify that in fact + * a BufferField is created using the resource tag, and perhaps even + * verify that a Store is performed to the BufferField. + */ + if (!Minimum && !Maximum && !Length && !Granularity) + { + if (!Op->Asl.ExternalName) + { + /* No resource tag. Descriptor is fixed and is also illegal */ + + AslError (ASL_ERROR, ASL_MSG_NULL_DESCRIPTOR, Op, NULL); + } + + return; + } + /* Basic checks on Min/Max/Length */ if (Minimum > Maximum) Modified: vendor-sys/acpica/dist/compiler/aslrestype1.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslrestype1.c Wed Oct 13 20:08:02 2010 (r213799) +++ vendor-sys/acpica/dist/compiler/aslrestype1.c Wed Oct 13 20:35:34 2010 (r213800) @@ -300,7 +300,7 @@ RsDoMemory24Descriptor ( Descriptor->Memory24.Maximum, Descriptor->Memory24.AddressLength, Descriptor->Memory24.Alignment, - MinOp, MaxOp, LengthOp, NULL); + MinOp, MaxOp, LengthOp, NULL, Op); return (Rnode); } @@ -408,7 +408,7 @@ RsDoMemory32Descriptor ( Descriptor->Memory32.Maximum, Descriptor->Memory32.AddressLength, Descriptor->Memory32.Alignment, - MinOp, MaxOp, LengthOp, AlignOp); + MinOp, MaxOp, LengthOp, AlignOp, Op); return (Rnode); } Modified: vendor-sys/acpica/dist/compiler/aslrestype1i.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslrestype1i.c Wed Oct 13 20:08:02 2010 (r213799) +++ vendor-sys/acpica/dist/compiler/aslrestype1i.c Wed Oct 13 20:35:34 2010 (r213800) @@ -439,7 +439,7 @@ RsDoIoDescriptor ( Descriptor->Io.Maximum, Descriptor->Io.AddressLength, Descriptor->Io.Alignment, - MinOp, MaxOp, LengthOp, AlignOp); + MinOp, MaxOp, LengthOp, AlignOp, Op); return (Rnode); } Modified: vendor-sys/acpica/dist/compiler/aslrestype2d.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslrestype2d.c Wed Oct 13 20:08:02 2010 (r213799) +++ vendor-sys/acpica/dist/compiler/aslrestype2d.c Wed Oct 13 20:35:34 2010 (r213800) @@ -352,7 +352,7 @@ RsDoDwordIoDescriptor ( (UINT64) Descriptor->Address32.AddressLength, (UINT64) Descriptor->Address32.Granularity, Descriptor->Address32.Flags, - MinOp, MaxOp, LengthOp, GranOp); + MinOp, MaxOp, LengthOp, GranOp, Op); Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) + OptionIndex + StringLength; @@ -588,7 +588,7 @@ RsDoDwordMemoryDescriptor ( (UINT64) Descriptor->Address32.AddressLength, (UINT64) Descriptor->Address32.Granularity, Descriptor->Address32.Flags, - MinOp, MaxOp, LengthOp, GranOp); + MinOp, MaxOp, LengthOp, GranOp, Op); Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) + OptionIndex + StringLength; @@ -806,7 +806,7 @@ RsDoDwordSpaceDescriptor ( (UINT64) Descriptor->Address32.AddressLength, (UINT64) Descriptor->Address32.Granularity, Descriptor->Address32.Flags, - MinOp, MaxOp, LengthOp, GranOp); + MinOp, MaxOp, LengthOp, GranOp, Op); Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) + OptionIndex + StringLength; Modified: vendor-sys/acpica/dist/compiler/aslrestype2e.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslrestype2e.c Wed Oct 13 20:08:02 2010 (r213799) +++ vendor-sys/acpica/dist/compiler/aslrestype2e.c Wed Oct 13 20:35:34 2010 (r213800) @@ -294,7 +294,7 @@ RsDoExtendedIoDescriptor ( Descriptor->ExtAddress64.AddressLength, Descriptor->ExtAddress64.Granularity, Descriptor->ExtAddress64.Flags, - MinOp, MaxOp, LengthOp, GranOp); + MinOp, MaxOp, LengthOp, GranOp, Op); Rnode->BufferLength = sizeof (AML_RESOURCE_EXTENDED_ADDRESS64) + StringLength; return (Rnode); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 20:36:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05FEE1065694; Wed, 13 Oct 2010 20:36:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEE298FC0A; Wed, 13 Oct 2010 20:36:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DKagvv099711; Wed, 13 Oct 2010 20:36:42 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DKag8w099710; Wed, 13 Oct 2010 20:36:42 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201010132036.o9DKag8w099710@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 13 Oct 2010 20:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213801 - vendor-sys/acpica/20101013 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 20:36:43 -0000 Author: jkim Date: Wed Oct 13 20:36:42 2010 New Revision: 213801 URL: http://svn.freebsd.org/changeset/base/213801 Log: Tag ACPICA 20101013. Added: vendor-sys/acpica/20101013/ - copied from r213800, vendor-sys/acpica/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 20:37:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADAA51065672; Wed, 13 Oct 2010 20:37:19 +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 9B5168FC1C; Wed, 13 Oct 2010 20:37:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DKbJYq099764; Wed, 13 Oct 2010 20:37:19 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DKbJHw099757; Wed, 13 Oct 2010 20:37:19 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010132037.o9DKbJHw099757@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 13 Oct 2010 20:37:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213802 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 20:37:19 -0000 Author: hselasky Date: Wed Oct 13 20:37:19 2010 New Revision: 213802 URL: http://svn.freebsd.org/changeset/base/213802 Log: Correct some root HUB descriptor fields in multiple controller drivers. Remove an unused structure. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/controller/at91dci.c head/sys/dev/usb/controller/atmegadci.c head/sys/dev/usb/controller/avr32dci.c head/sys/dev/usb/controller/musb_otg.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/uss820dci.c Modified: head/sys/dev/usb/controller/at91dci.c ============================================================================== --- head/sys/dev/usb/controller/at91dci.c Wed Oct 13 20:36:42 2010 (r213801) +++ head/sys/dev/usb/controller/at91dci.c Wed Oct 13 20:37:19 2010 (r213802) @@ -1689,7 +1689,7 @@ static const struct usb_device_descripto .bcdUSB = {0x00, 0x02}, .bDeviceClass = UDCLASS_HUB, .bDeviceSubClass = UDSUBCLASS_HUB, - .bDeviceProtocol = UDPROTO_HSHUBSTT, + .bDeviceProtocol = UDPROTO_FSHUB, .bMaxPacketSize = 64, .bcdDevice = {0x00, 0x01}, .iManufacturer = 1, @@ -1697,17 +1697,6 @@ static const struct usb_device_descripto .bNumConfigurations = 1, }; -static const struct usb_device_qualifier at91dci_odevd = { - .bLength = sizeof(struct usb_device_qualifier), - .bDescriptorType = UDESC_DEVICE_QUALIFIER, - .bcdUSB = {0x00, 0x02}, - .bDeviceClass = UDCLASS_HUB, - .bDeviceSubClass = UDSUBCLASS_HUB, - .bDeviceProtocol = UDPROTO_FSHUB, - .bMaxPacketSize0 = 0, - .bNumConfigurations = 0, -}; - static const struct at91dci_config_desc at91dci_confd = { .confd = { .bLength = sizeof(struct usb_config_descriptor), @@ -1725,7 +1714,7 @@ static const struct at91dci_config_desc .bNumEndpoints = 1, .bInterfaceClass = UICLASS_HUB, .bInterfaceSubClass = UISUBCLASS_HUB, - .bInterfaceProtocol = UIPROTO_HSHUBSTT, + .bInterfaceProtocol = 0, }, .endpd = { .bLength = sizeof(struct usb_endpoint_descriptor), Modified: head/sys/dev/usb/controller/atmegadci.c ============================================================================== --- head/sys/dev/usb/controller/atmegadci.c Wed Oct 13 20:36:42 2010 (r213801) +++ head/sys/dev/usb/controller/atmegadci.c Wed Oct 13 20:37:19 2010 (r213802) @@ -1511,7 +1511,7 @@ static const struct usb_device_descripto .bcdUSB = {0x00, 0x02}, .bDeviceClass = UDCLASS_HUB, .bDeviceSubClass = UDSUBCLASS_HUB, - .bDeviceProtocol = UDPROTO_HSHUBSTT, + .bDeviceProtocol = UDPROTO_FSHUB, .bMaxPacketSize = 64, .bcdDevice = {0x00, 0x01}, .iManufacturer = 1, @@ -1519,17 +1519,6 @@ static const struct usb_device_descripto .bNumConfigurations = 1, }; -static const struct usb_device_qualifier atmegadci_odevd = { - .bLength = sizeof(struct usb_device_qualifier), - .bDescriptorType = UDESC_DEVICE_QUALIFIER, - .bcdUSB = {0x00, 0x02}, - .bDeviceClass = UDCLASS_HUB, - .bDeviceSubClass = UDSUBCLASS_HUB, - .bDeviceProtocol = UDPROTO_FSHUB, - .bMaxPacketSize0 = 0, - .bNumConfigurations = 0, -}; - static const struct atmegadci_config_desc atmegadci_confd = { .confd = { .bLength = sizeof(struct usb_config_descriptor), @@ -1547,7 +1536,7 @@ static const struct atmegadci_config_des .bNumEndpoints = 1, .bInterfaceClass = UICLASS_HUB, .bInterfaceSubClass = UISUBCLASS_HUB, - .bInterfaceProtocol = UIPROTO_HSHUBSTT, + .bInterfaceProtocol = 0, }, .endpd = { .bLength = sizeof(struct usb_endpoint_descriptor), Modified: head/sys/dev/usb/controller/avr32dci.c ============================================================================== --- head/sys/dev/usb/controller/avr32dci.c Wed Oct 13 20:36:42 2010 (r213801) +++ head/sys/dev/usb/controller/avr32dci.c Wed Oct 13 20:37:19 2010 (r213802) @@ -1480,7 +1480,7 @@ static const struct avr32dci_config_desc .bNumEndpoints = 1, .bInterfaceClass = UICLASS_HUB, .bInterfaceSubClass = UISUBCLASS_HUB, - .bInterfaceProtocol = UIPROTO_HSHUBSTT, + .bInterfaceProtocol = 0, }, .endpd = { .bLength = sizeof(struct usb_endpoint_descriptor), Modified: head/sys/dev/usb/controller/musb_otg.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg.c Wed Oct 13 20:36:42 2010 (r213801) +++ head/sys/dev/usb/controller/musb_otg.c Wed Oct 13 20:37:19 2010 (r213802) @@ -2181,7 +2181,7 @@ static const struct musbotg_config_desc .bNumEndpoints = 1, .bInterfaceClass = UICLASS_HUB, .bInterfaceSubClass = UISUBCLASS_HUB, - .bInterfaceProtocol = UIPROTO_HSHUBSTT, + .bInterfaceProtocol = 0, }, .endpd = { .bLength = sizeof(struct usb_endpoint_descriptor), Modified: head/sys/dev/usb/controller/ohci.c ============================================================================== --- head/sys/dev/usb/controller/ohci.c Wed Oct 13 20:36:42 2010 (r213801) +++ head/sys/dev/usb/controller/ohci.c Wed Oct 13 20:37:19 2010 (r213802) @@ -2105,7 +2105,7 @@ struct ohci_config_desc ohci_confd = .bNumEndpoints = 1, .bInterfaceClass = UICLASS_HUB, .bInterfaceSubClass = UISUBCLASS_HUB, - .bInterfaceProtocol = UIPROTO_FSHUB, + .bInterfaceProtocol = 0, }, .endpd = { .bLength = sizeof(struct usb_endpoint_descriptor), Modified: head/sys/dev/usb/controller/uss820dci.c ============================================================================== --- head/sys/dev/usb/controller/uss820dci.c Wed Oct 13 20:36:42 2010 (r213801) +++ head/sys/dev/usb/controller/uss820dci.c Wed Oct 13 20:37:19 2010 (r213802) @@ -1740,7 +1740,7 @@ static const struct usb_device_descripto .bcdUSB = {0x00, 0x02}, .bDeviceClass = UDCLASS_HUB, .bDeviceSubClass = UDSUBCLASS_HUB, - .bDeviceProtocol = UDPROTO_HSHUBSTT, + .bDeviceProtocol = UDPROTO_FSHUB, .bMaxPacketSize = 64, .bcdDevice = {0x00, 0x01}, .iManufacturer = 1, @@ -1776,7 +1776,7 @@ static const struct uss820dci_config_des .bNumEndpoints = 1, .bInterfaceClass = UICLASS_HUB, .bInterfaceSubClass = UISUBCLASS_HUB, - .bInterfaceProtocol = UIPROTO_HSHUBSTT, + .bInterfaceProtocol = 0, }, .endpd = { From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 20:51:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BE01106564A; Wed, 13 Oct 2010 20:51:06 +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 6A9588FC08; Wed, 13 Oct 2010 20:51:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DKp6CW000359; Wed, 13 Oct 2010 20:51:06 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DKp6DT000357; Wed, 13 Oct 2010 20:51:06 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010132051.o9DKp6DT000357@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 13 Oct 2010 20:51:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213803 - head/sys/dev/usb/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 20:51:06 -0000 Author: hselasky Date: Wed Oct 13 20:51:06 2010 New Revision: 213803 URL: http://svn.freebsd.org/changeset/base/213803 Log: USB network (UHSO): - Correct network interface flags. PR: usb/149039 Submitted by: Fredrik Lindberg Approved by: thompsa (mentor) Modified: head/sys/dev/usb/net/uhso.c Modified: head/sys/dev/usb/net/uhso.c ============================================================================== --- head/sys/dev/usb/net/uhso.c Wed Oct 13 20:37:19 2010 (r213802) +++ head/sys/dev/usb/net/uhso.c Wed Oct 13 20:51:06 2010 (r213803) @@ -1560,7 +1560,7 @@ uhso_attach_ifnet(struct uhso_softc *sc, ifp->if_init = uhso_if_init; ifp->if_start = uhso_if_start; ifp->if_output = uhso_if_output; - ifp->if_flags = 0; + ifp->if_flags = IFF_BROADCAST | IFF_MULTICAST | IFF_NOARP; ifp->if_softc = sc; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 20:56:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAA5D1065673; Wed, 13 Oct 2010 20:56:54 +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 D96CE8FC21; Wed, 13 Oct 2010 20:56:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DKusVf000517; Wed, 13 Oct 2010 20:56:54 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DKuscn000515; Wed, 13 Oct 2010 20:56:54 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010132056.o9DKuscn000515@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 13 Oct 2010 20:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213804 - head/sys/dev/usb/wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 20:56:55 -0000 Author: hselasky Date: Wed Oct 13 20:56:54 2010 New Revision: 213804 URL: http://svn.freebsd.org/changeset/base/213804 Log: USB WLAN: - Add new device ID PR: usb/150989 Approved by: thompsa (mentor) Modified: head/sys/dev/usb/wlan/if_upgt.c Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Wed Oct 13 20:51:06 2010 (r213803) +++ head/sys/dev/usb/wlan/if_upgt.c Wed Oct 13 20:56:54 2010 (r213804) @@ -182,6 +182,7 @@ static const struct usb_device_id upgt_d UPGT_DEV(FSC, E5400), UPGT_DEV(GLOBESPAN, PRISM_GT_1), UPGT_DEV(GLOBESPAN, PRISM_GT_2), + UPGT_DEV(NETGEAR, WG111V2_2), UPGT_DEV(INTERSIL, PRISM_GT), UPGT_DEV(SMC, 2862WG), UPGT_DEV(USR, USR5422), From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 21:03:30 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id F06861065672; Wed, 13 Oct 2010 21:03:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Rui Paulo Date: Wed, 13 Oct 2010 17:03:03 -0400 User-Agent: KMail/1.6.2 References: <201010131439.o9DEdssc090571@svn.freebsd.org> <201010131546.10130.jkim@FreeBSD.org> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010131703.21145.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213779 - head/sys/dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 21:03:30 -0000 On Wednesday 13 October 2010 04:30 pm, you wrote: > I read the PR and the mailing list posts, but I don't see what > problem does "case SPICDS_TYPE_AK4381 || SPICDS_TYPE_AK4396:" fix. A similar bug for right channel was fixed by netchild@ in r188480: http://svn.freebsd.org/viewvc/base/head/sys/dev/sound/pci/spicds.c?view=log but he missed the left channel, which caused volume differences between the two channels. "In FreeBSD 7.2 it worked just like a charm but after upgrading to 8.0 the left stereo channel is only half as loud as the right one. It can be reproduced with either speakers and headphones. I tracked it down to a change in revision 188480 of spicds.c, the change "fix: stupid bug with volume control for AK4396" breaks volume control for me. http://lists.freebsd.org/pipermail/freebsd-multimedia/2009-December/010553.html Carl Johan Gustavsson submitted a correct patch: http://lists.freebsd.org/pipermail/freebsd-multimedia/2009-December/010558.html ariff@ said he would take it but I guess he never did: http://lists.freebsd.org/pipermail/freebsd-multimedia/2009-December/010575.html Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 21:17:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B72F106564A; Wed, 13 Oct 2010 21:17:15 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id E28588FC19; Wed, 13 Oct 2010 21:17:14 +0000 (UTC) Received: from d.earth.lavabit.com (d.earth.lavabit.com [192.168.111.13]) by karen.lavabit.com (Postfix) with ESMTP id 3AE13157557; Wed, 13 Oct 2010 16:17:14 -0500 (CDT) Received: from rui-macbook.lan (bl16-140-224.dsl.telepac.pt [188.81.140.224]) by lavabit.com with ESMTP id ZY7WKUGAGMQ8; Wed, 13 Oct 2010 16:17:14 -0500 References: <201010131439.o9DEdssc090571@svn.freebsd.org> <201010131546.10130.jkim@FreeBSD.org> <201010131703.21145.jkim@FreeBSD.org> In-Reply-To: <201010131703.21145.jkim@FreeBSD.org> Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii Message-Id: Content-Transfer-Encoding: quoted-printable From: Rui Paulo Date: Wed, 13 Oct 2010 22:17:10 +0100 To: Jung-uk Kim X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213779 - head/sys/dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 21:17:15 -0000 On 13 Oct 2010, at 22:03, Jung-uk Kim wrote: > On Wednesday 13 October 2010 04:30 pm, you wrote: >> I read the PR and the mailing list posts, but I don't see what >> problem does "case SPICDS_TYPE_AK4381 || SPICDS_TYPE_AK4396:" fix. >=20 > A similar bug for right channel was fixed by netchild@ in r188480: >=20 > = http://svn.freebsd.org/viewvc/base/head/sys/dev/sound/pci/spicds.c?view=3D= log >=20 > but he missed the left channel, which caused volume differences=20 > between the two channels. >=20 > "In FreeBSD 7.2 it worked just like a charm but after upgrading to 8.0 > the left stereo channel is only half as loud as the right one. It can=20= > be reproduced with either speakers and headphones. I tracked it down=20= > to a change in revision 188480 of spicds.c, the change "fix: stupid=20 > bug with volume control for AK4396" breaks volume control for me. >=20 > = http://lists.freebsd.org/pipermail/freebsd-multimedia/2009-December/010553= html >=20 > Carl Johan Gustavsson submitted a correct patch: >=20 > = http://lists.freebsd.org/pipermail/freebsd-multimedia/2009-December/010558= html >=20 > ariff@ said he would take it but I guess he never did: >=20 > = http://lists.freebsd.org/pipermail/freebsd-multimedia/2009-December/010575= html Oh, I read your previous email backwards. This explains it, thanks. = Guess we can close the PR now. Regards, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 21:36:43 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E922E1065672; Wed, 13 Oct 2010 21:36:42 +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 D53F88FC19; Wed, 13 Oct 2010 21:36:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DLagoS001502; Wed, 13 Oct 2010 21:36:42 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DLagFX001496; Wed, 13 Oct 2010 21:36:42 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010132136.o9DLagFX001496@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 13 Oct 2010 21:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213805 - in head/sys: conf dev/usb/net modules/usb modules/usb/ipheth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 21:36:43 -0000 Author: hselasky Date: Wed Oct 13 21:36:42 2010 New Revision: 213805 URL: http://svn.freebsd.org/changeset/base/213805 Log: USB Network: - Add new driver for iPhone tethering - Supports the iPhone 3G/3GS/4G ethernet protocol Approved by: thompsa (mentor) Added: head/sys/dev/usb/net/if_ipheth.c (contents, props changed) head/sys/dev/usb/net/if_iphethvar.h (contents, props changed) head/sys/modules/usb/ipheth/ head/sys/modules/usb/ipheth/Makefile (contents, props changed) Modified: head/sys/conf/files head/sys/modules/usb/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Oct 13 20:56:54 2010 (r213804) +++ head/sys/conf/files Wed Oct 13 21:36:42 2010 (r213805) @@ -1790,6 +1790,7 @@ dev/usb/net/if_aue.c optional aue dev/usb/net/if_axe.c optional axe dev/usb/net/if_cdce.c optional cdce dev/usb/net/if_cue.c optional cue +dev/usb/net/if_ipheth.c optional ipheth dev/usb/net/if_kue.c optional kue dev/usb/net/if_rue.c optional rue dev/usb/net/if_udav.c optional udav Added: head/sys/dev/usb/net/if_ipheth.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/net/if_ipheth.c Wed Oct 13 21:36:42 2010 (r213805) @@ -0,0 +1,528 @@ +/*- + * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2009 Diego Giagio. 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. + */ + +/* + * Thanks to Diego Giagio for figuring out the programming details for + * the Apple iPhone Ethernet driver. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "usbdevs.h" + +#define USB_DEBUG_VAR ipheth_debug +#include +#include + +#include +#include + +static device_probe_t ipheth_probe; +static device_attach_t ipheth_attach; +static device_detach_t ipheth_detach; + +static usb_callback_t ipheth_bulk_write_callback; +static usb_callback_t ipheth_bulk_read_callback; + +static uether_fn_t ipheth_attach_post; +static uether_fn_t ipheth_tick; +static uether_fn_t ipheth_init; +static uether_fn_t ipheth_stop; +static uether_fn_t ipheth_start; +static uether_fn_t ipheth_setmulti; +static uether_fn_t ipheth_setpromisc; + +#ifdef USB_DEBUG +static int ipheth_debug = 0; + +SYSCTL_NODE(_hw_usb, OID_AUTO, ipheth, CTLFLAG_RW, 0, "USB iPhone ethernet"); +SYSCTL_INT(_hw_usb_ipheth, OID_AUTO, debug, CTLFLAG_RW, &ipheth_debug, 0, "Debug level"); +#endif + +static const struct usb_config ipheth_config[IPHETH_N_TRANSFER] = { + + [IPHETH_BULK_RX] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_RX, + .frames = IPHETH_RX_FRAMES_MAX, + .bufsize = (IPHETH_RX_FRAMES_MAX * MCLBYTES), + .flags = {.short_frames_ok = 1,.short_xfer_ok = 1,.ext_buffer = 1,}, + .callback = ipheth_bulk_read_callback, + .timeout = 0, /* no timeout */ + }, + + [IPHETH_BULK_TX] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_TX, + .frames = IPHETH_TX_FRAMES_MAX, + .bufsize = (IPHETH_TX_FRAMES_MAX * IPHETH_BUF_SIZE), + .flags = {.force_short_xfer = 1,}, + .callback = ipheth_bulk_write_callback, + .timeout = IPHETH_TX_TIMEOUT, + }, +}; + +static device_method_t ipheth_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ipheth_probe), + DEVMETHOD(device_attach, ipheth_attach), + DEVMETHOD(device_detach, ipheth_detach), + + {0, 0} +}; + +static driver_t ipheth_driver = { + .name = "ipheth", + .methods = ipheth_methods, + .size = sizeof(struct ipheth_softc), +}; + +static devclass_t ipheth_devclass; + +DRIVER_MODULE(ipheth, uhub, ipheth_driver, ipheth_devclass, NULL, 0); +MODULE_VERSION(ipheth, 1); +MODULE_DEPEND(ipheth, uether, 1, 1, 1); +MODULE_DEPEND(ipheth, usb, 1, 1, 1); +MODULE_DEPEND(ipheth, ether, 1, 1, 1); + +static const struct usb_ether_methods ipheth_ue_methods = { + .ue_attach_post = ipheth_attach_post, + .ue_start = ipheth_start, + .ue_init = ipheth_init, + .ue_tick = ipheth_tick, + .ue_stop = ipheth_stop, + .ue_setmulti = ipheth_setmulti, + .ue_setpromisc = ipheth_setpromisc, +}; + +#define IPHETH_ID(v,p,c,sc,pt) \ + USB_VENDOR(v), USB_PRODUCT(p), \ + USB_IFACE_CLASS(c), USB_IFACE_SUBCLASS(sc), \ + USB_IFACE_PROTOCOL(pt) + +static const struct usb_device_id ipheth_devs[] = { + {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE, + IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, + IPHETH_USBINTF_PROTO)}, + {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_3G, + IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, + IPHETH_USBINTF_PROTO)}, + {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_3GS, + IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, + IPHETH_USBINTF_PROTO)}, + {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE_4, + IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, + IPHETH_USBINTF_PROTO)}, +}; + +static int +ipheth_get_mac_addr(struct ipheth_softc *sc) +{ + struct usb_device_request req; + int error; + + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = IPHETH_CMD_GET_MACADDR; + req.wValue[0] = 0; + req.wValue[1] = 0; + req.wIndex[0] = sc->sc_iface_no; + req.wIndex[1] = 0; + req.wLength[0] = ETHER_ADDR_LEN; + req.wLength[1] = 0; + + error = usbd_do_request(sc->sc_ue.ue_udev, NULL, &req, sc->sc_data); + + if (error) + return (error); + + memcpy(sc->sc_ue.ue_eaddr, sc->sc_data, ETHER_ADDR_LEN); + + return (0); +} + +static int +ipheth_probe(device_t dev) +{ + struct usb_attach_arg *uaa = device_get_ivars(dev); + + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(ipheth_devs, sizeof(ipheth_devs), uaa)); +} + +static int +ipheth_attach(device_t dev) +{ + struct ipheth_softc *sc = device_get_softc(dev); + struct usb_ether *ue = &sc->sc_ue; + struct usb_attach_arg *uaa = device_get_ivars(dev); + int error; + + sc->sc_iface_no = uaa->info.bIfaceIndex; + + device_set_usb_desc(dev); + + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + error = usbd_set_alt_interface_index(uaa->device, + uaa->info.bIfaceIndex, IPHETH_ALT_INTFNUM); + if (error) { + device_printf(dev, "Cannot set alternate setting\n"); + goto detach; + } + error = usbd_transfer_setup(uaa->device, &sc->sc_iface_no, + sc->sc_xfer, ipheth_config, IPHETH_N_TRANSFER, sc, &sc->sc_mtx); + if (error) { + device_printf(dev, "Cannot setup USB transfers\n"); + goto detach; + } + ue->ue_sc = sc; + ue->ue_dev = dev; + ue->ue_udev = uaa->device; + ue->ue_mtx = &sc->sc_mtx; + ue->ue_methods = &ipheth_ue_methods; + + error = ipheth_get_mac_addr(sc); + if (error) { + device_printf(dev, "Cannot get MAC address\n"); + goto detach; + } + + error = uether_ifattach(ue); + if (error) { + device_printf(dev, "could not attach interface\n"); + goto detach; + } + return (0); /* success */ + +detach: + ipheth_detach(dev); + return (ENXIO); /* failure */ +} + +static int +ipheth_detach(device_t dev) +{ + struct ipheth_softc *sc = device_get_softc(dev); + struct usb_ether *ue = &sc->sc_ue; + + /* stop all USB transfers first */ + usbd_transfer_unsetup(sc->sc_xfer, IPHETH_N_TRANSFER); + + uether_ifdetach(ue); + + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static void +ipheth_start(struct usb_ether *ue) +{ + struct ipheth_softc *sc = uether_getsc(ue); + + /* + * Start the USB transfers, if not already started: + */ + usbd_transfer_start(sc->sc_xfer[IPHETH_BULK_TX]); + usbd_transfer_start(sc->sc_xfer[IPHETH_BULK_RX]); +} + +static void +ipheth_stop(struct usb_ether *ue) +{ + struct ipheth_softc *sc = uether_getsc(ue); + + /* + * Stop the USB transfers, if not already stopped: + */ + usbd_transfer_stop(sc->sc_xfer[IPHETH_BULK_TX]); + usbd_transfer_stop(sc->sc_xfer[IPHETH_BULK_RX]); +} + +static void +ipheth_tick(struct usb_ether *ue) +{ + struct ipheth_softc *sc = uether_getsc(ue); + struct usb_device_request req; + int error; + + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = IPHETH_CMD_CARRIER_CHECK; + req.wValue[0] = 0; + req.wValue[1] = 0; + req.wIndex[0] = sc->sc_iface_no; + req.wIndex[1] = 0; + req.wLength[0] = IPHETH_CTRL_BUF_SIZE; + req.wLength[1] = 0; + + error = uether_do_request(ue, &req, sc->sc_data, IPHETH_CTRL_TIMEOUT); + + if (error) + return; + + sc->sc_carrier_on = + (sc->sc_data[0] == IPHETH_CARRIER_ON); +} + +static void +ipheth_attach_post(struct usb_ether *ue) +{ + +} + +static void +ipheth_init(struct usb_ether *ue) +{ + struct ipheth_softc *sc = uether_getsc(ue); + struct ifnet *ifp = uether_getifp(ue); + + IPHETH_LOCK_ASSERT(sc, MA_OWNED); + + ifp->if_drv_flags |= IFF_DRV_RUNNING; + + /* stall data write direction, which depends on USB mode */ + usbd_xfer_set_stall(sc->sc_xfer[IPHETH_BULK_TX]); + + /* start data transfers */ + ipheth_start(ue); +} + +static void +ipheth_setmulti(struct usb_ether *ue) +{ + +} + +static void +ipheth_setpromisc(struct usb_ether *ue) +{ + +} + +static void +ipheth_free_queue(struct mbuf **ppm, uint8_t n) +{ + uint8_t x; + + for (x = 0; x != n; x++) { + if (ppm[x] != NULL) { + m_freem(ppm[x]); + ppm[x] = NULL; + } + } +} + +static void +ipheth_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct ipheth_softc *sc = usbd_xfer_softc(xfer); + struct ifnet *ifp = uether_getifp(&sc->sc_ue); + struct usb_page_cache *pc; + struct mbuf *m; + uint8_t x; + int actlen; + int aframes; + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + DPRINTFN(1, "\n"); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + DPRINTFN(11, "transfer complete: %u bytes in %u frames\n", + actlen, aframes); + + ifp->if_opackets++; + + /* free all previous TX buffers */ + ipheth_free_queue(sc->sc_tx_buf, IPHETH_TX_FRAMES_MAX); + + /* FALLTHROUGH */ + case USB_ST_SETUP: +tr_setup: + for (x = 0; x != IPHETH_TX_FRAMES_MAX; x++) { + + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + + if (m == NULL) + break; + + usbd_xfer_set_frame_offset(xfer, + x * IPHETH_BUF_SIZE, x); + + pc = usbd_xfer_get_frame(xfer, x); + + sc->sc_tx_buf[x] = m; + + if (m->m_pkthdr.len > IPHETH_BUF_SIZE) + m->m_pkthdr.len = IPHETH_BUF_SIZE; + + usbd_m_copy_in(pc, 0, m, 0, m->m_pkthdr.len); + + usbd_xfer_set_frame_len(xfer, x, IPHETH_BUF_SIZE); + + if (IPHETH_BUF_SIZE != m->m_pkthdr.len) { + usbd_frame_zero(pc, m->m_pkthdr.len, + IPHETH_BUF_SIZE - m->m_pkthdr.len); + } + + /* + * If there's a BPF listener, bounce a copy of + * this frame to him: + */ + BPF_MTAP(ifp, m); + } + if (x != 0) { + usbd_xfer_set_frames(xfer, x); + + usbd_transfer_submit(xfer); + } + break; + + default: /* Error */ + DPRINTFN(11, "transfer error, %s\n", + usbd_errstr(error)); + + /* free all previous TX buffers */ + ipheth_free_queue(sc->sc_tx_buf, IPHETH_TX_FRAMES_MAX); + + /* count output errors */ + ifp->if_oerrors++; + + if (error != USB_ERR_CANCELLED) { + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + break; + } +} + +static void +ipheth_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct ipheth_softc *sc = usbd_xfer_softc(xfer); + struct mbuf *m; + uint8_t x; + int actlen; + int aframes; + int len; + + usbd_xfer_status(xfer, &actlen, NULL, &aframes, NULL); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + DPRINTF("received %u bytes in %u frames\n", actlen, aframes); + + for (x = 0; x != aframes; x++) { + + m = sc->sc_rx_buf[x]; + sc->sc_rx_buf[x] = NULL; + len = usbd_xfer_frame_len(xfer, x); + + if (len < (sizeof(struct ether_header) + + IPHETH_RX_ADJ)) { + m_freem(m); + continue; + } + + m_adj(m, IPHETH_RX_ADJ); + + /* queue up mbuf */ + uether_rxmbuf(&sc->sc_ue, m, len - IPHETH_RX_ADJ); + } + + /* FALLTHROUGH */ + case USB_ST_SETUP: + + for (x = 0; x != IPHETH_RX_FRAMES_MAX; x++) { + if (sc->sc_rx_buf[x] == NULL) { + m = uether_newbuf(); + if (m == NULL) + goto tr_stall; + + /* cancel alignment for ethernet */ + m_adj(m, ETHER_ALIGN); + + sc->sc_rx_buf[x] = m; + } else { + m = sc->sc_rx_buf[x]; + } + + usbd_xfer_set_frame_data(xfer, x, m->m_data, m->m_len); + } + /* set number of frames and start hardware */ + usbd_xfer_set_frames(xfer, x); + usbd_transfer_submit(xfer); + /* flush any received frames */ + uether_rxflush(&sc->sc_ue); + break; + + default: /* Error */ + DPRINTF("error = %s\n", usbd_errstr(error)); + + if (error != USB_ERR_CANCELLED) { + tr_stall: + /* try to clear stall first */ + usbd_xfer_set_stall(xfer); + usbd_xfer_set_frames(xfer, 0); + usbd_transfer_submit(xfer); + break; + } + /* need to free the RX-mbufs when we are cancelled */ + ipheth_free_queue(sc->sc_rx_buf, IPHETH_RX_FRAMES_MAX); + break; + } +} Added: head/sys/dev/usb/net/if_iphethvar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/net/if_iphethvar.h Wed Oct 13 21:36:42 2010 (r213805) @@ -0,0 +1,84 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2009 Diego Giagio. 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. + */ + +/* + * Thanks to Diego Giagio for figuring out the programming details for + * the Apple iPhone Ethernet driver. + */ + +#ifndef _IF_IPHETHVAR_H_ +#define _IF_IPHETHVAR_H_ + +#define IPHETH_USBINTF_CLASS 255 +#define IPHETH_USBINTF_SUBCLASS 253 +#define IPHETH_USBINTF_PROTO 1 + +#define IPHETH_BUF_SIZE 1516 +#define IPHETH_TX_TIMEOUT 5000 /* ms */ + +#define IPHETH_RX_FRAMES_MAX 1 +#define IPHETH_TX_FRAMES_MAX 8 + +#define IPHETH_RX_ADJ 2 + +#define IPHETH_CFG_INDEX 0 +#define IPHETH_IF_INDEX 2 +#define IPHETH_ALT_INTFNUM 1 + +#define IPHETH_CTRL_ENDP 0x00 +#define IPHETH_CTRL_BUF_SIZE 0x40 +#define IPHETH_CTRL_TIMEOUT 5000 /* ms */ + +#define IPHETH_CMD_GET_MACADDR 0x00 +#define IPHETH_CMD_CARRIER_CHECK 0x45 + +#define IPHETH_CARRIER_ON 0x04 + +enum { + IPHETH_BULK_TX, + IPHETH_BULK_RX, + IPHETH_N_TRANSFER, +}; + +struct ipheth_softc { + struct usb_ether sc_ue; + struct mtx sc_mtx; + + struct usb_xfer *sc_xfer[IPHETH_N_TRANSFER]; + struct mbuf *sc_rx_buf[IPHETH_RX_FRAMES_MAX]; + struct mbuf *sc_tx_buf[IPHETH_TX_FRAMES_MAX]; + + uint8_t sc_data[IPHETH_CTRL_BUF_SIZE]; + uint8_t sc_iface_no; + uint8_t sc_carrier_on; +}; + +#define IPHETH_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define IPHETH_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define IPHETH_LOCK_ASSERT(_sc, t) mtx_assert(&(_sc)->sc_mtx, t) + +#endif /* _IF_IPHETHVAR_H_ */ Modified: head/sys/modules/usb/Makefile ============================================================================== --- head/sys/modules/usb/Makefile Wed Oct 13 20:56:54 2010 (r213804) +++ head/sys/modules/usb/Makefile Wed Oct 13 21:36:42 2010 (r213805) @@ -31,7 +31,7 @@ SUBDIR += rum run uath upgt ural zyd ${_ SUBDIR += atp uhid ukbd ums udbp ufm SUBDIR += ucom u3g uark ubsa ubser uchcom ucycom ufoma uftdi ugensa uipaq ulpt \ umct umodem umoscom uplcom uslcom uvisor uvscom -SUBDIR += uether aue axe cdce cue kue rue udav uhso +SUBDIR += uether aue axe cdce cue kue rue udav uhso ipheth SUBDIR += usfs umass urio SUBDIR += quirk template Added: head/sys/modules/usb/ipheth/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/usb/ipheth/Makefile Wed Oct 13 21:36:42 2010 (r213805) @@ -0,0 +1,37 @@ +# +# $FreeBSD$ +# +# Copyright (c) 2010 Hans Petter Selasky. 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. +# + +S= ${.CURDIR}/../../.. + +.PATH: $S/dev/usb/net + +KMOD= if_ipheth +SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ + miibus_if.h opt_inet.h \ + if_ipheth.c + +.include From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 21:37:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A979106566C; Wed, 13 Oct 2010 21:37:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 566FA8FC08; Wed, 13 Oct 2010 21:37:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DLb3fM001559; Wed, 13 Oct 2010 21:37:03 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DLb3i4001543; Wed, 13 Oct 2010 21:37:03 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201010132137.o9DLb3i4001543@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 13 Oct 2010 21:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213806 - in head/sys/contrib/dev/acpica: . common compiler events include include/platform utilities X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 21:37:03 -0000 Author: jkim Date: Wed Oct 13 21:37:02 2010 New Revision: 213806 URL: http://svn.freebsd.org/changeset/base/213806 Log: Merge ACPICA 20101013. Added: head/sys/contrib/dev/acpica/compiler/aslmessages.h - copied unchanged from r213804, vendor-sys/acpica/dist/compiler/aslmessages.h Modified: head/sys/contrib/dev/acpica/acpica_prep.sh head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/compiler/aslanalyze.c head/sys/contrib/dev/acpica/compiler/aslcodegen.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslresource.c head/sys/contrib/dev/acpica/compiler/aslrestype1.c head/sys/contrib/dev/acpica/compiler/aslrestype1i.c head/sys/contrib/dev/acpica/compiler/aslrestype2d.c head/sys/contrib/dev/acpica/compiler/aslrestype2e.c head/sys/contrib/dev/acpica/compiler/aslrestype2q.c head/sys/contrib/dev/acpica/compiler/aslrestype2w.c head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dttemplate.c head/sys/contrib/dev/acpica/events/evxfregn.c head/sys/contrib/dev/acpica/include/acapps.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/platform/acenv.h head/sys/contrib/dev/acpica/osunixxf.c head/sys/contrib/dev/acpica/utilities/utglobal.c head/sys/contrib/dev/acpica/utilities/utids.c head/sys/contrib/dev/acpica/utilities/utosi.c Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- head/sys/contrib/dev/acpica/acpica_prep.sh Wed Oct 13 21:36:42 2010 (r213805) +++ head/sys/contrib/dev/acpica/acpica_prep.sh Wed Oct 13 21:37:02 2010 (r213806) @@ -22,8 +22,8 @@ fulldirs="common compiler debugger disas stripdirs="acpisrc acpixtract examples generate os_specific tests" stripfiles="Makefile README acintel.h aclinux.h acmsvc.h acnetbsd.h \ acos2.h accygwin.h acefi.h acwin.h acwin64.h aeexec.c \ - aehandlers.c aemain.c aetables.c osunixdir.c readme.txt \ - utclib.c" + aehandlers.c aemain.c aetables.c aetables.h osunixdir.c \ + readme.txt utclib.c" # include files to canonify src_headers="acapps.h accommon.h acconfig.h acdebug.h acdisasm.h \ @@ -33,8 +33,8 @@ src_headers="acapps.h accommon.h acconfi acresrc.h acrestyp.h acstruct.h actables.h actbl.h actbl1.h \ actbl2.h actypes.h acutils.h amlcode.h amlresrc.h \ platform/acenv.h platform/acfreebsd.h platform/acgcc.h" -comp_headers="aslcompiler.h asldefine.h aslglobal.h asltypes.h \ - dtcompiler.h dttemplate.h" +comp_headers="aslcompiler.h asldefine.h aslglobal.h aslmessages.h \ + asltypes.h dtcompiler.h dttemplate.h" platform_headers="acfreebsd.h acgcc.h" # pre-clean Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Wed Oct 13 21:36:42 2010 (r213805) +++ head/sys/contrib/dev/acpica/changes.txt Wed Oct 13 21:37:02 2010 (r213806) @@ -1,4 +1,64 @@ ---------------------------------------- +13 October 2010. Summary of changes for version 20101013: + +This release is available at www.acpica.org/downloads + +1) ACPI CA Core Subsystem: + +Added support to clear the PCIEXP_WAKE event. When clearing ACPI events, now +clear the PCIEXP_WAKE_STS bit in the ACPI PM1 Status Register, via +HwClearAcpiStatus. Original change from Colin King. ACPICA BZ 880. + +Changed the type of the predefined namespace object _TZ from ThermalZone to +Device. This was found to be confusing to the host software that processes +the various thermal zones, since _TZ is not really a ThermalZone. However, a +Notify() can still be performed on it. ACPICA BZ 876. Suggestion from Rui +Zhang. + +Added Windows Vista SP2 to the list of supported _OSI strings. The actual +string is "Windows 2006 SP2". + +Eliminated duplicate code in AcpiUtExecute* functions. Now that the nsrepair +code automatically repairs _HID-related strings, this type of code is no +longer needed in Execute_HID, Execute_CID, and Execute_UID. ACPICA BZ 878. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 6.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and has a +much larger code and data size. + + Previous Release: + Non-Debug Version: 89.9K Code, 19.0K Data, 108.9K Total + Debug Version: 166.3K Code, 52.1K Data, 218.4K Total + Current Release: + Non-Debug Version: 89.9K Code, 19.0K Data, 108.9K Total + Debug Version: 166.3K Code, 52.1K Data, 218.4K Total + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented additional compile-time validation for _HID strings. The +non-hex prefix (such as "PNP" or "ACPI") must be uppercase, and the length of +the string must be exactly seven or eight characters. For both _HID and _CID +strings, all characters must be alphanumeric. ACPICA BZ 874. + +iASL: Allow certain "null" resource descriptors. Some BIOS code creates +descriptors that are mostly or all zeros, with the expectation that they will +be filled in at runtime. iASL now allows this as long as there is a "resource +tag" (name) associated with the descriptor, which gives the ASL a handle +needed to modify the descriptor. ACPICA BZ 873. + +Added single-thread support to the generic Unix application OSL. Primarily +for iASL support, this change removes the use of semaphores in the single- +threaded ACPICA tools/applications - increasing performance. The +_MULTI_THREADED option was replaced by the (reverse) ACPI_SINGLE_THREADED +option. ACPICA BZ 879. + +AcpiExec: several fixes for the 64-bit version. Adds XSDT support and support +for 64-bit DSDT/FACS addresses in the FADT. Lin Ming. + +iASL: Moved all compiler messages to a new file, aslmessages.h. + +---------------------------------------- 15 September 2010. Summary of changes for version 20100915: This release is available at www.acpica.org/downloads Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Wed Oct 13 21:36:42 2010 (r213805) +++ head/sys/contrib/dev/acpica/common/adisasm.c Wed Oct 13 21:37:02 2010 (r213806) @@ -612,10 +612,10 @@ AdDisassemblerHeader ( /* Header and input table info */ - AcpiOsPrintf ("/*\n * Intel ACPI Component Architecture\n"); - AcpiOsPrintf (" * AML Disassembler version %8.8X\n", ACPI_CA_VERSION); + AcpiOsPrintf ("/*\n"); + AcpiOsPrintf (ACPI_COMMON_HEADER ("AML Disassembler", " * ")); - AcpiOsPrintf (" *\n * Disassembly of %s, %s", Filename, ctime (&Timer)); + AcpiOsPrintf (" * Disassembly of %s, %s", Filename, ctime (&Timer)); AcpiOsPrintf (" *\n"); } Modified: head/sys/contrib/dev/acpica/compiler/aslanalyze.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslanalyze.c Wed Oct 13 21:36:42 2010 (r213805) +++ head/sys/contrib/dev/acpica/compiler/aslanalyze.c Wed Oct 13 21:37:02 2010 (r213806) @@ -658,6 +658,95 @@ AnMapObjTypeToBtype ( /******************************************************************************* * + * FUNCTION: AnCheckId + * + * PARAMETERS: Op - Current parse op + * Type - HID or CID + * + * RETURN: None + * + * DESCRIPTION: Perform various checks on _HID and _CID strings. Only limited + * checks can be performed on _CID strings. + * + ******************************************************************************/ + +#define ASL_TYPE_HID 0 +#define ASL_TYPE_CID 1 +#include + +static void +AnCheckId ( + ACPI_PARSE_OBJECT *Op, + ACPI_NAME Type) +{ + UINT32 i; + ACPI_SIZE Length; + UINT32 AlphaPrefixLength; + + + if (Op->Asl.ParseOpcode != PARSEOP_STRING_LITERAL) + { + return; + } + + Length = strlen (Op->Asl.Value.String); + + /* + * If _HID/_CID is a string, all characters must be alphanumeric. + * One of the things we want to catch here is the use of + * a leading asterisk in the string -- an odd construct + * that certain platform manufacturers are fond of. + */ + for (i = 0; Op->Asl.Value.String[i]; i++) + { + if (!isalnum ((int) Op->Asl.Value.String[i])) + { + AslError (ASL_ERROR, ASL_MSG_ALPHANUMERIC_STRING, + Op, Op->Asl.Value.String); + break; + } + } + + if (Type == ASL_TYPE_CID) + { + /* _CID strings are bus-specific, no more checks can be performed */ + + return; + } + + /* _HID String must be of the form "XXX####" or "ACPI####" */ + + if ((Length < 7) || (Length > 8)) + { + AslError (ASL_ERROR, ASL_MSG_HID_LENGTH, + Op, Op->Asl.Value.String); + return; + } + + /* _HID Length is valid, now check for uppercase (first 3 or 4 chars) */ + + AlphaPrefixLength = 3; + if (Length >= 8) + { + AlphaPrefixLength = 4; + } + + /* Ensure the alphabetic prefix is all uppercase */ + + for (i = 0; (i < AlphaPrefixLength) && Op->Asl.Value.String[i]; i++) + { + if (!isupper ((int) Op->Asl.Value.String[i])) + { + AslError (ASL_ERROR, ASL_MSG_UPPER_CASE, + Op, &Op->Asl.Value.String[i]); + break; + } + } +} + + +/******************************************************************************* + * * FUNCTION: AnMethodAnalysisWalkBegin * * PARAMETERS: ASL_WALK_CALLBACK @@ -983,23 +1072,29 @@ AnMethodAnalysisWalkBegin ( if (!ACPI_STRCMP (METHOD_NAME__HID, Op->Asl.NameSeg)) { Next = Op->Asl.Child->Asl.Next; - if (Next->Asl.ParseOpcode == PARSEOP_STRING_LITERAL) + AnCheckId (Next, ASL_TYPE_HID); + } + + /* Special typechecking for _CID */ + + else if (!ACPI_STRCMP (METHOD_NAME__CID, Op->Asl.NameSeg)) + { + Next = Op->Asl.Child->Asl.Next; + + if ((Next->Asl.ParseOpcode == PARSEOP_PACKAGE) || + (Next->Asl.ParseOpcode == PARSEOP_VAR_PACKAGE)) { - /* - * _HID is a string, all characters must be alphanumeric. - * One of the things we want to catch here is the use of - * a leading asterisk in the string. - */ - for (i = 0; Next->Asl.Value.String[i]; i++) + Next = Next->Asl.Child; + while (Next) { - if (!isalnum ((int) Next->Asl.Value.String[i])) - { - AslError (ASL_ERROR, ASL_MSG_ALPHANUMERIC_STRING, - Next, Next->Asl.Value.String); - break; - } + AnCheckId (Next, ASL_TYPE_CID); + Next = Next->Asl.Next; } } + else + { + AnCheckId (Next, ASL_TYPE_CID); + } } break; Modified: head/sys/contrib/dev/acpica/compiler/aslcodegen.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcodegen.c Wed Oct 13 21:36:42 2010 (r213805) +++ head/sys/contrib/dev/acpica/compiler/aslcodegen.c Wed Oct 13 21:37:02 2010 (r213806) @@ -513,11 +513,11 @@ CgWriteTableHeader ( /* Compiler ID */ - strncpy (TableHeader.AslCompilerId, CompilerCreatorId, 4); + strncpy (TableHeader.AslCompilerId, ASL_CREATOR_ID, 4); /* Compiler version */ - TableHeader.AslCompilerRevision = CompilerCreatorRevision; + TableHeader.AslCompilerRevision = ASL_REVISION; /* Table length. Checksum zero for now, will rewrite later */ Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Oct 13 21:36:42 2010 (r213805) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Oct 13 21:37:02 2010 (r213806) @@ -117,6 +117,7 @@ #include #include #include +#include #define _COMPONENT ACPI_COMPILER ACPI_MODULE_NAME ("aslcompile") @@ -155,6 +156,7 @@ AslCompilerSignon ( UINT32 FileId) { char *Prefix = ""; + char *UtilityName; /* Set line prefix depending on the destination file type */ @@ -192,36 +194,21 @@ AslCompilerSignon ( break; } - /* - * Compiler signon with copyright - */ - FlPrintFile (FileId, - "%s\n%s%s\n%s", - Prefix, - Prefix, IntelAcpiCA, - Prefix); - /* Running compiler or disassembler? */ if (Gbl_DisasmFlag) { - FlPrintFile (FileId, - "%s", DisassemblerId); + UtilityName = AML_DISASSEMBLER_NAME; } else { - FlPrintFile (FileId, - "%s", CompilerId); + UtilityName = ASL_COMPILER_NAME; } - /* Version, copyright, compliance */ + /* Compiler signon with copyright */ - FlPrintFile (FileId, - " version %X\n%s%s\n%s%s\n%s\n", - (UINT32) ACPI_CA_VERSION, - Prefix, CompilerCopyright, - Prefix, CompilerCompliance, - Prefix); + FlPrintFile (FileId, "%s\n", Prefix); + FlPrintFile (FileId, ACPI_COMMON_HEADER (UtilityName, Prefix)); } Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Wed Oct 13 21:36:42 2010 (r213805) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Wed Oct 13 21:37:02 2010 (r213806) @@ -147,6 +147,7 @@ #include #include +#include #include @@ -795,7 +796,8 @@ RsSmallAddressCheck ( ACPI_PARSE_OBJECT *MinOp, ACPI_PARSE_OBJECT *MaxOp, ACPI_PARSE_OBJECT *LengthOp, - ACPI_PARSE_OBJECT *AlignOp); + ACPI_PARSE_OBJECT *AlignOp, + ACPI_PARSE_OBJECT *Op); void RsLargeAddressCheck ( @@ -807,7 +809,8 @@ RsLargeAddressCheck ( ACPI_PARSE_OBJECT *MinOp, ACPI_PARSE_OBJECT *MaxOp, ACPI_PARSE_OBJECT *LengthOp, - ACPI_PARSE_OBJECT *GranOp); + ACPI_PARSE_OBJECT *GranOp, + ACPI_PARSE_OBJECT *Op); UINT16 RsGetStringDataLength ( Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asldefine.h Wed Oct 13 21:36:42 2010 (r213805) +++ head/sys/contrib/dev/acpica/compiler/asldefine.h Wed Oct 13 21:37:02 2010 (r213806) @@ -122,15 +122,13 @@ /* * Compiler versions and names */ -#define CompilerCreatorRevision ACPI_CA_VERSION +#define ASL_REVISION ACPI_CA_VERSION +#define ASL_COMPILER_NAME "ASL Optimizing Compiler" +#define AML_DISASSEMBLER_NAME "AML Disassembler" +#define ASL_INVOCATION_NAME "iasl" +#define ASL_CREATOR_ID "INTL" -#define IntelAcpiCA "Intel ACPI Component Architecture" -#define CompilerId "ASL Optimizing Compiler" -#define DisassemblerId "AML Disassembler" -#define CompilerCopyright "Copyright (c) 2000 - 2010 Intel Corporation" -#define CompilerCompliance "Supports ACPI Specification Revision 4.0a" -#define CompilerName "iasl" -#define CompilerCreatorId "INTL" +#define ASL_COMPLIANCE "Supports ACPI Specification Revision 4.0a" /* Configuration constants */ Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Wed Oct 13 21:36:42 2010 (r213805) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Wed Oct 13 21:37:02 2010 (r213806) @@ -296,7 +296,8 @@ Usage ( void) { - printf ("Usage: %s [Options] [Files]\n\n", CompilerName); + printf ("%s\n", ASL_COMPLIANCE); + printf ("Usage: %s [Options] [Files]\n\n", ASL_INVOCATION_NAME); Options (); } @@ -903,7 +904,7 @@ AslCommandLine ( if (argc < 2) { - AslCompilerSignon (ASL_FILE_STDOUT); + printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME)); Usage (); exit (1); } @@ -934,7 +935,7 @@ AslCommandLine ( if (Gbl_DoSignon) { - AslCompilerSignon (ASL_FILE_STDOUT); + printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME)); } /* Abort if anything went wrong on the command line */ Copied: head/sys/contrib/dev/acpica/compiler/aslmessages.h (from r213804, vendor-sys/acpica/dist/compiler/aslmessages.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.h Wed Oct 13 21:37:02 2010 (r213806, copy of r213804, vendor-sys/acpica/dist/compiler/aslmessages.h) @@ -0,0 +1,436 @@ + +/****************************************************************************** + * + * Module Name: aslmessages.h - Compiler error/warning messages + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + + +#ifndef __ASLMESSAGES_H +#define __ASLMESSAGES_H + + +#define ASL_WARNING 0 +#define ASL_WARNING2 1 +#define ASL_WARNING3 2 +#define ASL_ERROR 3 +#define ASL_REMARK 4 +#define ASL_OPTIMIZATION 5 +#define ASL_NUM_REPORT_LEVELS 6 + + +/* Values for all compiler messages */ + +typedef enum +{ + ASL_MSG_RESERVED = 0, + ASL_MSG_ALPHANUMERIC_STRING, + ASL_MSG_AML_NOT_IMPLEMENTED, + ASL_MSG_ARG_COUNT_HI, + ASL_MSG_ARG_COUNT_LO, + ASL_MSG_ARG_INIT, + ASL_MSG_BACKWARDS_OFFSET, + ASL_MSG_BITS_TO_BYTES, + ASL_MSG_BUFFER_LENGTH, + ASL_MSG_BYTES_TO_BITS, + ASL_MSG_CLOSE, + ASL_MSG_COMPILER_INTERNAL, + ASL_MSG_CONSTANT_EVALUATION, + ASL_MSG_CONSTANT_FOLDED, + ASL_MSG_CORE_EXCEPTION, + ASL_MSG_DEBUG_FILE_OPEN, + ASL_MSG_DEBUG_FILENAME, + ASL_MSG_DEPENDENT_NESTING, + ASL_MSG_DMA_CHANNEL, + ASL_MSG_DMA_LIST, + ASL_MSG_DUPLICATE_CASE, + ASL_MSG_DUPLICATE_ITEM, + ASL_MSG_EARLY_EOF, + ASL_MSG_ENCODING_LENGTH, + ASL_MSG_EX_INTERRUPT_LIST, + ASL_MSG_EX_INTERRUPT_LIST_MIN, + ASL_MSG_EX_INTERRUPT_NUMBER, + ASL_MSG_FIELD_ACCESS_WIDTH, + ASL_MSG_FIELD_UNIT_ACCESS_WIDTH, + ASL_MSG_FIELD_UNIT_OFFSET, + ASL_MSG_INCLUDE_FILE_OPEN, + ASL_MSG_INPUT_FILE_OPEN, + ASL_MSG_INTEGER_LENGTH, + ASL_MSG_INTEGER_OPTIMIZATION, + ASL_MSG_INTERRUPT_LIST, + ASL_MSG_INTERRUPT_NUMBER, + ASL_MSG_INVALID_CONSTANT_OP, + ASL_MSG_INVALID_EISAID, + ASL_MSG_INVALID_ESCAPE, + ASL_MSG_INVALID_OPERAND, + ASL_MSG_INVALID_PERFORMANCE, + ASL_MSG_INVALID_PRIORITY, + ASL_MSG_INVALID_STRING, + ASL_MSG_INVALID_TARGET, + ASL_MSG_INVALID_TIME, + ASL_MSG_INVALID_TYPE, + ASL_MSG_INVALID_UUID, + ASL_MSG_LIST_LENGTH_LONG, + ASL_MSG_LIST_LENGTH_SHORT, + ASL_MSG_LISTING_FILE_OPEN, + ASL_MSG_LISTING_FILENAME, + ASL_MSG_LOCAL_INIT, + ASL_MSG_LONG_LINE, + ASL_MSG_MEMORY_ALLOCATION, + ASL_MSG_MISSING_ENDDEPENDENT, + ASL_MSG_MISSING_STARTDEPENDENT, + ASL_MSG_MULTIPLE_TYPES, + ASL_MSG_NAME_EXISTS, + ASL_MSG_NAME_OPTIMIZATION, + ASL_MSG_NESTED_COMMENT, + ASL_MSG_NO_CASES, + ASL_MSG_NO_RETVAL, + ASL_MSG_NO_WHILE, + ASL_MSG_NON_ASCII, + ASL_MSG_NOT_EXIST, + ASL_MSG_NOT_FOUND, + ASL_MSG_NOT_METHOD, + ASL_MSG_NOT_PARAMETER, + ASL_MSG_NOT_REACHABLE, + ASL_MSG_OPEN, + ASL_MSG_OUTPUT_FILE_OPEN, + ASL_MSG_OUTPUT_FILENAME, + ASL_MSG_PACKAGE_LENGTH, + ASL_MSG_READ, + ASL_MSG_RECURSION, + ASL_MSG_REGION_BUFFER_ACCESS, + ASL_MSG_REGION_BYTE_ACCESS, + ASL_MSG_RESERVED_ARG_COUNT_HI, + ASL_MSG_RESERVED_ARG_COUNT_LO, + ASL_MSG_RESERVED_METHOD, + ASL_MSG_RESERVED_OPERAND_TYPE, + ASL_MSG_RESERVED_RETURN_VALUE, + ASL_MSG_RESERVED_USE, + ASL_MSG_RESERVED_WORD, + ASL_MSG_RESOURCE_FIELD, + ASL_MSG_RESOURCE_INDEX, + ASL_MSG_RESOURCE_LIST, + ASL_MSG_RESOURCE_SOURCE, + ASL_MSG_RETURN_TYPES, + ASL_MSG_SCOPE_FWD_REF, + ASL_MSG_SCOPE_TYPE, + ASL_MSG_SEEK, + ASL_MSG_SINGLE_NAME_OPTIMIZATION, + ASL_MSG_SOME_NO_RETVAL, + ASL_MSG_SWITCH_TYPE, + ASL_MSG_SYNC_LEVEL, + ASL_MSG_SYNTAX, + ASL_MSG_TABLE_SIGNATURE, + ASL_MSG_TOO_MANY_TEMPS, + ASL_MSG_UNKNOWN_RESERVED_NAME, + ASL_MSG_UNREACHABLE_CODE, + ASL_MSG_UNSUPPORTED, + ASL_MSG_VENDOR_LIST, + ASL_MSG_WRITE, + ASL_MSG_MULTIPLE_DEFAULT, + ASL_MSG_TIMEOUT, + ASL_MSG_RESULT_NOT_USED, + ASL_MSG_NOT_REFERENCED, + ASL_MSG_NON_ZERO, + ASL_MSG_STRING_LENGTH, + ASL_MSG_SERIALIZED, + ASL_MSG_COMPILER_RESERVED, + ASL_MSG_NAMED_OBJECT_IN_WHILE, + ASL_MSG_LOCAL_OUTSIDE_METHOD, + ASL_MSG_ALIGNMENT, + ASL_MSG_ISA_ADDRESS, + ASL_MSG_INVALID_MIN_MAX, + ASL_MSG_INVALID_LENGTH, + ASL_MSG_INVALID_LENGTH_FIXED, + ASL_MSG_INVALID_GRANULARITY, + ASL_MSG_INVALID_GRAN_FIXED, + ASL_MSG_INVALID_ACCESS_SIZE, + ASL_MSG_INVALID_ADDR_FLAGS, + ASL_MSG_NULL_DESCRIPTOR, + ASL_MSG_UPPER_CASE, + ASL_MSG_HID_LENGTH, + ASL_MSG_INVALID_FIELD_NAME, + ASL_MSG_INTEGER_SIZE, + ASL_MSG_INVALID_HEX_INTEGER, + ASL_MSG_BUFFER_ELEMENT, + ASL_MSG_RESERVED_VALUE, + ASL_MSG_FLAG_VALUE, + ASL_MSG_ZERO_VALUE, + ASL_MSG_UNKNOWN_TABLE, + ASL_MSG_UNKNOWN_SUBTABLE, + ASL_MSG_OEM_TABLE + +} ASL_MESSAGE_IDS; + + +#ifdef ASL_EXCEPTIONS + +/* Actual message strings for each compiler message */ + +char *AslMessages [] = { +/* The zeroth message is reserved */ "", +/* ASL_MSG_ALPHANUMERIC_STRING */ "String must be entirely alphanumeric", +/* ASL_MSG_AML_NOT_IMPLEMENTED */ "Opcode is not implemented in compiler AML code generator", +/* ASL_MSG_ARG_COUNT_HI */ "Too many arguments", +/* ASL_MSG_ARG_COUNT_LO */ "Too few arguments", +/* ASL_MSG_ARG_INIT */ "Method argument is not initialized", +/* ASL_MSG_BACKWARDS_OFFSET */ "Invalid backwards offset", +/* ASL_MSG_BITS_TO_BYTES */ "Field offset is in bits, but a byte offset is required", +/* ASL_MSG_BUFFER_LENGTH */ "Effective AML buffer length is zero", +/* ASL_MSG_BYTES_TO_BITS */ "Field offset is in bytes, but a bit offset is required", +/* ASL_MSG_CLOSE */ "Could not close file", +/* ASL_MSG_COMPILER_INTERNAL */ "Internal compiler error", +/* ASL_MSG_CONSTANT_EVALUATION */ "Could not evaluate constant expression", +/* ASL_MSG_CONSTANT_FOLDED */ "Constant expression evaluated and reduced", +/* ASL_MSG_CORE_EXCEPTION */ "From ACPI CA Subsystem", +/* ASL_MSG_DEBUG_FILE_OPEN */ "Could not open debug file", +/* ASL_MSG_DEBUG_FILENAME */ "Could not create debug filename", +/* ASL_MSG_DEPENDENT_NESTING */ "Dependent function macros cannot be nested",\ +/* ASL_MSG_DMA_CHANNEL */ "Invalid DMA channel (must be 0-7)", +/* ASL_MSG_DMA_LIST */ "Too many DMA channels (8 max)", +/* ASL_MSG_DUPLICATE_CASE */ "Case value already specified", +/* ASL_MSG_DUPLICATE_ITEM */ "Duplicate value in list", +/* ASL_MSG_EARLY_EOF */ "Premature end-of-file reached", +/* ASL_MSG_ENCODING_LENGTH */ "Package length too long to encode", +/* ASL_MSG_EX_INTERRUPT_LIST */ "Too many interrupts (255 max)", +/* ASL_MSG_EX_INTERRUPT_LIST_MIN */ "Too few interrupts (1 minimum required)", +/* ASL_MSG_EX_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 32 bits)", +/* ASL_MSG_FIELD_ACCESS_WIDTH */ "Access width is greater than region size", +/* ASL_MSG_FIELD_UNIT_ACCESS_WIDTH */ "Access width of Field Unit extends beyond region limit", +/* ASL_MSG_FIELD_UNIT_OFFSET */ "Field Unit extends beyond region limit", +/* ASL_MSG_INCLUDE_FILE_OPEN */ "Could not open include file", +/* ASL_MSG_INPUT_FILE_OPEN */ "Could not open input file", +/* ASL_MSG_INTEGER_LENGTH */ "64-bit integer in 32-bit table, truncating", +/* ASL_MSG_INTEGER_OPTIMIZATION */ "Integer optimized to single-byte AML opcode", +/* ASL_MSG_INTERRUPT_LIST */ "Too many interrupts (16 max)", +/* ASL_MSG_INTERRUPT_NUMBER */ "Invalid interrupt number (must be 0-15)", +/* ASL_MSG_INVALID_CONSTANT_OP */ "Invalid operator in constant expression (not type 3/4/5)", +/* ASL_MSG_INVALID_EISAID */ "EISAID string must be of the form \"UUUXXXX\" (3 uppercase, 4 hex digits)", +/* ASL_MSG_INVALID_ESCAPE */ "Invalid or unknown escape sequence", +/* ASL_MSG_INVALID_OPERAND */ "Invalid operand", +/* ASL_MSG_INVALID_PERFORMANCE */ "Invalid performance/robustness value", +/* ASL_MSG_INVALID_PRIORITY */ "Invalid priority value", +/* ASL_MSG_INVALID_STRING */ "Invalid Hex/Octal Escape - Non-ASCII or NULL", +/* ASL_MSG_INVALID_TARGET */ "Target operand not allowed in constant expression", +/* ASL_MSG_INVALID_TIME */ "Time parameter too long (255 max)", +/* ASL_MSG_INVALID_TYPE */ "Invalid type", +/* ASL_MSG_INVALID_UUID */ "UUID string must be of the form \"aabbccdd-eeff-gghh-iijj-kkllmmnnoopp\"", +/* ASL_MSG_LIST_LENGTH_LONG */ "Initializer list longer than declared package length", +/* ASL_MSG_LIST_LENGTH_SHORT */ "Initializer list shorter than declared package length", +/* ASL_MSG_LISTING_FILE_OPEN */ "Could not open listing file", +/* ASL_MSG_LISTING_FILENAME */ "Could not create listing filename", +/* ASL_MSG_LOCAL_INIT */ "Method local variable is not initialized", +/* ASL_MSG_LONG_LINE */ "Splitting long input line", +/* ASL_MSG_MEMORY_ALLOCATION */ "Memory allocation failure", +/* ASL_MSG_MISSING_ENDDEPENDENT */ "Missing EndDependentFn() macro in dependent resource list", +/* ASL_MSG_MISSING_STARTDEPENDENT */ "Missing StartDependentFn() macro in dependent resource list", +/* ASL_MSG_MULTIPLE_TYPES */ "Multiple types", +/* ASL_MSG_NAME_EXISTS */ "Name already exists in scope", +/* ASL_MSG_NAME_OPTIMIZATION */ "NamePath optimized", +/* ASL_MSG_NESTED_COMMENT */ "Nested comment found", +/* ASL_MSG_NO_CASES */ "No Case statements under Switch", +/* ASL_MSG_NO_RETVAL */ "Called method returns no value", +/* ASL_MSG_NO_WHILE */ "No enclosing While statement", +/* ASL_MSG_NON_ASCII */ "Invalid characters found in file", +/* ASL_MSG_NOT_EXIST */ "Object does not exist", +/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from scope", +/* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke", +/* ASL_MSG_NOT_PARAMETER */ "Not a parameter, used as local only", +/* ASL_MSG_NOT_REACHABLE */ "Object is not accessible from this scope", +/* ASL_MSG_OPEN */ "Could not open file", +/* ASL_MSG_OUTPUT_FILE_OPEN */ "Could not open output AML file", +/* ASL_MSG_OUTPUT_FILENAME */ "Could not create output filename", +/* ASL_MSG_PACKAGE_LENGTH */ "Effective AML package length is zero", +/* ASL_MSG_READ */ "Could not read file", +/* ASL_MSG_RECURSION */ "Recursive method call", +/* ASL_MSG_REGION_BUFFER_ACCESS */ "Host Operation Region requires BufferAcc access", +/* ASL_MSG_REGION_BYTE_ACCESS */ "Host Operation Region requires ByteAcc access", +/* ASL_MSG_RESERVED_ARG_COUNT_HI */ "Reserved method has too many arguments", +/* ASL_MSG_RESERVED_ARG_COUNT_LO */ "Reserved method has too few arguments", +/* ASL_MSG_RESERVED_METHOD */ "Reserved name must be a control method", +/* ASL_MSG_RESERVED_OPERAND_TYPE */ "Invalid object type for reserved name", +/* ASL_MSG_RESERVED_RETURN_VALUE */ "Reserved method must return a value", +/* ASL_MSG_RESERVED_USE */ "Invalid use of reserved name", +/* ASL_MSG_RESERVED_WORD */ "Use of reserved name", +/* ASL_MSG_RESOURCE_FIELD */ "Resource field name cannot be used as a target", +/* ASL_MSG_RESOURCE_INDEX */ "Missing ResourceSourceIndex (required)", +/* ASL_MSG_RESOURCE_LIST */ "Too many resource items (internal error)", +/* ASL_MSG_RESOURCE_SOURCE */ "Missing ResourceSource string (required)", +/* ASL_MSG_RETURN_TYPES */ "Not all control paths return a value", +/* ASL_MSG_SCOPE_FWD_REF */ "Forward references from Scope operator not allowed", +/* ASL_MSG_SCOPE_TYPE */ "Existing object has invalid type for Scope operator", +/* ASL_MSG_SEEK */ "Could not seek file", +/* ASL_MSG_SINGLE_NAME_OPTIMIZATION */ "NamePath optimized to NameSeg (uses run-time search path)", +/* ASL_MSG_SOME_NO_RETVAL */ "Called method may not always return a value", +/* ASL_MSG_SWITCH_TYPE */ "Switch expression is not a static Integer/Buffer/String data type, defaulting to Integer", +/* ASL_MSG_SYNC_LEVEL */ "SyncLevel must be in the range 0-15", +/* ASL_MSG_SYNTAX */ "", +/* ASL_MSG_TABLE_SIGNATURE */ "Invalid Table Signature", +/* ASL_MSG_TOO_MANY_TEMPS */ "Method requires too many temporary variables (_T_x)", +/* ASL_MSG_UNKNOWN_RESERVED_NAME */ "Unknown reserved name", +/* ASL_MSG_UNREACHABLE_CODE */ "Statement is unreachable", +/* ASL_MSG_UNSUPPORTED */ "Unsupported feature", +/* ASL_MSG_VENDOR_LIST */ "Too many vendor data bytes (7 max)", +/* ASL_MSG_WRITE */ "Could not write file", +/* ASL_MSG_MULTIPLE_DEFAULT */ "More than one Default statement within Switch construct", +/* ASL_MSG_TIMEOUT */ "Possible operator timeout is ignored", +/* ASL_MSG_RESULT_NOT_USED */ "Result is not used, operator has no effect", +/* ASL_MSG_NOT_REFERENCED */ "Namespace object is not referenced", +/* ASL_MSG_NON_ZERO */ "Operand evaluates to zero", +/* ASL_MSG_STRING_LENGTH */ "String literal too long", +/* ASL_MSG_SERIALIZED */ "Control Method marked Serialized", +/* ASL_MSG_COMPILER_RESERVED */ "Use of compiler reserved name", +/* ASL_MSG_NAMED_OBJECT_IN_WHILE */ "Creating a named object in a While loop", +/* ASL_MSG_LOCAL_OUTSIDE_METHOD */ "Local or Arg used outside a control method", +/* ASL_MSG_ALIGNMENT */ "Must be a multiple of alignment/granularity value", +/* ASL_MSG_ISA_ADDRESS */ "Maximum 10-bit ISA address (0x3FF)", +/* ASL_MSG_INVALID_MIN_MAX */ "Address Min is greater than Address Max", +/* ASL_MSG_INVALID_LENGTH */ "Length is larger than Min/Max window", +/* ASL_MSG_INVALID_LENGTH_FIXED */ "Length is not equal to fixed Min/Max window", +/* ASL_MSG_INVALID_GRANULARITY */ "Granularity must be zero or a power of two minus one", +/* ASL_MSG_INVALID_GRAN_FIXED */ "Granularity must be zero for fixed Min/Max", +/* ASL_MSG_INVALID_ACCESS_SIZE */ "Invalid AccessSize (Maximum is 4 - QWord access)", +/* ASL_MSG_INVALID_ADDR_FLAGS */ "Invalid combination of Length and Min/Max fixed flags", +/* ASL_MSG_NULL_DESCRIPTOR */ "Min/Max/Length/Gran are all zero, but no resource tag", +/* ASL_MSG_UPPER_CASE */ "Non-hex letters must be upper case", +/* ASL_MSG_HID_LENGTH */ "_HID string must be exactly 7 or 8 characters", + +/* These messages are used by the data table compiler only */ + +/* ASL_MSG_INVALID_FIELD_NAME */ "Invalid Field Name", +/* ASL_MSG_INTEGER_SIZE */ "Integer too large for target", +/* ASL_MSG_INVALID_HEX_INTEGER */ "Invalid hex integer constant", +/* ASL_MSG_BUFFER_ELEMENT */ "Invalid element in buffer initializer list", +/* ASL_MSG_RESERVED_VALUE */ "Reserved field must be zero", +/* ASL_MSG_FLAG_VALUE */ "Flag value is too large", +/* ASL_MSG_ZERO_VALUE */ "Value must be non-zero", +/* ASL_MSG_UNKNOWN_TABLE */ "Unknown ACPI table signature", +/* ASL_MSG_UNKNOWN_SUBTABLE */ "Unknown subtable type", +/* ASL_MSG_OEM_TABLE */ "OEM table - unknown contents" + +}; + + +char *AslErrorLevel [ASL_NUM_REPORT_LEVELS] = { + "Warning ", + "Warning ", + "Warning ", + "Error ", + "Remark ", + "Optimize" +}; + +#define ASL_ERROR_LEVEL_LENGTH 8 /* Length of strings above */ + +#endif /* ASL_EXCEPTIONS */ + +#endif /* __ASLMESSAGES_H */ Modified: head/sys/contrib/dev/acpica/compiler/aslresource.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslresource.c Wed Oct 13 21:36:42 2010 (r213805) +++ head/sys/contrib/dev/acpica/compiler/aslresource.c Wed Oct 13 21:37:02 2010 (r213806) @@ -139,6 +139,7 @@ * NULL, means "zero value for alignment is * OK, and means 64K alignment" (for * Memory24 descriptor) + * Op - Parent Op for entire construct * * RETURN: None. Adds error messages to error log if necessary * @@ -158,7 +159,8 @@ RsSmallAddressCheck ( ACPI_PARSE_OBJECT *MinOp, ACPI_PARSE_OBJECT *MaxOp, ACPI_PARSE_OBJECT *LengthOp, - ACPI_PARSE_OBJECT *AlignOp) + ACPI_PARSE_OBJECT *AlignOp, + ACPI_PARSE_OBJECT *Op) { if (Gbl_NoResourceChecking) @@ -166,6 +168,34 @@ RsSmallAddressCheck ( return; } + /* + * Check for a so-called "null descriptor". These are descriptors that are + * created with most fields set to zero. The intent is that the descriptor + * will be updated/completed at runtime via a BufferField. + * + * If the descriptor does NOT have a resource tag, it cannot be referenced + * by a BufferField and we will flag this as an error. Conversely, if + * the descriptor has a resource tag, we will assume that a BufferField + * will be used to dynamically update it, so no error. + * + * A possible enhancement to this check would be to verify that in fact + * a BufferField is created using the resource tag, and perhaps even + * verify that a Store is performed to the BufferField. + * + * Note: for these descriptors, Alignment is allowed to be zero + */ + if (!Minimum && !Maximum && !Length) + { + if (!Op->Asl.ExternalName) + { + /* No resource tag. Descriptor is fixed and is also illegal */ + + AslError (ASL_ERROR, ASL_MSG_NULL_DESCRIPTOR, Op, NULL); + } + + return; + } + /* Special case for Memory24, values are compressed */ if (Type == ACPI_RESOURCE_NAME_MEMORY24) @@ -230,6 +260,7 @@ RsSmallAddressCheck ( * MaxOp - Original Op for Address Max * LengthOp - Original Op for address range * GranOp - Original Op for address granularity + * Op - Parent Op for entire construct * * RETURN: None. Adds error messages to error log if necessary * @@ -259,7 +290,8 @@ RsLargeAddressCheck ( ACPI_PARSE_OBJECT *MinOp, ACPI_PARSE_OBJECT *MaxOp, ACPI_PARSE_OBJECT *LengthOp, - ACPI_PARSE_OBJECT *GranOp) + ACPI_PARSE_OBJECT *GranOp, + ACPI_PARSE_OBJECT *Op) { if (Gbl_NoResourceChecking) @@ -267,6 +299,32 @@ RsLargeAddressCheck ( return; } + /* + * Check for a so-called "null descriptor". These are descriptors that are + * created with most fields set to zero. The intent is that the descriptor + * will be updated/completed at runtime via a BufferField. + * + * If the descriptor does NOT have a resource tag, it cannot be referenced + * by a BufferField and we will flag this as an error. Conversely, if + * the descriptor has a resource tag, we will assume that a BufferField + * will be used to dynamically update it, so no error. + * + * A possible enhancement to this check would be to verify that in fact + * a BufferField is created using the resource tag, and perhaps even + * verify that a Store is performed to the BufferField. + */ + if (!Minimum && !Maximum && !Length && !Granularity) + { + if (!Op->Asl.ExternalName) + { + /* No resource tag. Descriptor is fixed and is also illegal */ + + AslError (ASL_ERROR, ASL_MSG_NULL_DESCRIPTOR, Op, NULL); + } + + return; + } + /* Basic checks on Min/Max/Length */ if (Minimum > Maximum) Modified: head/sys/contrib/dev/acpica/compiler/aslrestype1.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype1.c Wed Oct 13 21:36:42 2010 (r213805) +++ head/sys/contrib/dev/acpica/compiler/aslrestype1.c Wed Oct 13 21:37:02 2010 (r213806) @@ -300,7 +300,7 @@ RsDoMemory24Descriptor ( Descriptor->Memory24.Maximum, Descriptor->Memory24.AddressLength, Descriptor->Memory24.Alignment, - MinOp, MaxOp, LengthOp, NULL); + MinOp, MaxOp, LengthOp, NULL, Op); return (Rnode); } @@ -408,7 +408,7 @@ RsDoMemory32Descriptor ( Descriptor->Memory32.Maximum, Descriptor->Memory32.AddressLength, Descriptor->Memory32.Alignment, - MinOp, MaxOp, LengthOp, AlignOp); + MinOp, MaxOp, LengthOp, AlignOp, Op); return (Rnode); } Modified: head/sys/contrib/dev/acpica/compiler/aslrestype1i.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype1i.c Wed Oct 13 21:36:42 2010 (r213805) +++ head/sys/contrib/dev/acpica/compiler/aslrestype1i.c Wed Oct 13 21:37:02 2010 (r213806) @@ -439,7 +439,7 @@ RsDoIoDescriptor ( Descriptor->Io.Maximum, Descriptor->Io.AddressLength, Descriptor->Io.Alignment, - MinOp, MaxOp, LengthOp, AlignOp); + MinOp, MaxOp, LengthOp, AlignOp, Op); return (Rnode); } Modified: head/sys/contrib/dev/acpica/compiler/aslrestype2d.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype2d.c Wed Oct 13 21:36:42 2010 (r213805) +++ head/sys/contrib/dev/acpica/compiler/aslrestype2d.c Wed Oct 13 21:37:02 2010 (r213806) @@ -352,7 +352,7 @@ RsDoDwordIoDescriptor ( (UINT64) Descriptor->Address32.AddressLength, (UINT64) Descriptor->Address32.Granularity, Descriptor->Address32.Flags, - MinOp, MaxOp, LengthOp, GranOp); + MinOp, MaxOp, LengthOp, GranOp, Op); Rnode->BufferLength = sizeof (AML_RESOURCE_ADDRESS32) + OptionIndex + StringLength; @@ -588,7 +588,7 @@ RsDoDwordMemoryDescriptor ( (UINT64) Descriptor->Address32.AddressLength, (UINT64) Descriptor->Address32.Granularity, Descriptor->Address32.Flags, - MinOp, MaxOp, LengthOp, GranOp); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 21:40:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 481E8106566B; Wed, 13 Oct 2010 21:40:31 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Rui Paulo Date: Wed, 13 Oct 2010 17:40:17 -0400 User-Agent: KMail/1.6.2 References: <201010131439.o9DEdssc090571@svn.freebsd.org> <201010131703.21145.jkim@FreeBSD.org> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010131740.23408.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213779 - head/sys/dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 21:40:32 -0000 On Wednesday 13 October 2010 05:17 pm, Rui Paulo wrote: > On 13 Oct 2010, at 22:03, Jung-uk Kim wrote: > > On Wednesday 13 October 2010 04:30 pm, you wrote: > >> I read the PR and the mailing list posts, but I don't see what > >> problem does "case SPICDS_TYPE_AK4381 || SPICDS_TYPE_AK4396:" > >> fix. > > > > A similar bug for right channel was fixed by netchild@ in > > r188480: > > > > http://svn.freebsd.org/viewvc/base/head/sys/dev/sound/pci/spicds. > >c?view=log > > > > but he missed the left channel, which caused volume differences > > between the two channels. > > > > "In FreeBSD 7.2 it worked just like a charm but after upgrading > > to 8.0 the left stereo channel is only half as loud as the right > > one. It can be reproduced with either speakers and headphones. I > > tracked it down to a change in revision 188480 of spicds.c, the > > change "fix: stupid bug with volume control for AK4396" breaks > > volume control for me. > > > > http://lists.freebsd.org/pipermail/freebsd-multimedia/2009-Decemb > >er/010553html > > > > Carl Johan Gustavsson submitted a correct patch: > > > > http://lists.freebsd.org/pipermail/freebsd-multimedia/2009-Decemb > >er/010558html > > > > ariff@ said he would take it but I guess he never did: > > > > http://lists.freebsd.org/pipermail/freebsd-multimedia/2009-Decemb > >er/010575html > > Oh, I read your previous email backwards. This explains it, thanks. :-) > Guess we can close the PR now. Yes, that's exactly what I wanted to tell you. Thanks! Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 21:45:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33E7C106566B; Wed, 13 Oct 2010 21:45:57 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 225C78FC0C; Wed, 13 Oct 2010 21:45:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DLjvDq001768; Wed, 13 Oct 2010 21:45:57 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DLjvT8001766; Wed, 13 Oct 2010 21:45:57 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201010132145.o9DLjvT8001766@svn.freebsd.org> From: Juli Mallett Date: Wed, 13 Oct 2010 21:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213807 - head/sys/mips/cavium/octe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 21:45:57 -0000 Author: jmallett Date: Wed Oct 13 21:45:56 2010 New Revision: 213807 URL: http://svn.freebsd.org/changeset/base/213807 Log: Keep polling at 50hz as long as link state is changing. Modified: head/sys/mips/cavium/octe/ethernet.c Modified: head/sys/mips/cavium/octe/ethernet.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet.c Wed Oct 13 21:37:02 2010 (r213806) +++ head/sys/mips/cavium/octe/ethernet.c Wed Oct 13 21:45:56 2010 (r213807) @@ -173,6 +173,7 @@ static void cvm_oct_update_link(void *co static void cvm_do_timer(void *arg) { static int port; + static int updated; if (port < CVMX_PIP_NUM_INPUT_PORTS) { if (cvm_oct_device[port]) { int queues_per_port; @@ -186,6 +187,7 @@ static void cvm_do_timer(void *arg) MDIO_UNLOCK(); if (priv->need_link_update) { + updated++; taskqueue_enqueue(cvm_oct_link_taskq, &priv->link_task); } } @@ -220,9 +222,19 @@ static void cvm_do_timer(void *arg) callout_reset(&cvm_oct_poll_timer, hz / 50, cvm_do_timer, NULL); } else { port = 0; - /* All ports have been polled. Start the next iteration through - the ports in one second */ - callout_reset(&cvm_oct_poll_timer, hz, cvm_do_timer, NULL); + /* If any updates were made in this run, continue iterating at + * 1/50th of a second, so that if a link has merely gone down + * temporarily (e.g. because of interface reinitialization) it + * will not be forced to stay down for an entire second. + */ + if (updated > 0) { + updated = 0; + callout_reset(&cvm_oct_poll_timer, hz / 50, cvm_do_timer, NULL); + } else { + /* All ports have been polled. Start the next iteration through + the ports in one second */ + callout_reset(&cvm_oct_poll_timer, hz, cvm_do_timer, NULL); + } } } From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 21:53:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7D0C1065670; Wed, 13 Oct 2010 21:53:37 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6A738FC13; Wed, 13 Oct 2010 21:53:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DLrbuV001956; Wed, 13 Oct 2010 21:53:37 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DLrbfU001954; Wed, 13 Oct 2010 21:53:37 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010132153.o9DLrbfU001954@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 13 Oct 2010 21:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213808 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 21:53:37 -0000 Author: yongari Date: Wed Oct 13 21:53:37 2010 New Revision: 213808 URL: http://svn.freebsd.org/changeset/base/213808 Log: Add more checks for resolved link speed in bge_miibus_statchg(). Link UP state could be reported first before actual completion of auto-negotiation. This change makes bge(4) reprogram BGE_MAC_MODE, BGE_TX_MODE and BGE_RX_MODE register only after controller got a valid link. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Wed Oct 13 21:45:56 2010 (r213807) +++ head/sys/dev/bge/if_bge.c Wed Oct 13 21:53:37 2010 (r213808) @@ -878,6 +878,29 @@ bge_miibus_statchg(device_t dev) sc = device_get_softc(dev); mii = device_get_softc(sc->bge_miibus); + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + sc->bge_link = 1; + break; + case IFM_1000_T: + case IFM_1000_SX: + case IFM_2500_SX: + if (sc->bge_asicrev != BGE_ASICREV_BCM5906) + sc->bge_link = 1; + else + sc->bge_link = 0; + break; + default: + sc->bge_link = 0; + break; + } + } else + sc->bge_link = 0; + if (sc->bge_link == 0) + return; BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_PORTMODE); if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX) @@ -5065,12 +5088,7 @@ bge_link_upd(struct bge_softc *sc) */ mii = device_get_softc(sc->bge_miibus); mii_pollstat(mii); - if (!sc->bge_link && mii->mii_media_status & IFM_ACTIVE && - IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { - bge_miibus_statchg(sc->bge_dev); - sc->bge_link = 1; - } else - sc->bge_link = 0; + bge_miibus_statchg(sc->bge_dev); } /* Clear the attention. */ From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 22:04:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06BAB106564A; Wed, 13 Oct 2010 22:04:56 +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 E7E598FC15; Wed, 13 Oct 2010 22:04:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DM4tYv002261; Wed, 13 Oct 2010 22:04:55 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DM4tWZ002257; Wed, 13 Oct 2010 22:04:55 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010132204.o9DM4tWZ002257@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 13 Oct 2010 22:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213809 - in head/sys/dev/usb: . net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 22:04:56 -0000 Author: hselasky Date: Wed Oct 13 22:04:55 2010 New Revision: 213809 URL: http://svn.freebsd.org/changeset/base/213809 Log: USB network (NCM driver): - correct the ethernet payload remainder which must be post-offseted by -14 bytes instead of 0 bytes. This is not very clearly defined in the NCM specification. - add development feature about limiting the maximum datagram count in each NCM payload. - zero-pad alignment data - add TX-interval tuning sysctl Approved by: thompsa (mentor) Modified: head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/net/if_cdcereg.h head/sys/dev/usb/usb_cdc.h Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Wed Oct 13 21:53:37 2010 (r213808) +++ head/sys/dev/usb/net/if_cdce.c Wed Oct 13 22:04:55 2010 (r213809) @@ -110,10 +110,13 @@ static uint32_t cdce_m_crc32(struct mbuf #ifdef USB_DEBUG static int cdce_debug = 0; +static int cdce_tx_interval = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, cdce, CTLFLAG_RW, 0, "USB CDC-Ethernet"); SYSCTL_INT(_hw_usb_cdce, OID_AUTO, debug, CTLFLAG_RW, &cdce_debug, 0, "Debug level"); +SYSCTL_INT(_hw_usb_cdce, OID_AUTO, interval, CTLFLAG_RW, &cdce_tx_interval, 0, + "NCM transmit interval in ms"); #endif static const struct usb_config cdce_config[CDCE_N_TRANSFER] = { @@ -192,7 +195,7 @@ static const struct usb_config cdce_ncm_ .if_index = 0, .frames = CDCE_NCM_TX_FRAMES_MAX, .bufsize = (CDCE_NCM_TX_FRAMES_MAX * CDCE_NCM_TX_MAXLEN), - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .flags = {.pipe_bof = 1,}, .callback = cdce_ncm_bulk_write_callback, .timeout = 10000, /* 10 seconds */ .usb_mode = USB_MODE_DUAL, /* both modes */ @@ -294,9 +297,22 @@ cdce_ncm_init(struct cdce_softc *sc) { struct usb_ncm_parameters temp; struct usb_device_request req; - uDWord value; + struct usb_ncm_func_descriptor *ufd; + uint8_t value[8]; int err; + ufd = usbd_find_descriptor(sc->sc_ue.ue_udev, NULL, + sc->sc_ifaces_index[1], UDESC_CS_INTERFACE, 0 - 1, + UCDC_NCM_FUNC_DESC_SUBTYPE, 0 - 1); + + /* verify length of NCM functional descriptor */ + if (ufd != NULL) { + if (ufd->bLength < sizeof(*ufd)) + ufd = NULL; + else + DPRINTFN(1, "Found NCM functional descriptor.\n"); + } + req.bmRequestType = UT_READ_CLASS_INTERFACE; req.bRequest = UCDC_NCM_GET_NTB_PARAMETERS; USETW(req.wValue, 0); @@ -317,17 +333,19 @@ cdce_ncm_init(struct cdce_softc *sc) sc->sc_ncm.tx_remainder = UGETW(temp.wNdpOutPayloadRemainder); sc->sc_ncm.tx_modulus = UGETW(temp.wNdpOutDivisor); sc->sc_ncm.tx_struct_align = UGETW(temp.wNdpOutAlignment); + sc->sc_ncm.tx_nframe = UGETW(temp.wNtbOutMaxDatagrams); } else { sc->sc_ncm.rx_max = UGETDW(temp.dwNtbOutMaxSize); sc->sc_ncm.tx_max = UGETDW(temp.dwNtbInMaxSize); sc->sc_ncm.tx_remainder = UGETW(temp.wNdpInPayloadRemainder); sc->sc_ncm.tx_modulus = UGETW(temp.wNdpInDivisor); sc->sc_ncm.tx_struct_align = UGETW(temp.wNdpInAlignment); + sc->sc_ncm.tx_nframe = UGETW(temp.wNtbOutMaxDatagrams); } /* Verify maximum receive length */ - if (err || (sc->sc_ncm.rx_max < 32) || + if ((sc->sc_ncm.rx_max < 32) || (sc->sc_ncm.rx_max > CDCE_NCM_RX_MAXLEN)) { DPRINTFN(1, "Using default maximum receive length\n"); sc->sc_ncm.rx_max = CDCE_NCM_RX_MAXLEN; @@ -335,7 +353,7 @@ cdce_ncm_init(struct cdce_softc *sc) /* Verify maximum transmit length */ - if (err || (sc->sc_ncm.tx_max < 32) || + if ((sc->sc_ncm.tx_max < 32) || (sc->sc_ncm.tx_max > CDCE_NCM_TX_MAXLEN)) { DPRINTFN(1, "Using default maximum transmit length\n"); sc->sc_ncm.tx_max = CDCE_NCM_TX_MAXLEN; @@ -347,7 +365,7 @@ cdce_ncm_init(struct cdce_softc *sc) * - not greater than the maximum transmit length * - not less than four bytes */ - if (err || (sc->sc_ncm.tx_struct_align < 4) || + if ((sc->sc_ncm.tx_struct_align < 4) || (sc->sc_ncm.tx_struct_align != ((-sc->sc_ncm.tx_struct_align) & sc->sc_ncm.tx_struct_align)) || (sc->sc_ncm.tx_struct_align >= sc->sc_ncm.tx_max)) { @@ -361,7 +379,7 @@ cdce_ncm_init(struct cdce_softc *sc) * - not greater than the maximum transmit length * - not less than four bytes */ - if (err || (sc->sc_ncm.tx_modulus < 4) || + if ((sc->sc_ncm.tx_modulus < 4) || (sc->sc_ncm.tx_modulus != ((-sc->sc_ncm.tx_modulus) & sc->sc_ncm.tx_modulus)) || (sc->sc_ncm.tx_modulus >= sc->sc_ncm.tx_max)) { @@ -371,11 +389,30 @@ cdce_ncm_init(struct cdce_softc *sc) /* Verify that the payload remainder */ - if (err || (sc->sc_ncm.tx_remainder >= sc->sc_ncm.tx_modulus)) { + if ((sc->sc_ncm.tx_remainder >= sc->sc_ncm.tx_modulus)) { DPRINTFN(1, "Using default transmit remainder: 0 bytes\n"); sc->sc_ncm.tx_remainder = 0; } + /* + * Offset the TX remainder so that IP packet payload starts at + * the tx_modulus. This is not too clear in the specification. + */ + + sc->sc_ncm.tx_remainder = + (sc->sc_ncm.tx_remainder - ETHER_HDR_LEN) & + (sc->sc_ncm.tx_modulus - 1); + + /* Verify max datagrams */ + + if (sc->sc_ncm.tx_nframe == 0 || + sc->sc_ncm.tx_nframe > (CDCE_NCM_SUBFRAMES_MAX - 1)) { + DPRINTFN(1, "Using default max " + "subframes: %u units\n", CDCE_NCM_SUBFRAMES_MAX - 1); + /* need to reserve one entry for zero padding */ + sc->sc_ncm.tx_nframe = (CDCE_NCM_SUBFRAMES_MAX - 1); + } + /* Additional configuration, will fail in device side mode, which is OK. */ req.bmRequestType = UT_WRITE_CLASS_INTERFACE; @@ -383,8 +420,17 @@ cdce_ncm_init(struct cdce_softc *sc) USETW(req.wValue, 0); req.wIndex[0] = sc->sc_ifaces_index[1]; req.wIndex[1] = 0; - USETW(req.wLength, 4); - USETDW(value, sc->sc_ncm.rx_max); + + if (ufd != NULL && + (ufd->bmNetworkCapabilities & UCDC_NCM_CAP_MAX_DGRAM)) { + USETW(req.wLength, 8); + USETDW(value, sc->sc_ncm.rx_max); + USETW(value + 4, (CDCE_NCM_SUBFRAMES_MAX - 1)); + USETW(value + 6, 0); + } else { + USETW(req.wLength, 4); + USETDW(value, sc->sc_ncm.rx_max); + } err = usbd_do_request_flags(sc->sc_ue.ue_udev, NULL, &req, &value, 0, NULL, 1000 /* ms */); @@ -567,7 +613,7 @@ alloc_transfers: } else { - bzero(sc->sc_ue.ue_eaddr, sizeof(sc->sc_ue.ue_eaddr)); + memset(sc->sc_ue.ue_eaddr, 0, sizeof(sc->sc_ue.ue_eaddr)); for (i = 0; i != (ETHER_ADDR_LEN * 2); i++) { @@ -983,6 +1029,18 @@ cdce_handle_request(device_t dev, } #if CDCE_HAVE_NCM +static void +cdce_ncm_tx_zero(struct usb_page_cache *pc, + uint32_t start, uint32_t end) +{ + if (start >= CDCE_NCM_TX_MAXLEN) + return; + if (end > CDCE_NCM_TX_MAXLEN) + end = CDCE_NCM_TX_MAXLEN; + + usbd_frame_zero(pc, start, end - start); +} + static uint8_t cdce_ncm_fill_tx_frames(struct usb_xfer *xfer, uint8_t index) { @@ -993,7 +1051,8 @@ cdce_ncm_fill_tx_frames(struct usb_xfer uint32_t rem; uint32_t offset; uint32_t last_offset; - uint32_t n; + uint16_t n; + uint8_t retval; usbd_xfer_set_frame_offset(xfer, index * CDCE_NCM_TX_MAXLEN, index); @@ -1003,11 +1062,17 @@ cdce_ncm_fill_tx_frames(struct usb_xfer /* Store last valid offset before alignment */ last_offset = offset; - /* Align offset correctly */ - offset = sc->sc_ncm.tx_remainder - - ((0UL - offset) & (0UL - sc->sc_ncm.tx_modulus)); + /* Align offset */ + offset = CDCE_NCM_ALIGN(sc->sc_ncm.tx_remainder, + offset, sc->sc_ncm.tx_modulus); - for (n = 0; n != CDCE_NCM_SUBFRAMES_MAX; n++) { + /* Zero pad */ + cdce_ncm_tx_zero(pc, last_offset, offset); + + /* buffer full */ + retval = 2; + + for (n = 0; n != sc->sc_ncm.tx_nframe; n++) { /* check if end of transmit buffer is reached */ @@ -1020,8 +1085,11 @@ cdce_ncm_fill_tx_frames(struct usb_xfer IFQ_DRV_DEQUEUE(&(ifp->if_snd), m); - if (m == NULL) + if (m == NULL) { + /* buffer not full */ + retval = 1; break; + } if (m->m_pkthdr.len > rem) { if (n == 0) { @@ -1047,9 +1115,12 @@ cdce_ncm_fill_tx_frames(struct usb_xfer /* Store last valid offset before alignment */ last_offset = offset; - /* Align offset correctly */ - offset = sc->sc_ncm.tx_remainder - - ((0UL - offset) & (0UL - sc->sc_ncm.tx_modulus)); + /* Align offset */ + offset = CDCE_NCM_ALIGN(sc->sc_ncm.tx_remainder, + offset, sc->sc_ncm.tx_modulus); + + /* Zero pad */ + cdce_ncm_tx_zero(pc, last_offset, offset); /* * If there's a BPF listener, bounce a copy @@ -1067,7 +1138,7 @@ cdce_ncm_fill_tx_frames(struct usb_xfer } if (n == 0) - return (1); + return (0); rem = (sizeof(sc->sc_ncm.dpt) + (4 * n) + 4); @@ -1079,8 +1150,22 @@ cdce_ncm_fill_tx_frames(struct usb_xfer USETW(sc->sc_ncm.dp[n].wFrameIndex, 0); } + offset = last_offset; + + /* Align offset */ + offset = CDCE_NCM_ALIGN(0, offset, CDCE_NCM_TX_MINLEN); + + /* Optimise, save bandwidth and force short termination */ + if (offset >= sc->sc_ncm.tx_max) + offset = sc->sc_ncm.tx_max; + else + offset ++; + + /* Zero pad */ + cdce_ncm_tx_zero(pc, last_offset, offset); + /* set frame length */ - usbd_xfer_set_frame_len(xfer, index, last_offset); + usbd_xfer_set_frame_len(xfer, index, offset); /* Fill out 16-bit header */ sc->sc_ncm.hdr.dwSignature[0] = 'N'; @@ -1088,7 +1173,7 @@ cdce_ncm_fill_tx_frames(struct usb_xfer sc->sc_ncm.hdr.dwSignature[2] = 'M'; sc->sc_ncm.hdr.dwSignature[3] = 'H'; USETW(sc->sc_ncm.hdr.wHeaderLength, sizeof(sc->sc_ncm.hdr)); - USETW(sc->sc_ncm.hdr.wBlockLength, last_offset); + USETW(sc->sc_ncm.hdr.wBlockLength, offset); USETW(sc->sc_ncm.hdr.wSequence, sc->sc_ncm.tx_seq); USETW(sc->sc_ncm.hdr.wDptIndex, sizeof(sc->sc_ncm.hdr)); @@ -1106,7 +1191,7 @@ cdce_ncm_fill_tx_frames(struct usb_xfer sizeof(sc->sc_ncm.dpt)); usbd_copy_in(pc, sizeof(sc->sc_ncm.hdr) + sizeof(sc->sc_ncm.dpt), &(sc->sc_ncm.dp), sizeof(sc->sc_ncm.dp)); - return (0); + return (retval); } static void @@ -1115,6 +1200,7 @@ cdce_ncm_bulk_write_callback(struct usb_ struct cdce_softc *sc = usbd_xfer_softc(xfer); struct ifnet *ifp = uether_getifp(&sc->sc_ue); uint16_t x; + uint8_t temp; int actlen; int aframes; @@ -1128,11 +1214,19 @@ cdce_ncm_bulk_write_callback(struct usb_ case USB_ST_SETUP: for (x = 0; x != CDCE_NCM_TX_FRAMES_MAX; x++) { - if (cdce_ncm_fill_tx_frames(xfer, x)) + temp = cdce_ncm_fill_tx_frames(xfer, x); + if (temp == 0) + break; + if (temp == 1) { + x++; break; + } } if (x != 0) { +#ifdef USB_DEBUG + usbd_xfer_set_interval(xfer, cdce_tx_interval); +#endif usbd_xfer_set_frames(xfer, x); usbd_transfer_submit(xfer); } Modified: head/sys/dev/usb/net/if_cdcereg.h ============================================================================== --- head/sys/dev/usb/net/if_cdcereg.h Wed Oct 13 21:53:37 2010 (r213808) +++ head/sys/dev/usb/net/if_cdcereg.h Wed Oct 13 22:04:55 2010 (r213809) @@ -38,7 +38,8 @@ #define CDCE_FRAMES_MAX 8 /* units */ #define CDCE_IND_SIZE_MAX 32 /* bytes */ -#define CDCE_NCM_TX_MAXLEN 2048UL /* bytes */ +#define CDCE_NCM_TX_MINLEN 512 /* bytes, must be power of two */ +#define CDCE_NCM_TX_MAXLEN (1UL << 14) /* bytes */ #define CDCE_NCM_TX_FRAMES_MAX 8 /* units */ #define CDCE_NCM_RX_MAXLEN (1UL << 14) /* bytes */ @@ -46,6 +47,10 @@ #define CDCE_NCM_SUBFRAMES_MAX 32 /* units */ +#define CDCE_NCM_ALIGN(rem,off,mod) \ + ((uint32_t)(((uint32_t)(rem)) - \ + ((uint32_t)((-(uint32_t)(off)) & (-(uint32_t)(mod)))))) + #ifndef CDCE_HAVE_NCM #define CDCE_HAVE_NCM 1 #endif @@ -68,6 +73,7 @@ struct cdce_ncm { uint16_t tx_modulus; uint16_t tx_struct_align; uint16_t tx_seq; + uint16_t tx_nframe; }; struct cdce_softc { Modified: head/sys/dev/usb/usb_cdc.h ============================================================================== --- head/sys/dev/usb/usb_cdc.h Wed Oct 13 21:53:37 2010 (r213808) +++ head/sys/dev/usb/usb_cdc.h Wed Oct 13 22:04:55 2010 (r213809) @@ -241,6 +241,7 @@ struct usb_ncm_func_descriptor { #define UCDC_NCM_CAP_ENCAP 0x04 #define UCDC_NCM_CAP_MAX_DATA 0x08 #define UCDC_NCM_CAP_CRCMODE 0x10 +#define UCDC_NCM_CAP_MAX_DGRAM 0x20 } __packed; /* Communications interface specific class request codes */ @@ -276,7 +277,7 @@ struct usb_ncm_parameters { uWord wNdpOutDivisor; uWord wNdpOutPayloadRemainder; uWord wNdpOutAlignment; - uWord wReserved26; + uWord wNtbOutMaxDatagrams; } __packed; /* Communications interface specific class notification codes */ From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 22:07:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39B78106566B; Wed, 13 Oct 2010 22:07:58 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28A3D8FC08; Wed, 13 Oct 2010 22:07:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DM7wXr002368; Wed, 13 Oct 2010 22:07:58 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DM7wcH002366; Wed, 13 Oct 2010 22:07:58 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201010132207.o9DM7wcH002366@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 13 Oct 2010 22:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213810 - head/sbin/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 22:07:58 -0000 Author: luigi Date: Wed Oct 13 22:07:57 2010 New Revision: 213810 URL: http://svn.freebsd.org/changeset/base/213810 Log: document logging through bpf Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Wed Oct 13 22:04:55 2010 (r213809) +++ head/sbin/ipfw/ipfw.8 Wed Oct 13 22:07:57 2010 (r213810) @@ -557,28 +557,33 @@ packet delivery. Note: this condition is checked before any other condition, including ones such as keep-state or check-state which might have side effects. .It Cm log Op Cm logamount Ar number -When a packet matches a rule with the +Packets matching a rule with the .Cm log -keyword, a message will be -logged to +keyword will be made available for logging in two ways: +if the sysctl variable +.Va net.inet.ip.fw.verbose +is set to 0 (default), one can use +.Xr bpf 4 +attached to the +.Xr ipfw0 +pseudo interface. There is no overhead if no +.Xr bpf +is attached to the pseudo interface. +.Pp +If +.Va net.inet.ip.fw.verbose +is set to 1, packets will be logged to .Xr syslogd 8 with a .Dv LOG_SECURITY -facility. -The logging only occurs if the sysctl variable -.Va net.inet.ip.fw.verbose -is set to 1 -(which is the default when the kernel is compiled with -.Dv IPFIREWALL_VERBOSE ) -and the number of packets logged so far for that -particular rule does not exceed the +facility up to a maximum of .Cm logamount -parameter. +packets. If no .Cm logamount is specified, the limit is taken from the sysctl variable .Va net.inet.ip.fw.verbose_limit . -In both cases, a value of 0 removes the logging limit. +In both cases, a value of 0 means unlimited logging. .Pp Once the limit is reached, logging can be re-enabled by clearing the logging counter or the packet counter for that entry, see the From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 22:18:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 404EA106564A; Wed, 13 Oct 2010 22:18:04 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DCDF8FC0A; Wed, 13 Oct 2010 22:18:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DMI43x002711; Wed, 13 Oct 2010 22:18:04 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DMI3Vb002693; Wed, 13 Oct 2010 22:18:03 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010132218.o9DMI3Vb002693@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 13 Oct 2010 22:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213811 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 22:18:04 -0000 Author: obrien Date: Wed Oct 13 22:18:03 2010 New Revision: 213811 URL: http://svn.freebsd.org/changeset/base/213811 Log: In the spirit of r90111, depend on c89 and remove the "STATIC" macro and its usage. Modified: head/bin/sh/Makefile head/bin/sh/alias.c head/bin/sh/cd.c head/bin/sh/error.c head/bin/sh/eval.c head/bin/sh/exec.c head/bin/sh/expand.c head/bin/sh/histedit.c head/bin/sh/input.c head/bin/sh/jobs.c head/bin/sh/main.c head/bin/sh/memalloc.c head/bin/sh/nodes.c.pat head/bin/sh/options.c head/bin/sh/output.c head/bin/sh/parser.c head/bin/sh/redir.c head/bin/sh/shell.h head/bin/sh/show.c head/bin/sh/trap.c head/bin/sh/var.c Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Wed Oct 13 22:07:57 2010 (r213810) +++ head/bin/sh/Makefile Wed Oct 13 22:18:03 2010 (r213811) @@ -21,7 +21,7 @@ LDADD= -ll -ledit -ltermcap LFLAGS= -8 # 8-bit lex scanner for arithmetic CFLAGS+=-DSHELL -I. -I${.CURDIR} # for debug: -# DEBUG_FLAGS+= -g -DDEBUG=3 -fno-inline +# DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline WARNS?= 2 WFORMAT=0 Modified: head/bin/sh/alias.c ============================================================================== --- head/bin/sh/alias.c Wed Oct 13 22:07:57 2010 (r213810) +++ head/bin/sh/alias.c Wed Oct 13 22:18:03 2010 (r213811) @@ -52,11 +52,11 @@ __FBSDID("$FreeBSD$"); static struct alias *atab[ATABSIZE]; static int aliases; -STATIC void setalias(const char *, const char *); -STATIC int unalias(const char *); -STATIC struct alias **hashalias(const char *); +static void setalias(const char *, const char *); +static int unalias(const char *); +static struct alias **hashalias(const char *); -STATIC +static void setalias(const char *name, const char *val) { @@ -111,7 +111,7 @@ setalias(const char *name, const char *v INTON; } -STATIC int +static int unalias(const char *name) { struct alias *ap, **app; @@ -191,7 +191,7 @@ lookupalias(const char *name, int check) return (NULL); } -STATIC int +static int comparealiases(const void *p1, const void *p2) { const struct alias *const *a1 = p1; @@ -200,7 +200,7 @@ comparealiases(const void *p1, const voi return strcmp((*a1)->name, (*a2)->name); } -STATIC void +static void printalias(const struct alias *a) { char *p; @@ -214,7 +214,7 @@ printalias(const struct alias *a) out1c('\n'); } -STATIC void +static void printaliases(void) { int i, j; @@ -276,7 +276,7 @@ unaliascmd(int argc __unused, char **arg return (i); } -STATIC struct alias ** +static struct alias ** hashalias(const char *p) { unsigned int hashval; Modified: head/bin/sh/cd.c ============================================================================== --- head/bin/sh/cd.c Wed Oct 13 22:07:57 2010 (r213810) +++ head/bin/sh/cd.c Wed Oct 13 22:18:03 2010 (r213811) @@ -64,14 +64,14 @@ __FBSDID("$FreeBSD$"); #include "show.h" #include "cd.h" -STATIC int cdlogical(char *); -STATIC int cdphysical(char *); -STATIC int docd(char *, int, int); -STATIC char *getcomponent(void); -STATIC char *findcwd(char *); -STATIC void updatepwd(char *); -STATIC char *getpwd(void); -STATIC char *getpwd2(void); +static int cdlogical(char *); +static int cdphysical(char *); +static int docd(char *, int, int); +static char *getcomponent(void); +static char *findcwd(char *); +static void updatepwd(char *); +static char *getpwd(void); +static char *getpwd2(void); static char *curdir = NULL; /* current working directory */ static char *prevdir; /* previous working directory */ @@ -145,7 +145,7 @@ cdcmd(int argc, char **argv) * Actually change the directory. In an interactive shell, print the * directory name if "print" is nonzero. */ -STATIC int +static int docd(char *dest, int print, int phys) { @@ -161,7 +161,7 @@ docd(char *dest, int print, int phys) return 0; } -STATIC int +static int cdlogical(char *dest) { char *p; @@ -213,7 +213,7 @@ cdlogical(char *dest) return (0); } -STATIC int +static int cdphysical(char *dest) { char *p; @@ -232,7 +232,7 @@ cdphysical(char *dest) * Get the next component of the path name pointed to by cdcomppath. * This routine overwrites the string pointed to by cdcomppath. */ -STATIC char * +static char * getcomponent(void) { char *p; @@ -253,7 +253,7 @@ getcomponent(void) } -STATIC char * +static char * findcwd(char *dir) { char *new; @@ -296,7 +296,7 @@ findcwd(char *dir) * cd command. We also call hashcd to let the routines in exec.c know * that the current directory has changed. */ -STATIC void +static void updatepwd(char *dir) { hashcd(); /* update command hash table */ @@ -352,7 +352,7 @@ pwdcmd(int argc, char **argv) /* * Get the current directory and cache the result in curdir. */ -STATIC char * +static char * getpwd(void) { char *p; @@ -372,7 +372,7 @@ getpwd(void) /* * Return the current directory. */ -STATIC char * +static char * getpwd2(void) { char *pwd; Modified: head/bin/sh/error.c ============================================================================== --- head/bin/sh/error.c Wed Oct 13 22:07:57 2010 (r213810) +++ head/bin/sh/error.c Wed Oct 13 22:18:03 2010 (r213811) @@ -67,7 +67,7 @@ volatile sig_atomic_t intpending; char *commandname; -STATIC void exverror(int, const char *, va_list) __printf0like(2, 0) __dead2; +static void exverror(int, const char *, va_list) __printf0like(2, 0) __dead2; /* * Called to raise an exception. Since C doesn't include exceptions, we @@ -139,7 +139,7 @@ onint(void) * is not NULL then error prints an error message using printf style * formatting. It then raises the error exception. */ -STATIC void +static void exverror(int cond, const char *msg, va_list ap) { /* Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Wed Oct 13 22:07:57 2010 (r213810) +++ head/bin/sh/eval.c Wed Oct 13 22:18:03 2010 (r213811) @@ -87,15 +87,15 @@ int exitstatus; /* exit status of last int oexitstatus; /* saved exit status */ -STATIC void evalloop(union node *, int); -STATIC void evalfor(union node *, int); -STATIC void evalcase(union node *, int); -STATIC void evalsubshell(union node *, int); -STATIC void evalredir(union node *, int); -STATIC void expredir(union node *); -STATIC void evalpipe(union node *); -STATIC void evalcommand(union node *, int, struct backcmd *); -STATIC void prehash(union node *); +static void evalloop(union node *, int); +static void evalfor(union node *, int); +static void evalcase(union node *, int); +static void evalsubshell(union node *, int); +static void evalredir(union node *, int); +static void expredir(union node *); +static void evalpipe(union node *); +static void evalcommand(union node *, int, struct backcmd *); +static void prehash(union node *); /* @@ -289,7 +289,7 @@ out: } -STATIC void +static void evalloop(union node *n, int flags) { int status; @@ -327,7 +327,7 @@ skipping: if (evalskip == SKIPCONT && -STATIC void +static void evalfor(union node *n, int flags) { struct arglist arglist; @@ -367,7 +367,7 @@ out: -STATIC void +static void evalcase(union node *n, int flags) { union node *cp; @@ -400,7 +400,7 @@ out: * Kick off a subshell to evaluate a tree. */ -STATIC void +static void evalsubshell(union node *n, int flags) { struct job *jp; @@ -425,7 +425,7 @@ evalsubshell(union node *n, int flags) * Evaluate a redirected compound command. */ -STATIC void +static void evalredir(union node *n, int flags) { struct jmploc jmploc; @@ -466,7 +466,7 @@ evalredir(union node *n, int flags) * Compute the names of the files in a redirection list. */ -STATIC void +static void expredir(union node *n) { union node *redir; @@ -504,7 +504,7 @@ expredir(union node *n) * of all the rest.) */ -STATIC void +static void evalpipe(union node *n) { struct job *jp; @@ -617,7 +617,7 @@ out: * Execute a simple command. */ -STATIC void +static void evalcommand(union node *cmd, int flags, struct backcmd *backcmd) { struct stackmark smark; @@ -1028,7 +1028,7 @@ out: * check that the name will not be subject to expansion. */ -STATIC void +static void prehash(union node *n) { struct cmdentry entry; Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Wed Oct 13 22:07:57 2010 (r213810) +++ head/bin/sh/exec.c Wed Oct 13 22:18:03 2010 (r213811) @@ -96,10 +96,10 @@ static int builtinloc = -1; /* index in int exerrno = 0; /* Last exec error */ -STATIC void tryexec(char *, char **, char **); -STATIC void printentry(struct tblentry *, int); -STATIC struct tblentry *cmdlookup(const char *, int); -STATIC void delete_cmd_entry(void); +static void tryexec(char *, char **, char **); +static void printentry(struct tblentry *, int); +static struct tblentry *cmdlookup(const char *, int); +static void delete_cmd_entry(void); @@ -147,7 +147,7 @@ shellexec(char **argv, char **envp, cons } -STATIC void +static void tryexec(char *cmd, char **argv, char **envp) { int e; @@ -265,7 +265,7 @@ hashcmd(int argc __unused, char **argv _ } -STATIC void +static void printentry(struct tblentry *cmdp, int verbose) { int idx; @@ -618,7 +618,7 @@ deletefuncs(void) static struct tblentry **lastcmdentry; -STATIC struct tblentry * +static struct tblentry * cmdlookup(const char *name, int add) { int hashval; @@ -655,7 +655,7 @@ cmdlookup(const char *name, int add) * Delete the command entry returned on the last lookup. */ -STATIC void +static void delete_cmd_entry(void) { struct tblentry *cmdp; Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Wed Oct 13 22:07:57 2010 (r213810) +++ head/bin/sh/expand.c Wed Oct 13 22:18:03 2010 (r213811) @@ -95,25 +95,25 @@ static struct ifsregion ifsfirst; /* fir static struct ifsregion *ifslastp; /* last struct in list */ static struct arglist exparg; /* holds expanded arg list */ -STATIC void argstr(char *, int); -STATIC char *exptilde(char *, int); -STATIC void expbackq(union node *, int, int); -STATIC int subevalvar(char *, char *, int, int, int, int); -STATIC char *evalvar(char *, int); -STATIC int varisset(char *, int); -STATIC void varvalue(char *, int, int, int); -STATIC void recordregion(int, int, int); -STATIC void removerecordregions(int); -STATIC void ifsbreakup(char *, struct arglist *); -STATIC void expandmeta(struct strlist *, int); -STATIC void expmeta(char *, char *); -STATIC void addfname(char *); -STATIC struct strlist *expsort(struct strlist *); -STATIC struct strlist *msort(struct strlist *, int); -STATIC char *cvtnum(int, char *); -STATIC int collate_range_cmp(int, int); +static void argstr(char *, int); +static char *exptilde(char *, int); +static void expbackq(union node *, int, int); +static int subevalvar(char *, char *, int, int, int, int); +static char *evalvar(char *, int); +static int varisset(char *, int); +static void varvalue(char *, int, int, int); +static void recordregion(int, int, int); +static void removerecordregions(int); +static void ifsbreakup(char *, struct arglist *); +static void expandmeta(struct strlist *, int); +static void expmeta(char *, char *); +static void addfname(char *); +static struct strlist *expsort(struct strlist *); +static struct strlist *msort(struct strlist *, int); +static char *cvtnum(int, char *); +static int collate_range_cmp(int, int); -STATIC int +static int collate_range_cmp(int c1, int c2) { static char s1[2], s2[2]; @@ -210,7 +210,7 @@ expandarg(union node *arg, struct arglis * characters to allow for further processing. * If EXP_FULL is set, also preserve CTLQUOTEMARK characters. */ -STATIC void +static void argstr(char *p, int flag) { char c; @@ -276,7 +276,7 @@ breakloop:; * Perform tilde expansion, placing the result in the stack string and * returning the next position in the input string to process. */ -STATIC char * +static char * exptilde(char *p, int flag) { char c, *startp = p; @@ -329,7 +329,7 @@ lose: } -STATIC void +static void removerecordregions(int endoff) { if (ifslastp == NULL) @@ -428,7 +428,7 @@ expari(int flag) /* * Perform command substitution. */ -STATIC void +static void expbackq(union node *cmd, int quoted, int flag) { struct backcmd in; @@ -508,7 +508,7 @@ expbackq(union node *cmd, int quoted, in -STATIC int +static int subevalvar(char *p, char *str, int strloc, int subtype, int startloc, int varflags) { @@ -636,7 +636,7 @@ recordleft: * input string. */ -STATIC char * +static char * evalvar(char *p, int flag) { int subtype; @@ -824,7 +824,7 @@ record: * Test whether a specialized variable is set. */ -STATIC int +static int varisset(char *name, int nulok) { @@ -866,7 +866,7 @@ varisset(char *name, int nulok) * Add the value of a specialized variable to the stack string. */ -STATIC void +static void varvalue(char *name, int quoted, int subtype, int flag) { int num; @@ -956,7 +956,7 @@ numvar: * string for IFS characters. */ -STATIC void +static void recordregion(int start, int end, int inquotes) { struct ifsregion *ifsp; @@ -993,7 +993,7 @@ recordregion(int start, int end, int inq * This pass treats them as a regular character, making the string non-empty. * Later, they are removed along with the other CTL* characters. */ -STATIC void +static void ifsbreakup(char *string, struct arglist *arglist) { struct ifsregion *ifsp; @@ -1101,7 +1101,7 @@ static char expdir[PATH_MAX]; * At this point, the only control characters should be CTLESC and CTLQUOTEMARK. * The results are stored in the list exparg. */ -STATIC void +static void expandmeta(struct strlist *str, int flag __unused) { char *p; @@ -1148,7 +1148,7 @@ nometa: * Do metacharacter (i.e. *, ?, [...]) expansion. */ -STATIC void +static void expmeta(char *enddir, char *name) { char *p; @@ -1284,7 +1284,7 @@ expmeta(char *enddir, char *name) * Add a file name to the list. */ -STATIC void +static void addfname(char *name) { char *p; @@ -1305,7 +1305,7 @@ addfname(char *name) * work. */ -STATIC struct strlist * +static struct strlist * expsort(struct strlist *str) { int len; @@ -1318,7 +1318,7 @@ expsort(struct strlist *str) } -STATIC struct strlist * +static struct strlist * msort(struct strlist *list, int len) { struct strlist *p, *q = NULL; @@ -1541,7 +1541,7 @@ casematch(union node *pattern, const cha * Our own itoa(). */ -STATIC char * +static char * cvtnum(int num, char *buf) { char temp[32]; Modified: head/bin/sh/histedit.c ============================================================================== --- head/bin/sh/histedit.c Wed Oct 13 22:07:57 2010 (r213810) +++ head/bin/sh/histedit.c Wed Oct 13 22:18:03 2010 (r213811) @@ -68,7 +68,7 @@ EditLine *el; /* editline cookie */ int displayhist; static FILE *el_in, *el_out, *el_err; -STATIC char *fc_replace(const char *, char *, char *); +static char *fc_replace(const char *, char *, char *); /* * Set history and editing status. Called whenever the status may @@ -402,7 +402,7 @@ histcmd(int argc, char **argv) return 0; } -STATIC char * +static char * fc_replace(const char *s, char *p, char *r) { char *dest; Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Wed Oct 13 22:07:57 2010 (r213810) +++ head/bin/sh/input.c Wed Oct 13 22:18:03 2010 (r213811) @@ -104,8 +104,8 @@ int whichprompt; /* 1 == PS1, 2 == PS2 EditLine *el; /* cookie for editline package */ -STATIC void pushfile(void); -STATIC int preadfd(void); +static void pushfile(void); +static int preadfd(void); #ifdef mkinit INCLUDE "input.h" @@ -169,7 +169,7 @@ pgetc(void) } -STATIC int +static int preadfd(void) { int nr; @@ -468,7 +468,7 @@ setinputstring(char *string, int push) * adds a new entry to the stack and popfile restores the previous level. */ -STATIC void +static void pushfile(void) { struct parsefile *pf; Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Wed Oct 13 22:07:57 2010 (r213810) +++ head/bin/sh/jobs.c Wed Oct 13 22:18:03 2010 (r213811) @@ -86,21 +86,21 @@ volatile sig_atomic_t breakwaitcmd = 0; static int ttyfd = -1; #if JOBS -STATIC void restartjob(struct job *); +static void restartjob(struct job *); #endif -STATIC void freejob(struct job *); -STATIC struct job *getjob(char *); -STATIC pid_t dowait(int, struct job *); -STATIC pid_t waitproc(int, int *); -STATIC void checkzombies(void); -STATIC void cmdtxt(union node *); -STATIC void cmdputs(const char *); -#if JOBS -STATIC void setcurjob(struct job *); -STATIC void deljob(struct job *); -STATIC struct job *getcurjob(struct job *); +static void freejob(struct job *); +static struct job *getjob(char *); +static pid_t dowait(int, struct job *); +static pid_t waitproc(int, int *); +static void checkzombies(void); +static void cmdtxt(union node *); +static void cmdputs(const char *); +#if JOBS +static void setcurjob(struct job *); +static void deljob(struct job *); +static struct job *getcurjob(struct job *); #endif -STATIC void showjob(struct job *, pid_t, int); +static void showjob(struct job *, pid_t, int); /* @@ -242,7 +242,7 @@ bgcmd(int argc, char **argv) } -STATIC void +static void restartjob(struct job *jp) { struct procstat *ps; @@ -301,7 +301,7 @@ jobscmd(int argc, char *argv[]) return (0); } -STATIC void +static void showjob(struct job *jp, pid_t pid, int mode) { char s[64]; @@ -430,7 +430,7 @@ showjobs(int change, int mode) * Mark a job structure as unused. */ -STATIC void +static void freejob(struct job *jp) { struct procstat *ps; @@ -543,7 +543,7 @@ jobidcmd(int argc __unused, char **argv) * Convert a job name to a job structure. */ -STATIC struct job * +static struct job * getjob(char *name) { int jobno; @@ -686,7 +686,7 @@ makejob(union node *node __unused, int n } #if JOBS -STATIC void +static void setcurjob(struct job *cj) { struct job *jp, *prev; @@ -706,7 +706,7 @@ setcurjob(struct job *cj) jobmru = cj; } -STATIC void +static void deljob(struct job *j) { struct job *jp, *prev; @@ -726,7 +726,7 @@ deljob(struct job *j) * Return the most recently used job that isn't `nj', and preferably one * that is stopped. */ -STATIC struct job * +static struct job * getcurjob(struct job *nj) { struct job *jp; @@ -950,7 +950,7 @@ waitforjob(struct job *jp, int *origstat * Wait for a process to terminate. */ -STATIC pid_t +static pid_t dowait(int block, struct job *job) { pid_t pid; @@ -1061,7 +1061,7 @@ dowait(int block, struct job *job) * stopped processes. If block is zero, we return a value of zero * rather than blocking. */ -STATIC pid_t +static pid_t waitproc(int block, int *status) { int flags; @@ -1102,7 +1102,7 @@ stoppedjobs(void) } -STATIC void +static void checkzombies(void) { while (njobs > 0 && dowait(0, NULL) > 0) @@ -1147,7 +1147,7 @@ commandtext(union node *n) } -STATIC void +static void cmdtxt(union node *n) { union node *np; @@ -1280,7 +1280,7 @@ redir: -STATIC void +static void cmdputs(const char *s) { const char *p; Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Wed Oct 13 22:07:57 2010 (r213810) +++ head/bin/sh/main.c Wed Oct 13 22:18:03 2010 (r213811) @@ -77,8 +77,8 @@ int rootpid; int rootshell; struct jmploc main_handler; -STATIC void read_profile(const char *); -STATIC char *find_dot_file(char *); +static void read_profile(const char *); +static char *find_dot_file(char *); /* * Main routine. We initialize things, parse the arguments, execute @@ -247,7 +247,7 @@ cmdloop(int top) * Read /etc/profile or .profile. Return on error. */ -STATIC void +static void read_profile(const char *name) { int fd; @@ -291,7 +291,7 @@ readcmdfile(const char *name) */ -STATIC char * +static char * find_dot_file(char *basename) { static char localname[FILENAME_MAX+1]; Modified: head/bin/sh/memalloc.c ============================================================================== --- head/bin/sh/memalloc.c Wed Oct 13 22:07:57 2010 (r213810) +++ head/bin/sh/memalloc.c Wed Oct 13 22:18:03 2010 (r213811) @@ -131,7 +131,7 @@ int sstrnleft; int herefd = -1; -STATIC void +static void stnewblock(int nbytes) { struct stack_block *sp; Modified: head/bin/sh/nodes.c.pat ============================================================================== --- head/bin/sh/nodes.c.pat Wed Oct 13 22:07:57 2010 (r213810) +++ head/bin/sh/nodes.c.pat Wed Oct 13 22:18:03 2010 (r213811) @@ -46,19 +46,19 @@ #include "mystring.h" -STATIC int funcblocksize; /* size of structures in function */ -STATIC int funcstringsize; /* size of strings in node */ -STATIC pointer funcblock; /* block to allocate function from */ -STATIC char *funcstring; /* block to allocate strings from */ +static int funcblocksize; /* size of structures in function */ +static int funcstringsize; /* size of strings in node */ +static pointer funcblock; /* block to allocate function from */ +static char *funcstring; /* block to allocate strings from */ %SIZES -STATIC void calcsize(union node *); -STATIC void sizenodelist(struct nodelist *); -STATIC union node *copynode(union node *); -STATIC struct nodelist *copynodelist(struct nodelist *); -STATIC char *nodesavestr(char *); +static void calcsize(union node *); +static void sizenodelist(struct nodelist *); +static union node *copynode(union node *); +static struct nodelist *copynodelist(struct nodelist *); +static char *nodesavestr(char *); struct funcdef { @@ -96,7 +96,7 @@ getfuncnode(struct funcdef *fn) } -STATIC void +static void calcsize(union node *n) { %CALCSIZE @@ -104,7 +104,7 @@ calcsize(union node *n) -STATIC void +static void sizenodelist(struct nodelist *lp) { while (lp) { @@ -116,7 +116,7 @@ sizenodelist(struct nodelist *lp) -STATIC union node * +static union node * copynode(union node *n) { union node *new; @@ -126,7 +126,7 @@ copynode(union node *n) } -STATIC struct nodelist * +static struct nodelist * copynodelist(struct nodelist *lp) { struct nodelist *start; @@ -146,7 +146,7 @@ copynodelist(struct nodelist *lp) -STATIC char * +static char * nodesavestr(char *s) { char *p = s; Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Wed Oct 13 22:07:57 2010 (r213810) +++ head/bin/sh/options.c Wed Oct 13 22:18:03 2010 (r213811) @@ -69,10 +69,10 @@ char *nextopt_optptr; /* used by nextop char *minusc; /* argument to -c option */ -STATIC void options(int); -STATIC void minus_o(char *, int); -STATIC void setoption(int, int); -STATIC int getopts(char *, char *, char **, char ***, char **); +static void options(int); +static void minus_o(char *, int); +static void setoption(int, int); +static int getopts(char *, char *, char **, char ***, char **); /* @@ -138,7 +138,7 @@ optschanged(void) * to the argument list; we advance it past the options. */ -STATIC void +static void options(int cmdline) { char *kp, *p; @@ -247,7 +247,7 @@ end_options2: } } -STATIC void +static void minus_o(char *name, int val) { int i; @@ -284,7 +284,7 @@ minus_o(char *name, int val) } -STATIC void +static void setoption(int flag, int val) { int i; @@ -451,7 +451,7 @@ getoptscmd(int argc, char **argv) &shellparam.optptr); } -STATIC int +static int getopts(char *optstr, char *optvar, char **optfirst, char ***optnext, char **optptr) { Modified: head/bin/sh/output.c ============================================================================== --- head/bin/sh/output.c Wed Oct 13 22:07:57 2010 (r213810) +++ head/bin/sh/output.c Wed Oct 13 22:18:03 2010 (r213811) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #define MEM_OUT -3 /* output to dynamically allocated memory */ #define OUTPUT_ERR 01 /* error occurred on output */ -STATIC int doformat_wr(void *, const char *, int); +static int doformat_wr(void *, const char *, int); struct output output = {NULL, 0, NULL, OUTBUFSIZ, 1, 0}; struct output errout = {NULL, 0, NULL, 256, 2, 0}; @@ -281,7 +281,7 @@ fmtstr(char *outbuf, int length, const c outbuf[length - 1] = '\0'; } -STATIC int +static int doformat_wr(void *cookie, const char *buf, int len) { struct output *o; Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Wed Oct 13 22:07:57 2010 (r213810) +++ head/bin/sh/parser.c Wed Oct 13 22:18:03 2010 (r213811) @@ -105,25 +105,25 @@ static struct parser_temp *parser_temp; static int noaliases = 0; -STATIC union node *list(int); -STATIC union node *andor(void); -STATIC union node *pipeline(void); -STATIC union node *command(void); -STATIC union node *simplecmd(union node **, union node *); -STATIC union node *makename(void); -STATIC void parsefname(void); -STATIC void parseheredoc(void); -STATIC int peektoken(void); -STATIC int readtoken(void); -STATIC int xxreadtoken(void); -STATIC int readtoken1(int, char const *, char *, int); -STATIC int noexpand(char *); -STATIC void synexpect(int) __dead2; -STATIC void synerror(const char *) __dead2; -STATIC void setprompt(int); +static union node *list(int); +static union node *andor(void); +static union node *pipeline(void); +static union node *command(void); +static union node *simplecmd(union node **, union node *); +static union node *makename(void); +static void parsefname(void); +static void parseheredoc(void); +static int peektoken(void); +static int readtoken(void); +static int xxreadtoken(void); +static int readtoken1(int, char const *, char *, int); +static int noexpand(char *); +static void synexpect(int) __dead2; +static void synerror(const char *) __dead2; +static void setprompt(int); -STATIC void * +static void * parser_temp_alloc(size_t len) { struct parser_temp *t; @@ -139,7 +139,7 @@ parser_temp_alloc(size_t len) } -STATIC void * +static void * parser_temp_realloc(void *ptr, size_t len) { struct parser_temp *t; @@ -154,7 +154,7 @@ parser_temp_realloc(void *ptr, size_t le } -STATIC void +static void parser_temp_free_upto(void *ptr) { struct parser_temp *t; @@ -174,7 +174,7 @@ parser_temp_free_upto(void *ptr) } -STATIC void +static void parser_temp_free_all(void) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 22:20:25 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 724C91065670; Wed, 13 Oct 2010 22:20:25 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 4C6628FC14; Wed, 13 Oct 2010 22:20:25 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id o9DMKOKv017182; Wed, 13 Oct 2010 15:20:24 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.4/8.14.4/Submit) id o9DMKO44017181; Wed, 13 Oct 2010 15:20:24 -0700 (PDT) (envelope-from obrien) Date: Wed, 13 Oct 2010 15:20:24 -0700 From: "David O'Brien" To: Bruce Evans Message-ID: <20101013222024.GA17164@dragon.NUXI.org> References: <201010121924.o9CJOgwn059485@svn.freebsd.org> <20101013133713.L1075@besplex.bde.org> <20101013040543.GB13694@dragon.NUXI.org> <20101013152037.S2102@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101013152037.S2102@besplex.bde.org> X-Operating-System: FreeBSD 9.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r213744 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 22:20:25 -0000 On Wed, Oct 13, 2010 at 03:29:27PM +1100, Bruce Evans wrote: > Add __noinline or whatever attributes to STATIC (but keep static in > it) for the DEBUG >= 3 case if you are going that far. __noinline > should be a syntax error for variables, so this should also find any > STATICs still on variables. The spelling fix of changing STATIC to > what it actually means > (ASSORTED_HACKS_FOR_DEBUGGING_BUT_NOW_ONLY_FOR_FUNCTIONS) goes too far > for me. I've make all uses "static". Otherwise we have some of the functions and variable "STATIC" (if from 4.4BSD), and some others "static" (added later by FreeBSD). Surely this inconsistency isn't desired. -- -- David (obrien@FreeBSD.org) From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 22:23:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68A58106566B; Wed, 13 Oct 2010 22:23:18 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 45CF68FC16; Wed, 13 Oct 2010 22:23:18 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id o9DMNHlN017256; Wed, 13 Oct 2010 15:23:17 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.4/8.14.4/Submit) id o9DMNHER017255; Wed, 13 Oct 2010 15:23:17 -0700 (PDT) (envelope-from obrien) Date: Wed, 13 Oct 2010 15:23:17 -0700 From: "David O'Brien" To: John Baldwin Message-ID: <20101013222317.GB17164@dragon.NUXI.org> References: <201010121924.o9CJOgwn059485@svn.freebsd.org> <20101013040543.GB13694@dragon.NUXI.org> <20101013152037.S2102@besplex.bde.org> <201010130907.59715.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201010130907.59715.jhb@freebsd.org> X-Operating-System: FreeBSD 9.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r213744 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 22:23:18 -0000 On Wed, Oct 13, 2010 at 09:07:59AM -0400, John Baldwin wrote: > To be honest, I think changing STATIC is excessive churn. At this point I'm just making everything consistently "static" so that folks that add to ash won't need to realize that "STATIC" exists. Some of the folks making various FreeBSD changes did not realize this and created inconsistencies. Surely this inconsistency isn't desired. > The "right" fix > is to use 'make DEBUG_FLAGS="-g -DDEBUG=2 -fno-inline"'. I often use > 'make DEBUG_FLAGS="-g -fno-inline"' to workaround excessive inlining when I've added "-fno-inline" to DEBUG_FLAGS and will leave it up to others if that spelling isn't accepted by clang, Intel C, or what ever compiler someone may want to use. -- -- David (obrien@FreeBSD.org) From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 22:29:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58B3D106564A; Wed, 13 Oct 2010 22:29:49 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D2498FC14; Wed, 13 Oct 2010 22:29:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DMTnSD002984; Wed, 13 Oct 2010 22:29:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DMTn32002982; Wed, 13 Oct 2010 22:29:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010132229.o9DMTn32002982@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 13 Oct 2010 22:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213812 - head/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 22:29:50 -0000 Author: yongari Date: Wed Oct 13 22:29:48 2010 New Revision: 213812 URL: http://svn.freebsd.org/changeset/base/213812 Log: Fix a regression introduced in r213710. r213710 removed the use of auto polling such that it made all controllers obtain link status information from the state of the LNKRDY input signal. Broadcom recommends disabling auto polling such that driver should rely on PHY interrupts for link status change indications. Unfortunately it seems some controllers(BCM5703, BCM5704 and BCM5705) have PHY related issues so Linux took other approach to workaround it. bge(4) didn't follow that and it used to enable auto polling to workaround it. Restore this old behavior for BCM5700 family controllers and BCM5705 to use auto polling. For BCM5700 and BCM5701, it seems it does not need to enable auto polling but I restored it for safety. Special thanks to marius who tried lots of patches with patience. Reported by: marius Tested by: marius Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Wed Oct 13 22:18:03 2010 (r213811) +++ head/sys/dev/bge/if_bge.c Wed Oct 13 22:29:48 2010 (r213812) @@ -2012,6 +2012,10 @@ bge_blockinit(struct bge_softc *sc) if (sc->bge_flags & BGE_FLAG_TBI) { CSR_WRITE_4(sc, BGE_MI_STS, BGE_MISTS_LINK); } else { + if (sc->bge_mi_mode & BGE_MIMODE_AUTOPOLL) { + CSR_WRITE_4(sc, BGE_MI_MODE, sc->bge_mi_mode); + DELAY(80); + } if (sc->bge_asicrev == BGE_ASICREV_BCM5700 && sc->bge_chipid != BGE_CHIPID_BCM5700_B2) CSR_WRITE_4(sc, BGE_MAC_EVT_ENB, @@ -2677,6 +2681,9 @@ bge_attach(device_t dev) sc->bge_mi_mode = BGE_MIMODE_500KHZ_CONST; else sc->bge_mi_mode = BGE_MIMODE_BASE; + /* Enable auto polling for BCM570[0-5]. */ + if (BGE_IS_5700_FAMILY(sc) || sc->bge_asicrev == BGE_ASICREV_BCM5705) + sc->bge_mi_mode |= BGE_MIMODE_AUTOPOLL; /* * All controllers that are not 5755 or higher have 4GB From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 22:59:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD95D1065670; Wed, 13 Oct 2010 22:59:04 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBB358FC14; Wed, 13 Oct 2010 22:59:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DMx4So003617; Wed, 13 Oct 2010 22:59:04 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DMx43Z003612; Wed, 13 Oct 2010 22:59:04 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201010132259.o9DMx43Z003612@svn.freebsd.org> From: Matthew D Fleming Date: Wed, 13 Oct 2010 22:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213813 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 22:59:05 -0000 Author: mdf Date: Wed Oct 13 22:59:04 2010 New Revision: 213813 URL: http://svn.freebsd.org/changeset/base/213813 Log: Use a safer mechanism for determining if a task is currently running, that does not rely on the lifetime of pointers being the same. This also restores the task KBI. Suggested by: jhb MFC after: 1 month Modified: head/share/man/man9/taskqueue.9 head/sys/kern/subr_taskqueue.c head/sys/sys/_task.h head/sys/sys/taskqueue.h Modified: head/share/man/man9/taskqueue.9 ============================================================================== --- head/share/man/man9/taskqueue.9 Wed Oct 13 22:29:48 2010 (r213812) +++ head/share/man/man9/taskqueue.9 Wed Oct 13 22:59:04 2010 (r213813) @@ -68,7 +68,7 @@ struct task { .Ft int .Fn taskqueue_member "struct taskqueue *queue" "struct thread *td" .Ft void -.Fn taskqueue_run "struct taskqueue *queue" "struct task **tpp" +.Fn taskqueue_run "struct taskqueue *queue" .Fn TASK_INIT "struct task *task" "int priority" "task_fn_t *func" "void *context" .Fn TASKQUEUE_DECLARE "name" .Fn TASKQUEUE_DEFINE "name" "taskqueue_enqueue_fn enqueue" "void *context" "init" @@ -185,13 +185,6 @@ The function will run all pending tasks in the specified .Fa queue . Normally this function is only used internally. -The -.Fa tpp -argument is a pointer to a -.Vt struct task * -that is used to record the currently running task. -The lifetime of this pointer must match that of the -.Fa queue . .Pp A convenience macro, .Fn TASK_INIT "task" "priority" "func" "context" Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Wed Oct 13 22:29:48 2010 (r213812) +++ head/sys/kern/subr_taskqueue.c Wed Oct 13 22:59:04 2010 (r213813) @@ -46,12 +46,17 @@ static MALLOC_DEFINE(M_TASKQUEUE, "taskq static void *taskqueue_giant_ih; static void *taskqueue_ih; +struct taskqueue_busy { + struct task *tb_running; + TAILQ_ENTRY(taskqueue_busy) tb_link; +}; + struct taskqueue { STAILQ_HEAD(, task) tq_queue; const char *tq_name; taskqueue_enqueue_fn tq_enqueue; void *tq_context; - struct task *tq_running; + TAILQ_HEAD(, taskqueue_busy) tq_active; struct mtx tq_mutex; struct thread **tq_threads; int tq_tcount; @@ -102,6 +107,7 @@ _taskqueue_create(const char *name, int return NULL; STAILQ_INIT(&queue->tq_queue); + TAILQ_INIT(&queue->tq_active); queue->tq_name = name; queue->tq_enqueue = enqueue; queue->tq_context = context; @@ -140,6 +146,7 @@ taskqueue_free(struct taskqueue *queue) TQ_LOCK(queue); queue->tq_flags &= ~TQ_FLAGS_ACTIVE; taskqueue_terminate(queue->tq_threads, queue); + KASSERT(TAILQ_EMPTY(&queue->tq_active), ("Tasks still running?")); mtx_destroy(&queue->tq_mutex); free(queue->tq_threads, M_TASKQUEUE); free(queue, M_TASKQUEUE); @@ -214,13 +221,17 @@ taskqueue_unblock(struct taskqueue *queu TQ_UNLOCK(queue); } -void -taskqueue_run(struct taskqueue *queue, struct task **tpp) +static void +taskqueue_run_locked(struct taskqueue *queue) { + struct taskqueue_busy tb; struct task *task; int pending; mtx_assert(&queue->tq_mutex, MA_OWNED); + tb.tb_running = NULL; + TAILQ_INSERT_TAIL(&queue->tq_active, &tb, tb_link); + while (STAILQ_FIRST(&queue->tq_queue)) { /* * Carefully remove the first task from the queue and @@ -230,16 +241,38 @@ taskqueue_run(struct taskqueue *queue, s STAILQ_REMOVE_HEAD(&queue->tq_queue, ta_link); pending = task->ta_pending; task->ta_pending = 0; - task->ta_running = tpp; - *tpp = task; + tb.tb_running = task; TQ_UNLOCK(queue); task->ta_func(task->ta_context, pending); TQ_LOCK(queue); - *tpp = NULL; + tb.tb_running = NULL; wakeup(task); } + TAILQ_REMOVE(&queue->tq_active, &tb, tb_link); +} + +void +taskqueue_run(struct taskqueue *queue) +{ + + TQ_LOCK(queue); + taskqueue_run_locked(queue); + TQ_UNLOCK(queue); +} + +static int +task_is_running(struct taskqueue *queue, struct task *task) +{ + struct taskqueue_busy *tb; + + mtx_assert(&queue->tq_mutex, MA_OWNED); + TAILQ_FOREACH(tb, &queue->tq_active, tb_link) { + if (tb->tb_running == task) + return (1); + } + return (0); } void @@ -250,10 +283,8 @@ taskqueue_drain(struct taskqueue *queue, WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); TQ_LOCK(queue); - while (task->ta_pending != 0 || - (task->ta_running != NULL && task == *task->ta_running)) { + while (task->ta_pending != 0 || task_is_running(queue, task)) TQ_SLEEP(queue, task, &queue->tq_mutex, PWAIT, "-", 0); - } TQ_UNLOCK(queue); } @@ -266,9 +297,7 @@ taskqueue_swi_enqueue(void *context) static void taskqueue_swi_run(void *dummy) { - TQ_LOCK(taskqueue_swi); - taskqueue_run(taskqueue_swi, &taskqueue_swi->tq_running); - TQ_UNLOCK(taskqueue_swi); + taskqueue_run(taskqueue_swi); } static void @@ -280,9 +309,7 @@ taskqueue_swi_giant_enqueue(void *contex static void taskqueue_swi_giant_run(void *dummy) { - TQ_LOCK(taskqueue_swi_giant); - taskqueue_run(taskqueue_swi_giant, &taskqueue_swi_giant->tq_running); - TQ_UNLOCK(taskqueue_swi_giant); + taskqueue_run(taskqueue_swi_giant); } int @@ -344,22 +371,12 @@ void taskqueue_thread_loop(void *arg) { struct taskqueue **tqp, *tq; - struct task *running; - - /* - * The kernel stack space is globaly addressable, and it would - * be an error to ask whether a task is running after the - * taskqueue has been released. So it is safe to have the - * task point back to an address in the taskqueue's stack to - * determine if the task is running. - */ - running = NULL; tqp = arg; tq = *tqp; TQ_LOCK(tq); while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0) { - taskqueue_run(tq, &running); + taskqueue_run_locked(tq); /* * Because taskqueue_run() can drop tq_mutex, we need to * check if the TQ_FLAGS_ACTIVE flag wasn't removed in the @@ -369,7 +386,7 @@ taskqueue_thread_loop(void *arg) break; TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0); } - taskqueue_run(tq, &running); + taskqueue_run_locked(tq); /* rendezvous with thread that asked us to terminate */ tq->tq_tcount--; @@ -426,9 +443,7 @@ taskqueue_fast_enqueue(void *context) static void taskqueue_fast_run(void *dummy) { - TQ_LOCK(taskqueue_fast); - taskqueue_run(taskqueue_fast, &taskqueue_fast->tq_running); - TQ_UNLOCK(taskqueue_fast); + taskqueue_run(taskqueue_fast); } TASKQUEUE_FAST_DEFINE(fast, taskqueue_fast_enqueue, NULL, Modified: head/sys/sys/_task.h ============================================================================== --- head/sys/sys/_task.h Wed Oct 13 22:29:48 2010 (r213812) +++ head/sys/sys/_task.h Wed Oct 13 22:59:04 2010 (r213813) @@ -44,7 +44,6 @@ typedef void task_fn_t(void *context, int pending); struct task { - struct task **ta_running; /* (q) queue's running task pointer */ STAILQ_ENTRY(task) ta_link; /* (q) link for queue */ u_short ta_pending; /* (q) count times queued */ u_short ta_priority; /* (c) Priority */ Modified: head/sys/sys/taskqueue.h ============================================================================== --- head/sys/sys/taskqueue.h Wed Oct 13 22:29:48 2010 (r213812) +++ head/sys/sys/taskqueue.h Wed Oct 13 22:59:04 2010 (r213813) @@ -56,7 +56,7 @@ int taskqueue_start_threads(struct taskq int taskqueue_enqueue(struct taskqueue *queue, struct task *task); void taskqueue_drain(struct taskqueue *queue, struct task *task); void taskqueue_free(struct taskqueue *queue); -void taskqueue_run(struct taskqueue *queue, struct task **tpp); +void taskqueue_run(struct taskqueue *queue); void taskqueue_block(struct taskqueue *queue); void taskqueue_unblock(struct taskqueue *queue); int taskqueue_member(struct taskqueue *queue, struct thread *td); @@ -75,7 +75,6 @@ void taskqueue_thread_enqueue(void *cont (task)->ta_priority = (priority); \ (task)->ta_func = (func); \ (task)->ta_context = (context); \ - (task)->ta_running = NULL; \ } while (0) /* From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 23:29:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AC811065672; Wed, 13 Oct 2010 23:29:10 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 480738FC13; Wed, 13 Oct 2010 23:29:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DNTAmX004224; Wed, 13 Oct 2010 23:29:10 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DNTAGq004219; Wed, 13 Oct 2010 23:29:10 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010132329.o9DNTAGq004219@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 13 Oct 2010 23:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213814 - in head: bin/sh tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 23:29:10 -0000 Author: obrien Date: Wed Oct 13 23:29:09 2010 New Revision: 213814 URL: http://svn.freebsd.org/changeset/base/213814 Log: Do not assume in growstackstr() that a "precious" character will be immediately written into the stack after the call. Instead let the caller manage the "space left". Previously, growstackstr()'s assumption causes problems with STACKSTRNUL() where we want to be able to turn a stack into a C string, and later pretend the NUL is not there. This fixes a bug in STACKSTRNUL() (that grew the stack) where: 1. STADJUST() called after a STACKSTRNUL() results in an improper adjust. This can be seen in ${var%pattern} and ${var%%pattern} evaluation. 2. Memory leak in STPUTC() called after a STACKSTRNUL(). Reviewed by: jilles Added: head/tools/regression/bin/sh/expansion/trim4.0 (contents, props changed) Modified: head/bin/sh/histedit.c head/bin/sh/memalloc.c head/bin/sh/memalloc.h Modified: head/bin/sh/histedit.c ============================================================================== --- head/bin/sh/histedit.c Wed Oct 13 22:59:04 2010 (r213813) +++ head/bin/sh/histedit.c Wed Oct 13 23:29:09 2010 (r213814) @@ -418,7 +418,7 @@ fc_replace(const char *s, char *p, char } else STPUTC(*s++, dest); } - STACKSTRNUL(dest); + STPUTC('\0', dest); dest = grabstackstr(dest); return (dest); Modified: head/bin/sh/memalloc.c ============================================================================== --- head/bin/sh/memalloc.c Wed Oct 13 22:59:04 2010 (r213813) +++ head/bin/sh/memalloc.c Wed Oct 13 23:29:09 2010 (r213814) @@ -295,6 +295,13 @@ grabstackblock(int len) * is space for at least one character. */ +static char * +growstrstackblock(int n) +{ + growstackblock(); + sstrnleft = stackblocksize() - n; + return stackblock() + n; +} char * growstackstr(void) @@ -304,12 +311,10 @@ growstackstr(void) len = stackblocksize(); if (herefd >= 0 && len >= 1024) { xwrite(herefd, stackblock(), len); - sstrnleft = len - 1; + sstrnleft = len; return stackblock(); } - growstackblock(); - sstrnleft = stackblocksize() - len - 1; - return stackblock() + len; + return growstrstackblock(len); } @@ -323,9 +328,7 @@ makestrspace(void) int len; len = stackblocksize() - sstrnleft; - growstackblock(); - sstrnleft = stackblocksize() - len; - return stackblock() + len; + return growstrstackblock(len); } Modified: head/bin/sh/memalloc.h ============================================================================== --- head/bin/sh/memalloc.h Wed Oct 13 22:59:04 2010 (r213813) +++ head/bin/sh/memalloc.h Wed Oct 13 23:29:09 2010 (r213814) @@ -67,9 +67,16 @@ void ungrabstackstr(char *, char *); #define stackblock() stacknxt #define stackblocksize() stacknleft #define STARTSTACKSTR(p) p = stackblock(), sstrnleft = stackblocksize() -#define STPUTC(c, p) (--sstrnleft >= 0? (*p++ = (c)) : (p = growstackstr(), *p++ = (c))) +#define STPUTC(c, p) (--sstrnleft >= 0? (*p++ = (c)) : (p = growstackstr(), --sstrnleft, *p++ = (c))) #define CHECKSTRSPACE(n, p) { if (sstrnleft < n) p = makestrspace(); } #define USTPUTC(c, p) (--sstrnleft, *p++ = (c)) +/* + * STACKSTRNUL's use is where we want to be able to turn a stack + * (non-sentinel, character counting string) into a C string, + * and later pretend the NUL is not there. + * Note: Because of STACKSTRNUL's semantics, STACKSTRNUL cannot be used + * on a stack that will grabstackstr()ed. + */ #define STACKSTRNUL(p) (sstrnleft == 0? (p = growstackstr(), *p = '\0') : (*p = '\0')) #define STUNPUTC(p) (++sstrnleft, --p) #define STTOPC(p) p[-1] Added: head/tools/regression/bin/sh/expansion/trim4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/trim4.0 Wed Oct 13 23:29:09 2010 (r213814) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +v1=/homes/SOME_USER +v2= +v3=C123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 + +# Trigger bug in VSTRIMRIGHT processing STADJUST() call in expand.c:subevalvar() +while [ ${#v2} -lt 2000 ]; do + v4="${v2} ${v1%/*} $v3" + if [ ${#v4} -ne $((${#v2} + ${#v3} + 8)) ]; then + echo bad: ${#v4} -ne $((${#v2} + ${#v3} + 8)) + fi + v2=x$v2 + v3=y$v3 +done From owner-svn-src-all@FreeBSD.ORG Wed Oct 13 23:31:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98FBE106566B; Wed, 13 Oct 2010 23:31:17 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DEA98FC12; Wed, 13 Oct 2010 23:31:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9DNVHQn004309; Wed, 13 Oct 2010 23:31:17 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9DNVHLu004307; Wed, 13 Oct 2010 23:31:17 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010132331.o9DNVHLu004307@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 13 Oct 2010 23:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213815 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 23:31:17 -0000 Author: obrien Date: Wed Oct 13 23:31:17 2010 New Revision: 213815 URL: http://svn.freebsd.org/changeset/base/213815 Log: We only need to look as far as '..' to find 'test/'. Modified: head/bin/sh/Makefile Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Wed Oct 13 23:29:09 2010 (r213814) +++ head/bin/sh/Makefile Wed Oct 13 23:31:17 2010 (r213815) @@ -26,7 +26,7 @@ WARNS?= 2 WFORMAT=0 .PATH: ${.CURDIR}/bltin \ - ${.CURDIR}/../../bin/test + ${.CURDIR}/../test CLEANFILES+= mkinit mkinit.o mknodes mknodes.o \ mksyntax mksyntax.o From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 00:46:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27FC7106564A; Thu, 14 Oct 2010 00:46:34 +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 169E48FC18; Thu, 14 Oct 2010 00:46:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9E0kXGh006097; Thu, 14 Oct 2010 00:46:33 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9E0kXd6006095; Thu, 14 Oct 2010 00:46:33 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201010140046.o9E0kXd6006095@svn.freebsd.org> From: Ed Maste Date: Thu, 14 Oct 2010 00:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213816 - stable/8/sys/dev/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 00:46:34 -0000 Author: emaste Date: Thu Oct 14 00:46:33 2010 New Revision: 213816 URL: http://svn.freebsd.org/changeset/base/213816 Log: MFC r212594: Avoid repeatedly spamming the console while a timed out command is waiting to complete. Instead, print one message after the timeout period expires, and one more when (if) the command eventually completes. Modified: stable/8/sys/dev/aac/aac.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/aac/aac.c ============================================================================== --- stable/8/sys/dev/aac/aac.c Wed Oct 13 23:31:17 2010 (r213815) +++ stable/8/sys/dev/aac/aac.c Thu Oct 14 00:46:33 2010 (r213816) @@ -1129,6 +1129,11 @@ aac_complete(void *context, int pending) AAC_PRINT_FIB(sc, fib); break; } + if ((cm->cm_flags & AAC_CMD_TIMEDOUT) != 0) + device_printf(sc->aac_dev, + "COMMAND %p COMPLETED AFTER %d SECONDS\n", + cm, (int)(time_uptime-cm->cm_timestamp)); + aac_remove_busy(cm); aac_unmap_command(cm); @@ -2348,7 +2353,7 @@ aac_timeout(struct aac_softc *sc) deadline = time_uptime - AAC_CMD_TIMEOUT; TAILQ_FOREACH(cm, &sc->aac_busy, cm_link) { if ((cm->cm_timestamp < deadline) - /* && !(cm->cm_flags & AAC_CMD_TIMEDOUT) */) { + && !(cm->cm_flags & AAC_CMD_TIMEDOUT)) { cm->cm_flags |= AAC_CMD_TIMEDOUT; device_printf(sc->aac_dev, "COMMAND %p (TYPE %d) TIMEOUT AFTER %d SECONDS\n", From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 01:16:06 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16D2B106566C; Thu, 14 Oct 2010 01:16:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 9FE148FC12; Thu, 14 Oct 2010 01:16:05 +0000 (UTC) Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au (c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o9E1G1TA002070 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 14 Oct 2010 12:16:03 +1100 Date: Thu, 14 Oct 2010 12:16:01 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim In-Reply-To: <201010131359.44590.jkim@FreeBSD.org> Message-ID: <20101014113203.N1092@besplex.bde.org> References: <201010131717.o9DHHobD094458@svn.freebsd.org> <20101013172757.GA21579@freebsd.org> <201010131359.44590.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Roman Divacky , src-committers@FreeBSD.org, Rui Paulo , svn-src-all@FreeBSD.org Subject: Re: svn commit: r213793 - in head/sys/dev: ce cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 01:16:06 -0000 On Wed, 13 Oct 2010, Jung-uk Kim wrote: > On Wednesday 13 October 2010 01:27 pm, Roman Divacky wrote: >>> >>> Modified: head/sys/dev/ce/if_ce.c >>> ================================================================= >>> ============= --- head/sys/dev/ce/if_ce.c Wed Oct 13 17:16:08 >>> 2010 (r213792) +++ head/sys/dev/ce/if_ce.c Wed Oct 13 17:17:50 >>> 2010 (r213793) @@ -1313,7 +1313,7 @@ static int ce_ioctl (struct >>> cdev *dev, u IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); >>> IFP2SP(d->ifp)->pp_flags |= PP_KEEPALIVE; >>> d->ifp->if_flags |= PP_CISCO; >>> - } else if (! strcmp ("fr", (char*)data) && PP_FR) { >>> + } else if (! strcmp ("fr", (char*)data)) { >> >> this is wrong I think... the PP_FR was used for compiling in/out >> support for something.. see the comment: >> >> /* If we don't have Cronyx's sppp version, we don't have fr support >> via sppp */ #ifndef PP_FR >> #define PP_FR 0 >> #endif >> >> note that PP_FR is used in some other places as a flag. I guess >> that by compiling with something like make -DPP_FR=42 some magic >> would happen. >> >> anyway - this does not look like a bug but like an intent, please >> revert. > > I think the attached patch should do. % Index: sys/dev/ce/if_ce.c % =================================================================== % --- sys/dev/ce/if_ce.c (revision 213782) % +++ sys/dev/ce/if_ce.c (working copy) % @@ -1313,9 +1313,11 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, % IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); % IFP2SP(d->ifp)->pp_flags |= PP_KEEPALIVE; % d->ifp->if_flags |= PP_CISCO; % - } else if (! strcmp ("fr", (char*)data) && PP_FR) { % +#if PP_FR > 0 % + } else if (! strcmp ("fr", (char*)data)) { % d->ifp->if_flags &= ~(PP_CISCO); % IFP2SP(d->ifp)->pp_flags |= PP_FR | PP_KEEPALIVE; % +#endif % } else if (! strcmp ("ppp", (char*)data)) { % IFP2SP(d->ifp)->pp_flags &= ~PP_FR; % IFP2SP(d->ifp)->pp_flags &= ~PP_KEEPALIVE; % ... This gives different behaviour if PP_FR is even or negative. Even values used to fail the match, but now the match succeeds for even values > 0 and then the bits of PP_FR are put in pp_flags. Negative values used to pass the match if they were odd, but now the match is not attempted for any negative value. It just might be useful for PP_FR to have multiple bits set, with the 1 bit used for enabling this and the other bits used for setting pp_flags. If not, then only values of 0 and 1 for PP_FR make sense, and the ifdef should be "#if PP_FR == 1". One of the 3 style bugs of "! strcmp (...)" is larger now. The normal style of "strcmp(...) == 0" would have inhibited this bug, but perhaps "!" was used to emphasize that the result is boolean. The 3 strcmp's visible in the above patch are the only ones in the file with the "! " style bugs. The normal style of explicitly comparing the result of strcmp with 0 is used 2 times, with consistency only for using a gnu-style space before the left parentheses. I don't see why clang complained about this. "! strcmp()" has a boolean result with value of 1 for "true". It is perfectly valid to AND this result with a boolean flag that also has value 1 for "true", or with an integral bitmap that uses bit 0 (value 1) for this test. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 01:21:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B8D0106566C; Thu, 14 Oct 2010 01:21:45 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 071998FC1A; Thu, 14 Oct 2010 01:21:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9E1Lj3Q006866; Thu, 14 Oct 2010 01:21:45 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9E1Li3e006863; Thu, 14 Oct 2010 01:21:44 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010140121.o9E1Li3e006863@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 14 Oct 2010 01: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: r213817 - in stable/8: . contrib/top etc/periodic/daily gnu/usr.bin lib/libusb release/picobsd/floppy.tree/sbin sbin/geom/class/sched tools/regression/lib/msun tools/regression/usr.bin/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 01:21:45 -0000 Author: obrien Date: Thu Oct 14 01:21:44 2010 New Revision: 213817 URL: http://svn.freebsd.org/changeset/base/213817 Log: MFC r212770 & r212832: + Add the SCRIPT environmental variable to the sub-shell. + Add the 'command' argument (if supplied on the command line) to the typescript file. Modified: stable/8/usr.bin/script/script.1 stable/8/usr.bin/script/script.c Directory Properties: stable/8/ (props changed) stable/8/Makefile (props changed) stable/8/Makefile.inc1 (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/UPDATING (props changed) stable/8/bin/ (props changed) stable/8/bin/chio/ (props changed) stable/8/bin/chmod/ (props changed) stable/8/bin/cp/ (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/date/ (props changed) stable/8/bin/expr/ (props changed) stable/8/bin/getfacl/ (props changed) stable/8/bin/kill/ (props changed) stable/8/bin/ln/ (props changed) stable/8/bin/ls/ (props changed) stable/8/bin/mv/ (props changed) stable/8/bin/pax/ (props changed) stable/8/bin/pkill/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/pwait/ (props changed) stable/8/bin/setfacl/ (props changed) stable/8/bin/sh/ (props changed) stable/8/bin/sleep/ (props changed) stable/8/bin/test/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/cddl/lib/libzpool/ (props changed) stable/8/contrib/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/binutils/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/com_err/ (props changed) stable/8/contrib/csup/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/expat/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/groff/ (props changed) stable/8/contrib/ipfilter/ (props changed) stable/8/contrib/less/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/nvi/ (props changed) stable/8/contrib/one-true-awk/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/tcp_wrappers/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/telnet/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/contrib/xz/ (props changed) stable/8/crypto/heimdal/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/crypto/openssl/ (props changed) stable/8/etc/ (props changed) stable/8/etc/periodic/daily/ (props changed) stable/8/etc/periodic/daily/800.scrub-zfs (props changed) stable/8/games/factor/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/grdc/ (props changed) stable/8/games/pom/ (props changed) stable/8/gnu/lib/csu/ (props changed) stable/8/gnu/lib/libstdc++/ (props changed) stable/8/gnu/usr.bin/ (props changed) stable/8/gnu/usr.bin/Makefile (props changed) stable/8/gnu/usr.bin/dialog/ (props changed) stable/8/gnu/usr.bin/gdb/ (props changed) stable/8/gnu/usr.bin/gdb/kgdb/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/kerberos5/usr.bin/kdestroy/ (props changed) stable/8/kerberos5/usr.bin/kpasswd/ (props changed) stable/8/lib/ (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) stable/8/lib/libc_r/ (props changed) stable/8/lib/libcam/ (props changed) stable/8/lib/libcompat/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libedit/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libgeom/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkse/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/liblzma/ (props changed) stable/8/lib/libmagic/ (props changed) stable/8/lib/libmemstat/ (props changed) stable/8/lib/libpam/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/libsm/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libufs/ (props changed) stable/8/lib/libugidfw/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libusbhid/ (props changed) stable/8/lib/libutil/ (props changed) stable/8/lib/libz/ (props changed) stable/8/lib/libz/contrib/ (props changed) stable/8/lib/msun/ (props changed) stable/8/libexec/ (props changed) stable/8/libexec/ftpd/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/libexec/tftpd/ (props changed) 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/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/devd/ (props changed) stable/8/sbin/devfs/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dump/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/fsck_msdosfs/ (props changed) stable/8/sbin/fsirand/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/iscontrol/ (props changed) stable/8/sbin/kldload/ (props changed) stable/8/sbin/kldstat/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/newfs_msdos/ (props changed) stable/8/sbin/ping6/ (props changed) stable/8/sbin/reboot/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/setkey/ (props changed) stable/8/sbin/spppcontrol/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/ (props changed) stable/8/secure/lib/libcrypto/ (props changed) stable/8/secure/lib/libssl/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/secure/usr.bin/openssl/ (props changed) stable/8/share/dict/ (props changed) stable/8/share/examples/ (props changed) stable/8/share/examples/etc/ (props changed) stable/8/share/examples/kld/syscall/ (props changed) stable/8/share/man/ (props changed) stable/8/share/man/man1/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/mk/ (props changed) stable/8/share/termcap/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) 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) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/tools/ (props changed) stable/8/tools/build/mk/ (props changed) stable/8/tools/build/options/ (props changed) stable/8/tools/debugscripts/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/aio/aiotest/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/mqueue/mqtest1/ (props changed) stable/8/tools/regression/mqueue/mqtest2/ (props changed) stable/8/tools/regression/mqueue/mqtest3/ (props changed) stable/8/tools/regression/mqueue/mqtest4/ (props changed) stable/8/tools/regression/mqueue/mqtest5/ (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/posixsem/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/usr.bin/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/regression/usr.bin/sed/ (props changed) stable/8/tools/test/ (props changed) stable/8/tools/tools/ (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/nanobsd/ (props changed) stable/8/tools/tools/netrate/tcpp/ (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/umastat/ (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/ (props changed) stable/8/usr.bin/apply/ (props changed) stable/8/usr.bin/ar/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/biff/ (props changed) stable/8/usr.bin/c89/ (props changed) stable/8/usr.bin/c99/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/column/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/cpio/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/du/ (props changed) stable/8/usr.bin/ee/ (props changed) stable/8/usr.bin/enigma/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/getopt/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/hexdump/ (props changed) stable/8/usr.bin/indent/ (props changed) stable/8/usr.bin/jot/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/killall/ (props changed) stable/8/usr.bin/ktrace/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/lockf/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/mail/ (props changed) stable/8/usr.bin/make/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/minigzip/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/pathchk/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/rpcgen/ (props changed) stable/8/usr.bin/script/ (props changed) stable/8/usr.bin/sed/ (props changed) stable/8/usr.bin/sockstat/ (props changed) stable/8/usr.bin/split/ (props changed) stable/8/usr.bin/stat/ (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tar/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/touch/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/uname/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/unzip/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.bin/xinstall/ (props changed) stable/8/usr.bin/xlint/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/Makefile (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/asf/ (props changed) stable/8/usr.sbin/bluetooth/ (props changed) stable/8/usr.sbin/bluetooth/bthidcontrol/ (props changed) stable/8/usr.sbin/bluetooth/bthidd/ (props changed) stable/8/usr.sbin/boot0cfg/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) stable/8/usr.sbin/burncd/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/chown/ (props changed) stable/8/usr.sbin/config/ (props changed) stable/8/usr.sbin/cpucontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/crunch/examples/ (props changed) stable/8/usr.sbin/ctm/ (props changed) stable/8/usr.sbin/cxgbtool/ (props changed) stable/8/usr.sbin/devinfo/ (props changed) stable/8/usr.sbin/diskinfo/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/faithd/ (props changed) stable/8/usr.sbin/fdcontrol/ (props changed) stable/8/usr.sbin/fdformat/ (props changed) stable/8/usr.sbin/fdread/ (props changed) stable/8/usr.sbin/fdwrite/ (props changed) stable/8/usr.sbin/fifolog/ (props changed) stable/8/usr.sbin/flowctl/ (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/i2c/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/mailwrapper/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) stable/8/usr.sbin/mergemaster/ (props changed) stable/8/usr.sbin/mfiutil/mfiutil.8 (props changed) stable/8/usr.sbin/mountd/ (props changed) stable/8/usr.sbin/moused/ (props changed) stable/8/usr.sbin/mptutil/ (props changed) stable/8/usr.sbin/mtest/ (props changed) stable/8/usr.sbin/mtree/ (props changed) stable/8/usr.sbin/named/ (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/newsyslog/ (props changed) stable/8/usr.sbin/nfsdumpstate/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) stable/8/usr.sbin/periodic/ (props changed) stable/8/usr.sbin/pmcannotate/ (props changed) stable/8/usr.sbin/pmccontrol/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) stable/8/usr.sbin/powerd/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pppctl/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/rpc.lockd/ (props changed) stable/8/usr.sbin/rpc.umntall/ (props changed) stable/8/usr.sbin/rtsold/ (props changed) stable/8/usr.sbin/sade/ (props changed) stable/8/usr.sbin/service/ (props changed) stable/8/usr.sbin/services_mkdb/ (props changed) stable/8/usr.sbin/setfmac/ (props changed) stable/8/usr.sbin/setpmac/ (props changed) stable/8/usr.sbin/smbmsg/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) stable/8/usr.sbin/traceroute/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/uathload/ (props changed) stable/8/usr.sbin/ugidfw/ (props changed) stable/8/usr.sbin/uhsoctl/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/vidcontrol/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/ypserv/ (props changed) stable/8/usr.sbin/zic/ (props changed) Modified: stable/8/usr.bin/script/script.1 ============================================================================== --- stable/8/usr.bin/script/script.1 Thu Oct 14 00:46:33 2010 (r213816) +++ stable/8/usr.bin/script/script.1 Thu Oct 14 01:21:44 2010 (r213817) @@ -117,6 +117,19 @@ The results are meant to emulate a hardc The following environment variable is utilized by .Nm : .Bl -tag -width SHELL +.It Ev SCRIPT +The +.Ev SCRIPT +environment variable is added to the sub-shell. +If +.Ev SCRIPT +already existed in the users environment, +its value is overwritten within the sub-shell. +The value of +.Ev SCRIPT +is the name of the +.Ar typescript +file. .It Ev SHELL If the variable .Ev SHELL Modified: stable/8/usr.bin/script/script.c ============================================================================== --- stable/8/usr.bin/script/script.c Thu Oct 14 00:46:33 2010 (r213816) +++ stable/8/usr.bin/script/script.c Thu Oct 14 01:21:44 2010 (r213817) @@ -236,14 +236,21 @@ void doshell(char **av) { const char *shell; + int k; shell = getenv("SHELL"); if (shell == NULL) shell = _PATH_BSHELL; + if (av[0]) + for (k = 0 ; av[k] ; ++k) + fprintf(fscript, "%s%s", k ? " " : "", av[k]); + fprintf(fscript, "\r\n"); + (void)close(master); (void)fclose(fscript); login_tty(slave); + setenv("SCRIPT", fname, 1); if (av[0]) { execvp(av[0], av); warn("%s", av[0]); From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 01:30:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7E75106564A; Thu, 14 Oct 2010 01:30:40 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 7B4268FC1B; Thu, 14 Oct 2010 01:30:40 +0000 (UTC) Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au (c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o9E1Ubgo019757 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 14 Oct 2010 12:30:38 +1100 Date: Thu, 14 Oct 2010 12:30:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin In-Reply-To: <201010130907.59715.jhb@freebsd.org> Message-ID: <20101014121846.O1092@besplex.bde.org> References: <201010121924.o9CJOgwn059485@svn.freebsd.org> <20101013040543.GB13694@dragon.NUXI.org> <20101013152037.S2102@besplex.bde.org> <201010130907.59715.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, David O'Brien , Bruce Evans Subject: Re: svn commit: r213744 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 01:30:41 -0000 On Wed, 13 Oct 2010, John Baldwin wrote: > On Wednesday, October 13, 2010 12:29:27 am Bruce Evans wrote: >> On Tue, 12 Oct 2010, David O'Brien wrote: >> >>> On Wed, Oct 13, 2010 at 02:18:33PM +1100, Bruce Evans wrote: >>> ... >>>> Of course, debugging and profiling are magic, >>>> but I don't want to have to adorn all functions with STATICs and >>>> __attributes() (and pragmas for othercc...) to recover historical/normal >>>> or variant debugging or profiling of them. >>> >>> I agree, and would not add STATIC's to a program's code that didn't >>> already have them. But in this case we inherited it from 4.4BSD. >>> I'm just making it actually do something other than being a gratuitous >>> spelling change. >>> >>> I believe I've made things more consistent with r213760. >> >> Add __noinline or whatever attributes to STATIC (but keep static in >> it) for the DEBUG >= 3 case if you are going that far. __noinline >> should be a syntax error for variables, so this should also find any >> STATICs still on variables. The spelling fix of changing STATIC to >> what it actually means >> (ASSORTED_HACKS_FOR_DEBUGGING_BUT_NOW_ONLY_FOR_FUNCTIONS) goes too far >> for me. > > To be honest, I think changing STATIC is excessive churn. I agree, but 'static' was already spelled 'STATIC' in all cases without style bugs (except in the #define of STATIC). Adding __noinline to the #define of STATIC is a small change. > The "right" fix > is to use 'make DEBUG_FLAGS="-g -DDEBUG=2 -fno-inline"'. I often use > 'make DEBUG_FLAGS="-g -fno-inline"' to workaround excessive inlining when > debugging. I think all of the STATIC changes should just be backed out. Adding -fno-inline on the command line is more flexible, but might change the generated code too much. Sometimes you want to keep all the little inline functions inline so as not to see them, or just to give the same code for them. -fno-inline-functions-called-once may be more useful. -fno-inline doesn't affect functions declared as __inline, so in the kernel where __inline is used too much, -fno-inline doesn't have such a large effect. Putting the non-inlining flag in the definition of STATIC gives even finer control. But I would only use it if STATIC is already used. I would try the hack of "#define static /**/" or "#define static __noinline_mumble" before changing the source code. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 02:10:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0E78106564A; Thu, 14 Oct 2010 02:10:49 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F3BC8FC1C; Thu, 14 Oct 2010 02:10:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9E2AnjV009198; Thu, 14 Oct 2010 02:10:49 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9E2AnHa009196; Thu, 14 Oct 2010 02:10:49 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010140210.o9E2AnHa009196@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 14 Oct 2010 02:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213825 - stable/8/usr.bin/ruptime X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 02:10:49 -0000 Author: obrien Date: Thu Oct 14 02:10:49 2010 New Revision: 213825 URL: http://svn.freebsd.org/changeset/base/213825 Log: MFC r212771: Increase the hostname display width to >12 characters. Modified: stable/8/usr.bin/ruptime/ruptime.c Directory Properties: stable/8/usr.bin/ruptime/ (props changed) Modified: stable/8/usr.bin/ruptime/ruptime.c ============================================================================== --- stable/8/usr.bin/ruptime/ruptime.c Thu Oct 14 02:02:55 2010 (r213824) +++ stable/8/usr.bin/ruptime/ruptime.c Thu Oct 14 02:10:49 2010 (r213825) @@ -244,12 +244,12 @@ ruptime(const char *host, int aflg, int for (i = 0; i < (int)nhosts; i++) { hsp = &hs[i]; if (ISDOWN(hsp)) { - (void)printf("%-12.12s%s\n", hsp->hs_wd->wd_hostname, + (void)printf("%-25.25s%s\n", hsp->hs_wd->wd_hostname, interval(now - hsp->hs_wd->wd_recvtime, "down")); continue; } (void)printf( - "%-12.12s%s, %4d user%s load %*.2f, %*.2f, %*.2f\n", + "%-25.25s%s, %4d user%s load %*.2f, %*.2f, %*.2f\n", hsp->hs_wd->wd_hostname, interval((time_t)hsp->hs_wd->wd_sendtime - (time_t)hsp->hs_wd->wd_boottime, " up"), From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 02:19:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DB12106564A; Thu, 14 Oct 2010 02:19:53 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C3888FC0C; Thu, 14 Oct 2010 02:19:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9E2JrZw009446; Thu, 14 Oct 2010 02:19:53 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9E2JrTL009444; Thu, 14 Oct 2010 02:19:53 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010140219.o9E2JrTL009444@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 14 Oct 2010 02:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213826 - stable/7/usr.bin/ruptime X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 02:19:53 -0000 Author: obrien Date: Thu Oct 14 02:19:53 2010 New Revision: 213826 URL: http://svn.freebsd.org/changeset/base/213826 Log: MFC r212771: Increase the hostname display width to >12 characters. Modified: stable/7/usr.bin/ruptime/ruptime.c Directory Properties: stable/7/usr.bin/ruptime/ (props changed) Modified: stable/7/usr.bin/ruptime/ruptime.c ============================================================================== --- stable/7/usr.bin/ruptime/ruptime.c Thu Oct 14 02:10:49 2010 (r213825) +++ stable/7/usr.bin/ruptime/ruptime.c Thu Oct 14 02:19:53 2010 (r213826) @@ -244,12 +244,12 @@ ruptime(const char *host, int aflg, int for (i = 0; i < (int)nhosts; i++) { hsp = &hs[i]; if (ISDOWN(hsp)) { - (void)printf("%-12.12s%s\n", hsp->hs_wd->wd_hostname, + (void)printf("%-25.25s%s\n", hsp->hs_wd->wd_hostname, interval(now - hsp->hs_wd->wd_recvtime, "down")); continue; } (void)printf( - "%-12.12s%s, %4d user%s load %*.2f, %*.2f, %*.2f\n", + "%-25.25s%s, %4d user%s load %*.2f, %*.2f, %*.2f\n", hsp->hs_wd->wd_hostname, interval((time_t)hsp->hs_wd->wd_sendtime - (time_t)hsp->hs_wd->wd_boottime, " up"), From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 03:11:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63004106566B; Thu, 14 Oct 2010 03:11:41 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5187A8FC0A; Thu, 14 Oct 2010 03:11:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9E3BfoG010890; Thu, 14 Oct 2010 03:11:41 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9E3BfHg010888; Thu, 14 Oct 2010 03:11:41 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010140311.o9E3BfHg010888@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 14 Oct 2010 03:11: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: r213827 - stable/8/usr.bin/script X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 03:11:41 -0000 Author: obrien Date: Thu Oct 14 03:11:41 2010 New Revision: 213827 URL: http://svn.freebsd.org/changeset/base/213827 Log: MFC r212832: update manpage Modified: stable/8/usr.bin/script/script.1 Directory Properties: stable/8/usr.bin/script/ (props changed) Modified: stable/8/usr.bin/script/script.1 ============================================================================== --- stable/8/usr.bin/script/script.1 Thu Oct 14 02:19:53 2010 (r213826) +++ stable/8/usr.bin/script/script.1 Thu Oct 14 03:11:41 2010 (r213827) @@ -114,7 +114,7 @@ The utility works best with commands that do not manipulate the screen. The results are meant to emulate a hardcopy terminal, not an addressable one. .Sh ENVIRONMENT -The following environment variable is utilized by +The following environment variables are utilized by .Nm : .Bl -tag -width SHELL .It Ev SCRIPT From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 03:13:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3961C106564A; Thu, 14 Oct 2010 03:13:21 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D89D8FC1D; Thu, 14 Oct 2010 03:13:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9E3DKWJ010973; Thu, 14 Oct 2010 03:13:20 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9E3DKE9010970; Thu, 14 Oct 2010 03:13:20 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010140313.o9E3DKE9010970@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 14 Oct 2010 03:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213828 - stable/7/usr.bin/script X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 03:13:21 -0000 Author: obrien Date: Thu Oct 14 03:13:20 2010 New Revision: 213828 URL: http://svn.freebsd.org/changeset/base/213828 Log: MFC r212770 & r212832: + Add the SCRIPT environmental variable to the sub-shell. + Add the 'command' argument (if supplied on the command line) to the typescript file. Modified: stable/7/usr.bin/script/script.1 stable/7/usr.bin/script/script.c Directory Properties: stable/7/usr.bin/script/ (props changed) Modified: stable/7/usr.bin/script/script.1 ============================================================================== --- stable/7/usr.bin/script/script.1 Thu Oct 14 03:11:41 2010 (r213827) +++ stable/7/usr.bin/script/script.1 Thu Oct 14 03:13:20 2010 (r213828) @@ -114,9 +114,22 @@ The utility works best with commands that do not manipulate the screen. The results are meant to emulate a hardcopy terminal, not an addressable one. .Sh ENVIRONMENT -The following environment variable is utilized by +The following environment variables are utilized by .Nm : .Bl -tag -width SHELL +.It Ev SCRIPT +The +.Ev SCRIPT +environment variable is added to the sub-shell. +If +.Ev SCRIPT +already existed in the users environment, +its value is overwritten within the sub-shell. +The value of +.Ev SCRIPT +is the name of the +.Ar typescript +file. .It Ev SHELL If the variable .Ev SHELL Modified: stable/7/usr.bin/script/script.c ============================================================================== --- stable/7/usr.bin/script/script.c Thu Oct 14 03:11:41 2010 (r213827) +++ stable/7/usr.bin/script/script.c Thu Oct 14 03:13:20 2010 (r213828) @@ -241,14 +241,21 @@ void doshell(char **av) { const char *shell; + int k; shell = getenv("SHELL"); if (shell == NULL) shell = _PATH_BSHELL; + if (av[0]) + for (k = 0 ; av[k] ; ++k) + fprintf(fscript, "%s%s", k ? " " : "", av[k]); + fprintf(fscript, "\r\n"); + (void)close(master); (void)fclose(fscript); login_tty(slave); + setenv("SCRIPT", fname, 1); if (av[0]) { execvp(av[0], av); warn("%s", av[0]); From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 08:01:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55F8B1065672; Thu, 14 Oct 2010 08:01:34 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43FD18FC22; Thu, 14 Oct 2010 08:01:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9E81Yaf016947; Thu, 14 Oct 2010 08:01:34 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9E81YNm016945; Thu, 14 Oct 2010 08:01:34 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201010140801.o9E81YNm016945@svn.freebsd.org> From: David Xu Date: Thu, 14 Oct 2010 08:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213829 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 08:01:34 -0000 Author: davidxu Date: Thu Oct 14 08:01:33 2010 New Revision: 213829 URL: http://svn.freebsd.org/changeset/base/213829 Log: In kern_sigtimedwait(), move initialization code out of process lock, instead of using SIGISMEMBER to test every interesting signal, just unmask the signal set and let cursig() return one, get the signal after it returns, call reschedule_signal() after signals are blocked again. In kern_sigprocmask(), don't call reschedule_signal() when it is unnecessary. In reschedule_signal(), replace SIGISEMPTY() + SIGISMEMBER() with sig_ffs(), rename variable 'i' to sig. Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Thu Oct 14 03:13:20 2010 (r213828) +++ head/sys/kern/kern_sig.c Thu Oct 14 08:01:33 2010 (r213829) @@ -466,6 +466,7 @@ sigqueue_move_set(sigqueue_t *src, sigqu SIGSETNAND(src->sq_signals, tmp); } +#if 0 static void sigqueue_move(sigqueue_t *src, sigqueue_t *dst, int signo) { @@ -475,6 +476,7 @@ sigqueue_move(sigqueue_t *src, sigqueue_ SIGADDSET(set, signo); sigqueue_move_set(src, dst, &set); } +#endif static void sigqueue_delete_set(sigqueue_t *sq, const sigset_t *set) @@ -973,7 +975,6 @@ kern_sigprocmask(struct thread *td, int *oset = td->td_sigmask; error = 0; - SIGEMPTYSET(new_block); if (set != NULL) { switch (how) { case SIG_BLOCK: @@ -986,7 +987,7 @@ kern_sigprocmask(struct thread *td, int case SIG_UNBLOCK: SIGSETNAND(td->td_sigmask, *set); signotify(td); - break; + goto out; case SIG_SETMASK: SIG_CANTMASK(*set); oset1 = td->td_sigmask; @@ -1000,22 +1001,23 @@ kern_sigprocmask(struct thread *td, int break; default: error = EINVAL; - break; + goto out; } - } - /* - * The new_block set contains signals that were not previously - * blocked, but are blocked now. - * - * In case we block any signal that was not previously blocked - * for td, and process has the signal pending, try to schedule - * signal delivery to some thread that does not block the signal, - * possibly waking it up. - */ - if (p->p_numthreads != 1) - reschedule_signals(p, new_block, flags); + /* + * The new_block set contains signals that were not previously + * blocked, but are blocked now. + * + * In case we block any signal that was not previously blocked + * for td, and process has the signal pending, try to schedule + * signal delivery to some thread that does not block the + * signal, possibly waking it up. + */ + if (p->p_numthreads != 1) + reschedule_signals(p, new_block, flags); + } +out: if (!(flags & SIGPROCMASK_PROC_LOCKED)) PROC_UNLOCK(p); return (error); @@ -1161,23 +1163,18 @@ kern_sigtimedwait(struct thread *td, sig struct timespec *timeout) { struct sigacts *ps; - sigset_t savedmask; + sigset_t saved_mask, new_block; struct proc *p; - int error, sig, hz, i, timevalid = 0; + int error, sig, timo, timevalid = 0; struct timespec rts, ets, ts; struct timeval tv; p = td->td_proc; error = 0; - sig = 0; ets.tv_sec = 0; ets.tv_nsec = 0; - SIG_CANTMASK(waitset); - PROC_LOCK(p); - ps = p->p_sigacts; - savedmask = td->td_sigmask; - if (timeout) { + if (timeout != NULL) { if (timeout->tv_nsec >= 0 && timeout->tv_nsec < 1000000000) { timevalid = 1; getnanouptime(&rts); @@ -1185,89 +1182,78 @@ kern_sigtimedwait(struct thread *td, sig timespecadd(&ets, timeout); } } - -restart: - for (i = 1; i <= _SIG_MAXSIG; ++i) { - if (!SIGISMEMBER(waitset, i)) - continue; - if (!SIGISMEMBER(td->td_sigqueue.sq_signals, i)) { - if (SIGISMEMBER(p->p_sigqueue.sq_signals, i)) { - sigqueue_move(&p->p_sigqueue, - &td->td_sigqueue, i); - } else - continue; - } - - SIGFILLSET(td->td_sigmask); - SIG_CANTMASK(td->td_sigmask); - SIGDELSET(td->td_sigmask, i); + ksiginfo_init(ksi); + /* Some signals can not be waited for. */ + SIG_CANTMASK(waitset); + ps = p->p_sigacts; + PROC_LOCK(p); + saved_mask = td->td_sigmask; + SIGSETNAND(td->td_sigmask, waitset); + for (;;) { mtx_lock(&ps->ps_mtx); sig = cursig(td, SIG_STOP_ALLOWED); mtx_unlock(&ps->ps_mtx); - if (sig) - goto out; - else { - /* - * Because cursig() may have stopped current thread, - * after it is resumed, things may have already been - * changed, it should rescan any pending signals. - */ - goto restart; + if (sig != 0 && SIGISMEMBER(waitset, sig)) { + if (sigqueue_get(&td->td_sigqueue, sig, ksi) != 0 || + sigqueue_get(&p->p_sigqueue, sig, ksi) != 0) { + error = 0; + break; + } } - } - if (error) - goto out; + if (error != 0) + break; - /* - * POSIX says this must be checked after looking for pending - * signals. - */ - if (timeout) { - if (!timevalid) { - error = EINVAL; - goto out; - } - getnanouptime(&rts); - if (timespeccmp(&rts, &ets, >=)) { - error = EAGAIN; - goto out; + /* + * POSIX says this must be checked after looking for pending + * signals. + */ + if (timeout != NULL) { + if (!timevalid) { + error = EINVAL; + break; + } + getnanouptime(&rts); + if (timespeccmp(&rts, &ets, >=)) { + error = EAGAIN; + break; + } + ts = ets; + timespecsub(&ts, &rts); + TIMESPEC_TO_TIMEVAL(&tv, &ts); + timo = tvtohz(&tv); + } else { + timo = 0; } - ts = ets; - timespecsub(&ts, &rts); - TIMESPEC_TO_TIMEVAL(&tv, &ts); - hz = tvtohz(&tv); - } else - hz = 0; - td->td_sigmask = savedmask; - SIGSETNAND(td->td_sigmask, waitset); - signotify(td); - error = msleep(&ps, &p->p_mtx, PPAUSE|PCATCH, "sigwait", hz); - if (timeout) { - if (error == ERESTART) { - /* timeout can not be restarted. */ - error = EINTR; - } else if (error == EAGAIN) { - /* will calculate timeout by ourself. */ - error = 0; + error = msleep(ps, &p->p_mtx, PPAUSE|PCATCH, "sigwait", timo); + + if (timeout != NULL) { + if (error == ERESTART) { + /* Timeout can not be restarted. */ + error = EINTR; + } else if (error == EAGAIN) { + /* We will calculate timeout by ourself. */ + error = 0; + } } } - goto restart; -out: - td->td_sigmask = savedmask; - signotify(td); - if (sig) { - ksiginfo_init(ksi); - sigqueue_get(&td->td_sigqueue, sig, ksi); - ksi->ksi_signo = sig; + new_block = saved_mask; + SIGSETNAND(new_block, td->td_sigmask); + td->td_sigmask = saved_mask; + /* + * Fewer signals can be delivered to us, reschedule signal + * notification. + */ + if (p->p_numthreads != 1) + reschedule_signals(p, new_block, 0); + if (error == 0) { SDT_PROBE(proc, kernel, , signal_clear, sig, ksi, 0, 0, 0); if (ksi->ksi_code == SI_TIMER) itimer_accept(p, ksi->ksi_timerid, ksi); - error = 0; #ifdef KTRACE if (KTRPOINT(td, KTR_PSIG)) { @@ -2427,25 +2413,22 @@ reschedule_signals(struct proc *p, sigse { struct sigacts *ps; struct thread *td; - int i; + int sig; PROC_LOCK_ASSERT(p, MA_OWNED); - + if (SIGISEMPTY(p->p_siglist)) + return; ps = p->p_sigacts; - for (i = 1; !SIGISEMPTY(block); i++) { - if (!SIGISMEMBER(block, i)) - continue; - SIGDELSET(block, i); - if (!SIGISMEMBER(p->p_siglist, i)) - continue; - - td = sigtd(p, i, 0); + SIGSETAND(block, p->p_siglist); + while ((sig = sig_ffs(&block)) != 0) { + SIGDELSET(block, sig); + td = sigtd(p, sig, 0); signotify(td); if (!(flags & SIGPROCMASK_PS_LOCKED)) mtx_lock(&ps->ps_mtx); - if (p->p_flag & P_TRACED || SIGISMEMBER(ps->ps_sigcatch, i)) - tdsigwakeup(td, i, SIG_CATCH, - (SIGISMEMBER(ps->ps_sigintr, i) ? EINTR : + if (p->p_flag & P_TRACED || SIGISMEMBER(ps->ps_sigcatch, sig)) + tdsigwakeup(td, sig, SIG_CATCH, + (SIGISMEMBER(ps->ps_sigintr, sig) ? EINTR : ERESTART)); if (!(flags & SIGPROCMASK_PS_LOCKED)) mtx_unlock(&ps->ps_mtx); From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 08:36:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9989F1065693; Thu, 14 Oct 2010 08:36:26 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp3.one.com (csmtp3.one.com [91.198.169.23]) by mx1.freebsd.org (Postfix) with ESMTP id 279108FC1B; Thu, 14 Oct 2010 08:36:25 +0000 (UTC) Received: from [192.168.0.22] (0x573fa596.cpe.ge-1-1-0-1109.ronqu1.customer.tele.dk [87.63.165.150]) by csmtp3.one.com (Postfix) with ESMTP id 48FFF240FA0D; Thu, 14 Oct 2010 08:36:24 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: multipart/signed; boundary=Apple-Mail-2454--499461299; protocol="application/pkcs7-signature"; micalg=sha1 From: Erik Cederstrand In-Reply-To: <20101013143845.I1817@besplex.bde.org> Date: Thu, 14 Oct 2010 10:36:23 +0200 Message-Id: <5D7F8DAF-E127-41C0-927B-1D72EFC8F4C4@cederstrand.dk> References: <201010090531.o995V8n3026865@svn.freebsd.org> <8C667EA1-3012-4499-BCCE-58263165663B@cederstrand.dk> <20101010083725.S3587@besplex.bde.org> <2A26ECE8-7713-49C4-8706-5AA5B232BE29@cederstrand.dk> <20101013143845.I1817@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1081) X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Tim Kientzle , src-committers@freebsd.org, Ben Kaduk Subject: Re: svn commit: r213643 - head/usr.bin/ar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 08:36:26 -0000 --Apple-Mail-2454--499461299 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Den 13/10/2010 kl. 05.55 skrev Bruce Evans: > I also don't like distributions that stamp every file with their = release > build time (or maybe a little later, with a single release time). How = would > do you prevent clobbering metadata outside of archives? What I do is = install > with -C -p (and also -v -v to report changes), and then compare = installed > copies or just look at the install -v -v output. What does install(1) do to determine if files are different, if not = mtime, size or checksums? Metadata like OBJDIR, SRCDIR, timestamps and = user email address might still differ, even though the binaries are = functionally equivalent. Would strip(1) or objcopy(1) be able to remove = or alter these? >> I'm a real beginner here. As I read the manuals (GNU ar and BSD ar), = the only flags that really control archive contents on archive creation = is 'q' and 'r'. The 'l' is ignored, 'c' and 'v' control verbosity, and = 'u' and 's' are for performance purposes that are largely irrelevant = today (extracting every single *.a file and recreating it wit ar -rD = takes less than 10 secs on my slow machine). Is there any negative = impact at runtime from having all archives created with either -rD or = -qD (ignoring verbosity at build time for now)? >=20 > I don't really know. 's' is also useful for non-libraries. 'u' is = related > to clobbering times, but goes the wrong way by updating the archive if = the > file is newer. I think all FreeBSD libraries should be built with the = same > flags (probably ARFLAGS, with you putting -D in it if you don't want = the > timestamp update). However, the places that already use ARFLAGS but = set it > themselves may be a problem. Some Makefiles initentionally avoid = using > bsd.lib.mk because they are special and it does the wrong things for = them. > They probably don't really care about the exact archive flags, but = need to > be checked individually. I'd like to give it a try. This is where an easy-to-use regression suite = with reasonable coverage for FreeBSD would come in handy :-) Thanks, Erik= --Apple-Mail-2454--499461299-- From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 09:29:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4818106566C; Thu, 14 Oct 2010 09:29:59 +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 A2BFC8FC1E; Thu, 14 Oct 2010 09:29:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9E9TxY6018894; Thu, 14 Oct 2010 09:29:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9E9TxcF018892; Thu, 14 Oct 2010 09:29:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010140929.o9E9TxcF018892@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 14 Oct 2010 09:29: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: r213830 - stable/8/sys/fs/msdosfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 09:29:59 -0000 Author: kib Date: Thu Oct 14 09:29:59 2010 New Revision: 213830 URL: http://svn.freebsd.org/changeset/base/213830 Log: MFC r213508: Explicitely call cache_purge(fvp) when msdosfs_rename() succeeded, to flush aliases created due to msdosfs being case-insensitive. MFC r213543: Add a comment describing the reason for calling cache_purge(fvp). Modified: stable/8/sys/fs/msdosfs/msdosfs_vnops.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_vnops.c Thu Oct 14 08:01:33 2010 (r213829) +++ stable/8/sys/fs/msdosfs/msdosfs_vnops.c Thu Oct 14 09:29:59 2010 (r213830) @@ -1270,6 +1270,14 @@ abortit: } } + /* + * The msdosfs lookup is case insensitive. Several aliases may + * be inserted for a single directory entry. As a consequnce, + * name cache purge done by lookup for fvp when DELETE op for + * namei is specified, might be not enough to expunge all + * namecache entries that were installed for this direntry. + */ + cache_purge(fvp); VOP_UNLOCK(fvp, 0); bad: if (xp) From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 11:20:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8256D10656A7; Thu, 14 Oct 2010 11:20:23 +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 71A698FC3A; Thu, 14 Oct 2010 11:20:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EBKNZ5022815; Thu, 14 Oct 2010 11:20:23 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EBKNxX022813; Thu, 14 Oct 2010 11:20:23 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201010141120.o9EBKNxX022813@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 14 Oct 2010 11:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213831 - head/usr.sbin/ntp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 11:20:23 -0000 Author: glebius Date: Thu Oct 14 11:20:23 2010 New Revision: 213831 URL: http://svn.freebsd.org/changeset/base/213831 Log: Enable the shared memory reference clock driver. The GPS devices are getting more and more popular, as source of precise time, and the gpsd daemon from ports is using the shared memory to synchronize with ntpd. Reviewed by: roberto Modified: head/usr.sbin/ntp/config.h Modified: head/usr.sbin/ntp/config.h ============================================================================== --- head/usr.sbin/ntp/config.h Thu Oct 14 09:29:59 2010 (r213830) +++ head/usr.sbin/ntp/config.h Thu Oct 14 11:20:23 2010 (r213831) @@ -126,7 +126,7 @@ /* #undef CLOCK_SCHMID */ /* clock thru shared memory */ -/* #undef CLOCK_SHM */ +#define CLOCK_SHM /* Spectracom 8170/Netclock/2 WWVB receiver */ /* #undef CLOCK_SPECTRACOM */ From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 12:32:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1206A106564A; Thu, 14 Oct 2010 12:32:50 +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 00B7C8FC17; Thu, 14 Oct 2010 12:32:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ECWn5l024353; Thu, 14 Oct 2010 12:32:49 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ECWnsv024351; Thu, 14 Oct 2010 12:32:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201010141232.o9ECWnsv024351@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 14 Oct 2010 12:32:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213832 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 12:32:50 -0000 Author: bz Date: Thu Oct 14 12:32:49 2010 New Revision: 213832 URL: http://svn.freebsd.org/changeset/base/213832 Log: Use ifa_ifwithaddr_check() rather than ifa_ifwithaddr() as we are not interested in the result and would leak a reference otherwise. PR: kern/151435 Submitted by: Andrew Boyer (aboyer averesystems.com) MFC after: 3 days Modified: head/sys/netinet/ip_options.c Modified: head/sys/netinet/ip_options.c ============================================================================== --- head/sys/netinet/ip_options.c Thu Oct 14 11:20:23 2010 (r213831) +++ head/sys/netinet/ip_options.c Thu Oct 14 12:32:49 2010 (r213832) @@ -341,7 +341,7 @@ dropit: } (void)memcpy(&ipaddr.sin_addr, sin, sizeof(struct in_addr)); - if (ifa_ifwithaddr((SA)&ipaddr) == NULL) + if (ifa_ifwithaddr_check((SA)&ipaddr) == 0) continue; cp[IPOPT_OFFSET] += sizeof(struct in_addr); off += sizeof(struct in_addr); From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 13:56:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B894B1065679; Thu, 14 Oct 2010 13:56:26 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5A488FC18; Thu, 14 Oct 2010 13:56:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EDuQhW026105; Thu, 14 Oct 2010 13:56:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EDuQwS026103; Thu, 14 Oct 2010 13:56:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201010141356.o9EDuQwS026103@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 14 Oct 2010 13:56: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: r213833 - stable/8/libexec/rtld-elf/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 13:56:26 -0000 Author: nwhitehorn Date: Thu Oct 14 13:56:26 2010 New Revision: 213833 URL: http://svn.freebsd.org/changeset/base/213833 Log: MFC r213406: Fix two subtle problems in PPC32 RTLD. The first is a concurrency issue where long PLT calls in multi-threaded environments could end up with incorrect jmptab values. The second is that, after the addition of extended PLT support, I forgot to update the PLT icache synchronization code to cover the extended PLT instead of just the basic PLT. Modified: stable/8/libexec/rtld-elf/powerpc/reloc.c Directory Properties: stable/8/libexec/rtld-elf/ (props changed) Modified: stable/8/libexec/rtld-elf/powerpc/reloc.c ============================================================================== --- stable/8/libexec/rtld-elf/powerpc/reloc.c Thu Oct 14 12:32:49 2010 (r213832) +++ stable/8/libexec/rtld-elf/powerpc/reloc.c Thu Oct 14 13:56:26 2010 (r213833) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include "debug.h" @@ -485,6 +486,7 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr jmptab = obj->pltgot + JMPTAB_BASE(N); jmptab[reloff] = target; + powerpc_mb(); /* Order jmptab update before next changes */ if (reloff < PLT_EXTENDED_BEGIN) { /* for extended PLT entries, we keep the old code */ @@ -493,7 +495,8 @@ reloc_jmpslot(Elf_Addr *wherep, Elf_Addr /* li r11,reloff */ /* b pltcall # use indirect pltcall routine */ - wherep[0] = 0x39600000 | reloff; + + /* first instruction same as before */ wherep[1] = 0x48000000 | (distance & 0x03fffffc); __syncicache(wherep, 8); } @@ -581,7 +584,7 @@ init_pltgot(Obj_Entry *obj) * Sync the icache for the byte range represented by the * trampoline routines and call slots. */ - __syncicache(pltcall, 72 + N * 8); + __syncicache(obj->pltgot, JMPTAB_BASE(N)*4); } void From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 14:25:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55DE71065679; Thu, 14 Oct 2010 14:25:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 21A828FC18; Thu, 14 Oct 2010 14:25:05 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id CAF5246C0F; Thu, 14 Oct 2010 10:25:04 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5A2AC8A009; Thu, 14 Oct 2010 10:25:03 -0400 (EDT) From: John Baldwin To: Matthew D Fleming Date: Thu, 14 Oct 2010 09:14:27 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201010132259.o9DMx43Z003612@svn.freebsd.org> In-Reply-To: <201010132259.o9DMx43Z003612@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201010140914.27677.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 14 Oct 2010 10:25:03 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213813 - in head: share/man/man9 sys/kern sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 14:25:05 -0000 On Wednesday, October 13, 2010 6:59:04 pm Matthew D Fleming wrote: > Author: mdf > Date: Wed Oct 13 22:59:04 2010 > New Revision: 213813 > URL: http://svn.freebsd.org/changeset/base/213813 > > Log: > Use a safer mechanism for determining if a task is currently running, > that does not rely on the lifetime of pointers being the same. This also > restores the task KBI. > > Suggested by: jhb > MFC after: 1 month Thanks! -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 14:48:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCAAF1065696; Thu, 14 Oct 2010 14:48:11 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BACCD8FC17; Thu, 14 Oct 2010 14:48:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EEmB5V027327; Thu, 14 Oct 2010 14:48:11 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EEmBOK027325; Thu, 14 Oct 2010 14:48:11 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201010141448.o9EEmBOK027325@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 14 Oct 2010 14:48:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213835 - head/gnu/usr.bin/groff/tmac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 14:48:11 -0000 Author: jh Date: Thu Oct 14 14:48:11 2010 New Revision: 213835 URL: http://svn.freebsd.org/changeset/base/213835 Log: Add FreeBSD 8.2. Reviewed by: ru MFC after: 3 days Modified: head/gnu/usr.bin/groff/tmac/mdoc.local Modified: head/gnu/usr.bin/groff/tmac/mdoc.local ============================================================================== --- head/gnu/usr.bin/groff/tmac/mdoc.local Thu Oct 14 14:13:44 2010 (r213834) +++ head/gnu/usr.bin/groff/tmac/mdoc.local Thu Oct 14 14:48:11 2010 (r213835) @@ -79,6 +79,7 @@ .ds doc-operating-system-FreeBSD-7.4 7.4 .ds doc-operating-system-FreeBSD-8.0 8.0 .ds doc-operating-system-FreeBSD-8.1 8.1 +.ds doc-operating-system-FreeBSD-8.2 8.2 .ds doc-operating-system-FreeBSD-9.0 9.0 . .\" Definitions not (yet) in doc-syms From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 14:49:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B75381065696; Thu, 14 Oct 2010 14:49:49 +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 A5A858FC19; Thu, 14 Oct 2010 14:49:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EEnnPt027388; Thu, 14 Oct 2010 14:49:49 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EEnneE027386; Thu, 14 Oct 2010 14:49:49 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201010141449.o9EEnneE027386@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 14 Oct 2010 14:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213836 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 14:49:49 -0000 Author: bz Date: Thu Oct 14 14:49:49 2010 New Revision: 213836 URL: http://svn.freebsd.org/changeset/base/213836 Log: Style: make the asterisk go with the variable name, not the type. MFC after: 3 days Modified: head/sys/netipsec/ipsec_output.c Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Thu Oct 14 14:48:11 2010 (r213835) +++ head/sys/netipsec/ipsec_output.c Thu Oct 14 14:49:49 2010 (r213836) @@ -758,7 +758,7 @@ ipsec6_output_tunnel(struct ipsec_output struct ipsecrequest *isr; struct secasindex saidx; int error; - struct sockaddr_in6* dst6; + struct sockaddr_in6 *dst6; struct mbuf *m; IPSEC_ASSERT(state != NULL, ("null state")); From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 15:11:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E7A91065672 for ; Thu, 14 Oct 2010 15:11:10 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay02.pair.com (relay02.pair.com [209.68.5.16]) by mx1.freebsd.org (Postfix) with SMTP id 1FF2B8FC1A for ; Thu, 14 Oct 2010 15:11:09 +0000 (UTC) Received: (qmail 86897 invoked from network); 14 Oct 2010 14:44:29 -0000 Received: from 93.166.52.54 (HELO x2.osted.lan) (93.166.52.54) by relay02.pair.com with SMTP; 14 Oct 2010 14:44:29 -0000 X-pair-Authenticated: 93.166.52.54 Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.3/8.14.3) with ESMTP id o9EEiNuC023539; Thu, 14 Oct 2010 16:44:23 +0200 (CEST) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.3/8.14.3/Submit) id o9EEiNIJ023538; Thu, 14 Oct 2010 16:44:23 +0200 (CEST) (envelope-from pho) Date: Thu, 14 Oct 2010 16:44:23 +0200 From: Peter Holm To: David Xu Message-ID: <20101014144423.GA23363@x2.osted.lan> References: <201010120036.o9C0aueg032391@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201010120036.o9C0aueg032391@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213714 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 15:11:10 -0000 On Tue, Oct 12, 2010 at 12:36:56AM +0000, David Xu wrote: > Author: davidxu > Date: Tue Oct 12 00:36:56 2010 > New Revision: 213714 > URL: http://svn.freebsd.org/changeset/base/213714 > > Log: > Add a flag TDF_TIDHASH to prevent a thread from being > added to or removed from thread hash table multiple times. > > Modified: > head/sys/kern/kern_thread.c > head/sys/sys/proc.h > > Modified: head/sys/kern/kern_thread.c > ============================================================================== > --- head/sys/kern/kern_thread.c Mon Oct 11 23:24:57 2010 (r213713) Is this the same problem? panic: Bad link elm 0xc767e870 next->prev != elm on r213828. http://people.freebsd.org/~pho/stress/log/leopard3.002.txt - Peter From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 15:15:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90A4A10656A4; Thu, 14 Oct 2010 15:15:22 +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 7F1398FC1D; Thu, 14 Oct 2010 15:15:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EFFMbG028043; Thu, 14 Oct 2010 15:15:22 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EFFMeO028041; Thu, 14 Oct 2010 15:15:22 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201010141515.o9EFFMeO028041@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 14 Oct 2010 15:15:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213837 - head/sys/netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 15:15:22 -0000 Author: bz Date: Thu Oct 14 15:15:22 2010 New Revision: 213837 URL: http://svn.freebsd.org/changeset/base/213837 Log: Remove dead code: assignment to a local variable not used anywhere after that. MFC after: 3 days Modified: head/sys/netipsec/ipsec_output.c Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Thu Oct 14 14:49:49 2010 (r213836) +++ head/sys/netipsec/ipsec_output.c Thu Oct 14 15:15:22 2010 (r213837) @@ -853,10 +853,8 @@ ipsec6_output_tunnel(struct ipsec_output } /* adjust state->dst if tunnel endpoint is offlink */ - if (state->ro->ro_rt->rt_flags & RTF_GATEWAY) { + if (state->ro->ro_rt->rt_flags & RTF_GATEWAY) state->dst = (struct sockaddr *)state->ro->ro_rt->rt_gateway; - dst6 = (struct sockaddr_in6 *)state->dst; - } } m = ipsec6_splithdr(m); From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 15:52:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 082A1106564A; Thu, 14 Oct 2010 15:52:46 +0000 (UTC) (envelope-from john@jnielsen.net) Received: from ns1temp.jnielsen.net (ns1temp.jnielsen.net [69.55.230.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9F40D8FC14; Thu, 14 Oct 2010 15:52:46 +0000 (UTC) Received: from jnielsen.socialserve.com ([12.53.251.10]) (authenticated bits=0) by ns1temp.jnielsen.net (8.14.3/8.14.3) with ESMTP id o9EFIJo8016976 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Thu, 14 Oct 2010 11:18:19 -0400 (EDT) (envelope-from john@jnielsen.net) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: John Nielsen In-Reply-To: <201010131033.o9DAX1EE080534@svn.freebsd.org> Date: Thu, 14 Oct 2010 11:18:08 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <80A99C4D-ACAF-45CD-BE51-3B7560A85D96@jnielsen.net> References: <201010131033.o9DAX1EE080534@svn.freebsd.org> To: Rui Paulo X-Mailer: Apple Mail (2.1081) X-DCC-sonic.net-Metrics: ns1temp.jnielsen.net; whitelist X-Virus-Scanned: clamav-milter 0.96.3 at ns1temp.jnielsen.net X-Virus-Status: Clean Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213765 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 15:52:47 -0000 I'm migrating a box from 8-STABLE to -CURRENT this morning and this = commit seems to break buildkernel: cc -O2 -pipe -nostdinc -I/usr/include -I. = -I/usr/src/sys/dev/aic7xxx/aicasm -std=3Dgnu99 -Wsystem-headers -Werror = -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes = -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual = -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align = -Wno-pointer-sign -c aicasm_scan.c cc1: warnings being treated as errors /usr/src/sys/dev/aic7xxx/aicasm/aicasm_scan.l:840: warning: function = declaration isn't a prototype *** Error code 1 I don't have any custom CFLAGS, etc defined. Commenting out the new = #defines from this patch allows the build to continue. I'm guessing this doesn't happen on machines already running -CURRENT or = tinderbox (and others) would have noticed. However if this is (going to = be) a supported upgrade path from 8.x to 9.0 perhaps there's a way to = make both clang and gcc from 8.x happy? JN On Oct 13, 2010, at 6:33 AM, Rui Paulo wrote: > Author: rpaulo > Date: Wed Oct 13 10:33:01 2010 > New Revision: 213765 > URL: http://svn.freebsd.org/changeset/base/213765 >=20 > Log: > Define YY_NO_INPUT. This makes aicasm buildable by clang with Werror > turned on. >=20 > Modified: > head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l > head/sys/dev/aic7xxx/aicasm/aicasm_scan.l >=20 > Modified: head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l Wed Oct 13 = 10:31:32 2010 (r213764) > +++ head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l Wed Oct 13 = 10:33:01 2010 (r213765) > @@ -61,6 +61,7 @@ > #include "aicasm_symbol.h" > #include "aicasm_macro_gram.h" >=20 > +#define YY_NO_INPUT > #define MAX_STR_CONST 4096 > static char string_buf[MAX_STR_CONST]; > static char *string_buf_ptr; >=20 > Modified: head/sys/dev/aic7xxx/aicasm/aicasm_scan.l > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Wed Oct 13 10:31:32 2010 = (r213764) > +++ head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Wed Oct 13 10:33:01 2010 = (r213765) > @@ -61,6 +61,7 @@ > #include "aicasm_symbol.h" > #include "aicasm_gram.h" >=20 > +#define YY_NO_INPUT > /* This is used for macro body capture too, so err on the large size. = */ > #define MAX_STR_CONST 4096 > static char string_buf[MAX_STR_CONST]; > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to = "svn-src-head-unsubscribe@freebsd.org" >=20 From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 16:17:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id A228E1065672; Thu, 14 Oct 2010 16:17:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Nielsen Date: Thu, 14 Oct 2010 12:17:28 -0400 User-Agent: KMail/1.6.2 References: <201010131033.o9DAX1EE080534@svn.freebsd.org> <80A99C4D-ACAF-45CD-BE51-3B7560A85D96@jnielsen.net> In-Reply-To: <80A99C4D-ACAF-45CD-BE51-3B7560A85D96@jnielsen.net> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010141217.45403.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo Subject: Re: svn commit: r213765 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 16:17:53 -0000 On Thursday 14 October 2010 11:18 am, John Nielsen wrote: > I'm migrating a box from 8-STABLE to -CURRENT this morning and this > commit seems to break buildkernel: > > cc -O2 -pipe -nostdinc -I/usr/include -I. > -I/usr/src/sys/dev/aic7xxx/aicasm -std=gnu99 -Wsystem-headers > -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter > -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith > -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow > -Wunused-parameter -Wcast-align -Wno-pointer-sign -c aicasm_scan.c > cc1: warnings being treated as errors > /usr/src/sys/dev/aic7xxx/aicasm/aicasm_scan.l:840: warning: > function declaration isn't a prototype *** Error code 1 > > I don't have any custom CFLAGS, etc defined. Commenting out the new > #defines from this patch allows the build to continue. > > I'm guessing this doesn't happen on machines already running > -CURRENT or tinderbox (and others) would have noticed. However if > this is (going to be) a supported upgrade path from 8.x to 9.0 > perhaps there's a way to make both clang and gcc from 8.x happy? If you want to upgrade from N to N+1, "make buildworld" is required. Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 16:22:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 724A1106566B; Thu, 14 Oct 2010 16:22:47 +0000 (UTC) (envelope-from john@jnielsen.net) Received: from ns1temp.jnielsen.net (ns1temp.jnielsen.net [69.55.230.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4F4068FC14; Thu, 14 Oct 2010 16:22:47 +0000 (UTC) Received: from jnielsen.socialserve.com ([12.53.251.10]) (authenticated bits=0) by ns1temp.jnielsen.net (8.14.3/8.14.3) with ESMTP id o9EGMe7D085061 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Thu, 14 Oct 2010 12:22:41 -0400 (EDT) (envelope-from john@jnielsen.net) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: John Nielsen In-Reply-To: <201010141217.45403.jkim@FreeBSD.org> Date: Thu, 14 Oct 2010 12:22:34 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201010131033.o9DAX1EE080534@svn.freebsd.org> <80A99C4D-ACAF-45CD-BE51-3B7560A85D96@jnielsen.net> <201010141217.45403.jkim@FreeBSD.org> To: Jung-uk Kim X-Mailer: Apple Mail (2.1081) X-DCC-sonic.net-Metrics: ns1temp.jnielsen.net; whitelist X-Virus-Scanned: clamav-milter 0.96.3 at ns1temp.jnielsen.net X-Virus-Status: Clean Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo Subject: Re: svn commit: r213765 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 16:22:47 -0000 On Oct 14, 2010, at 12:17 PM, Jung-uk Kim wrote: > On Thursday 14 October 2010 11:18 am, John Nielsen wrote: >> I'm migrating a box from 8-STABLE to -CURRENT this morning and this >> commit seems to break buildkernel: >>=20 >> cc -O2 -pipe -nostdinc -I/usr/include -I. >> -I/usr/src/sys/dev/aic7xxx/aicasm -std=3Dgnu99 -Wsystem-headers >> -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter >> -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith >> -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow >> -Wunused-parameter -Wcast-align -Wno-pointer-sign -c aicasm_scan.c >> cc1: warnings being treated as errors >> /usr/src/sys/dev/aic7xxx/aicasm/aicasm_scan.l:840: warning: >> function declaration isn't a prototype *** Error code 1 >>=20 >> I don't have any custom CFLAGS, etc defined. Commenting out the new >> #defines from this patch allows the build to continue. >>=20 >> I'm guessing this doesn't happen on machines already running >> -CURRENT or tinderbox (and others) would have noticed. However if >> this is (going to be) a supported upgrade path from 8.x to 9.0 >> perhaps there's a way to make both clang and gcc from 8.x happy? >=20 > If you want to upgrade from N to N+1, "make buildworld" is required. Sorry, I did do a "make buildworld" (which succeeded) prior to the "make = buildkernel" (which failed as I described).= From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 16:41:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8A84106566B; Thu, 14 Oct 2010 16:41:47 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 386A68FC13; Thu, 14 Oct 2010 16:41:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.4/8.14.4) with ESMTP id o9EGfjp2085530; Thu, 14 Oct 2010 20:41:45 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Thu, 14 Oct 2010 20:41:45 +0400 (MSD) From: Dmitry Morozovsky To: John Nielsen In-Reply-To: Message-ID: References: <201010131033.o9DAX1EE080534@svn.freebsd.org> <80A99C4D-ACAF-45CD-BE51-3B7560A85D96@jnielsen.net> <201010141217.45403.jkim@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (woozle.rinet.ru [0.0.0.0]); Thu, 14 Oct 2010 20:41:45 +0400 (MSD) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo , Jung-uk Kim Subject: Re: svn commit: r213765 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 16:41:47 -0000 On Thu, 14 Oct 2010, John Nielsen wrote: JN> >> I'm migrating a box from 8-STABLE to -CURRENT this morning and this JN> >> commit seems to break buildkernel: JN> >> JN> >> cc -O2 -pipe -nostdinc -I/usr/include -I. JN> >> -I/usr/src/sys/dev/aic7xxx/aicasm -std=gnu99 -Wsystem-headers JN> >> -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter JN> >> -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith JN> >> -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow JN> >> -Wunused-parameter -Wcast-align -Wno-pointer-sign -c aicasm_scan.c JN> >> cc1: warnings being treated as errors JN> >> /usr/src/sys/dev/aic7xxx/aicasm/aicasm_scan.l:840: warning: JN> >> function declaration isn't a prototype *** Error code 1 JN> >> JN> >> I don't have any custom CFLAGS, etc defined. Commenting out the new JN> >> #defines from this patch allows the build to continue. JN> >> JN> >> I'm guessing this doesn't happen on machines already running JN> >> -CURRENT or tinderbox (and others) would have noticed. However if JN> >> this is (going to be) a supported upgrade path from 8.x to 9.0 JN> >> perhaps there's a way to make both clang and gcc from 8.x happy? JN> > JN> > If you want to upgrade from N to N+1, "make buildworld" is required. JN> JN> Sorry, I did do a "make buildworld" (which succeeded) prior to the "make buildkernel" (which failed as I described). I can confirm this: my build machine, which is FreeBSD beaver.rinet.ru 8.1-STABLE FreeBSD 8.1-STABLE #1 r213380M: Sun Oct 3 13:25:15 MSD 2010 is now failing 'buildworld buildkernel __MAKE_CONF=/dev/null' for HEAD sources both for TARGET=amd64 and i386 -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 16:44:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 259E0106564A; Thu, 14 Oct 2010 16:44:06 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12F908FC13; Thu, 14 Oct 2010 16:44:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EGi5Ts030176; Thu, 14 Oct 2010 16:44:05 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EGi5GH030172; Thu, 14 Oct 2010 16:44:05 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201010141644.o9EGi5GH030172@svn.freebsd.org> From: Matthew D Fleming Date: Thu, 14 Oct 2010 16:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213839 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 16:44:06 -0000 Author: mdf Date: Thu Oct 14 16:44:05 2010 New Revision: 213839 URL: http://svn.freebsd.org/changeset/base/213839 Log: Re-work the internals of adding items to the driver's scatter-gather list. Use the new internals to simplify adding transaction context elements, and in future diffs, more complicated SGLs. Modified: head/sys/dev/mps/mps.c head/sys/dev/mps/mps_user.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Thu Oct 14 15:42:32 2010 (r213838) +++ head/sys/dev/mps/mps.c Thu Oct 14 16:44:05 2010 (r213839) @@ -380,7 +380,7 @@ mps_request_sync(struct mps_softc *sc, v return (0); } -static void +void mps_enqueue_request(struct mps_softc *sc, struct mps_command *cm) { @@ -1374,33 +1374,88 @@ mps_deregister_events(struct mps_softc * return (mps_update_events(sc, NULL, NULL)); } -static void -mps_data_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +/* + * Add a chain element as the next SGE for the specified command. + * Reset cm_sge and cm_sgesize to indicate all the available space. + */ +static int +mps_add_chain(struct mps_command *cm) { - MPI2_SGE_SIMPLE64 *sge; MPI2_SGE_CHAIN32 *sgc; - struct mps_softc *sc; - struct mps_command *cm; struct mps_chain *chain; - u_int i, segsleft, sglspace, dir, flags, sflags; + int space; - cm = (struct mps_command *)arg; - sc = cm->cm_sc; + if (cm->cm_sglsize < MPS_SGC_SIZE) + panic("MPS: Need SGE Error Code\n"); - segsleft = nsegs; - sglspace = cm->cm_sglsize; - sge = (MPI2_SGE_SIMPLE64 *)&cm->cm_sge->MpiSimple; + chain = mps_alloc_chain(cm->cm_sc); + if (chain == NULL) + return (ENOBUFS); + + space = (int)cm->cm_sc->facts->IOCRequestFrameSize * 4; /* - * Set up DMA direction flags. Note no support for - * bi-directional transactions. + * Note: a double-linked list is used to make it easier to + * walk for debugging. */ - sflags = MPI2_SGE_FLAGS_ADDRESS_SIZE; - if (cm->cm_flags & MPS_CM_FLAGS_DATAOUT) { - sflags |= MPI2_SGE_FLAGS_DIRECTION; - dir = BUS_DMASYNC_PREWRITE; - } else - dir = BUS_DMASYNC_PREREAD; + TAILQ_INSERT_TAIL(&cm->cm_chain_list, chain, chain_link); + + sgc = (MPI2_SGE_CHAIN32 *)&cm->cm_sge->MpiChain; + sgc->Length = space; + sgc->NextChainOffset = 0; + sgc->Flags = MPI2_SGE_FLAGS_CHAIN_ELEMENT; + sgc->Address = chain->chain_busaddr; + + cm->cm_sge = (MPI2_SGE_IO_UNION *)&chain->chain->MpiSimple; + cm->cm_sglsize = space; + return (0); +} + +/* + * Add one scatter-gather element (chain, simple, transaction context) + * to the scatter-gather list for a command. Maintain cm_sglsize and + * cm_sge as the remaining size and pointer to the next SGE to fill + * in, respectively. + */ +int +mps_push_sge(struct mps_command *cm, void *sgep, size_t len, int segsleft) +{ + MPI2_SGE_TRANSACTION_UNION *tc = sgep; + MPI2_SGE_SIMPLE64 *sge = sgep; + int error, type; + + type = (tc->Flags & MPI2_SGE_FLAGS_ELEMENT_MASK); + +#ifdef INVARIANTS + switch (type) { + case MPI2_SGE_FLAGS_TRANSACTION_ELEMENT: { + if (len != tc->DetailsLength + 4) + panic("TC %p length %u or %zu?", tc, + tc->DetailsLength + 4, len); + } + break; + case MPI2_SGE_FLAGS_CHAIN_ELEMENT: + /* Driver only uses 32-bit chain elements */ + if (len != MPS_SGC_SIZE) + panic("CHAIN %p length %u or %zu?", sgep, + MPS_SGC_SIZE, len); + break; + case MPI2_SGE_FLAGS_SIMPLE_ELEMENT: + /* Driver only uses 64-bit SGE simple elements */ + sge = sgep; + if (len != MPS_SGE64_SIZE) + panic("SGE simple %p length %u or %zu?", sge, + MPS_SGE64_SIZE, len); + if (((sge->FlagsLength >> MPI2_SGE_FLAGS_SHIFT) & + MPI2_SGE_FLAGS_ADDRESS_SIZE) == 0) + panic("SGE simple %p flags %02x not marked 64-bit?", + sge, sge->FlagsLength >> MPI2_SGE_FLAGS_SHIFT); + + break; + default: + panic("Unexpected SGE %p, flags %02x", tc, tc->Flags); + } +#endif /* * case 1: 1 more segment, enough room for it @@ -1408,70 +1463,128 @@ mps_data_cb(void *arg, bus_dma_segment_t * case 3: >=2 more segments, only enough room for 1 and a chain * case 4: >=1 more segment, enough room for only a chain * case 5: >=1 more segment, no room for anything (error) - */ + */ - for (i = 0; i < nsegs; i++) { + /* + * There should be room for at least a chain element, or this + * code is buggy. Case (5). + */ + if (cm->cm_sglsize < MPS_SGC_SIZE) + panic("MPS: Need SGE Error Code\n"); - /* Case 5 Error. This should never happen. */ - if (sglspace < MPS_SGC_SIZE) { - panic("MPS: Need SGE Error Code\n"); + if (segsleft >= 2 && + cm->cm_sglsize < len + MPS_SGC_SIZE + MPS_SGE64_SIZE) { + /* + * There are 2 or more segments left to add, and only + * enough room for 1 and a chain. Case (3). + * + * Mark as last element in this chain if necessary. + */ + if (type == MPI2_SGE_FLAGS_SIMPLE_ELEMENT) { + sge->FlagsLength |= + (MPI2_SGE_FLAGS_LAST_ELEMENT << MPI2_SGE_FLAGS_SHIFT); } /* - * Case 4, Fill in a chain element, allocate a chain, - * fill in one SGE element, continue. + * Add the item then a chain. Do the chain now, + * rather than on the next iteration, to simplify + * understanding the code. */ - if ((sglspace >= MPS_SGC_SIZE) && (sglspace < MPS_SGE64_SIZE)) { - chain = mps_alloc_chain(sc); - if (chain == NULL) { - /* Resource shortage, roll back! */ - mps_printf(sc, "out of chain frames\n"); - return; - } + cm->cm_sglsize -= len; + bcopy(sgep, cm->cm_sge, len); + cm->cm_sge = (MPI2_SGE_IO_UNION *)((uintptr_t)cm->cm_sge + len); + return (mps_add_chain(cm)); + } - /* - * Note: a double-linked list is used to make it - * easier to walk for debugging. - */ - TAILQ_INSERT_TAIL(&cm->cm_chain_list, chain,chain_link); - - sgc = (MPI2_SGE_CHAIN32 *)sge; - sgc->Length = 128; - sgc->NextChainOffset = 0; - sgc->Flags = MPI2_SGE_FLAGS_CHAIN_ELEMENT; - sgc->Address = chain->chain_busaddr; + if (segsleft >= 1 && cm->cm_sglsize < len + MPS_SGC_SIZE) { + /* + * 1 or more segment, enough room for only a chain. + * Hope the previous element wasn't a Simple entry + * that needed to be marked with + * MPI2_SGE_FLAGS_LAST_ELEMENT. Case (4). + */ + if ((error = mps_add_chain(cm)) != 0) + return (error); + } - sge = (MPI2_SGE_SIMPLE64 *)&chain->chain->MpiSimple; - sglspace = 128; - } +#ifdef INVARIANTS + /* Case 1: 1 more segment, enough room for it. */ + if (segsleft == 1 && cm->cm_sglsize < len) + panic("1 seg left and no room? %u versus %zu", + cm->cm_sglsize, len); + + /* Case 2: 2 more segments, enough room for both */ + if (segsleft == 2 && cm->cm_sglsize < len + MPS_SGE64_SIZE) + panic("2 segs left and no room? %u versus %zu", + cm->cm_sglsize, len); +#endif - flags = MPI2_SGE_FLAGS_SIMPLE_ELEMENT; - sge->FlagsLength = segs[i].ds_len | - ((sflags | flags) << MPI2_SGE_FLAGS_SHIFT); - mps_from_u64(segs[i].ds_addr, &sge->Address); + if (segsleft == 1 && type == MPI2_SGE_FLAGS_SIMPLE_ELEMENT) { + /* + * Last element of the last segment of the entire + * buffer. + */ + sge->FlagsLength |= ((MPI2_SGE_FLAGS_LAST_ELEMENT | + MPI2_SGE_FLAGS_END_OF_BUFFER | + MPI2_SGE_FLAGS_END_OF_LIST) << MPI2_SGE_FLAGS_SHIFT); + } - /* Case 1, Fill in one SGE element and break */ - if (segsleft == 1) - break; + cm->cm_sglsize -= len; + bcopy(sgep, cm->cm_sge, len); + cm->cm_sge = (MPI2_SGE_IO_UNION *)((uintptr_t)cm->cm_sge + len); + return (0); +} + +/* + * Add one dma segment to the scatter-gather list for a command. + */ +int +mps_add_dmaseg(struct mps_command *cm, vm_paddr_t pa, size_t len, u_int flags, + int segsleft) +{ + MPI2_SGE_SIMPLE64 sge; + + /* + * This driver always uses 64-bit address elements for + * simplicity. + */ + flags |= MPI2_SGE_FLAGS_SIMPLE_ELEMENT | MPI2_SGE_FLAGS_ADDRESS_SIZE; + sge.FlagsLength = len | (flags << MPI2_SGE_FLAGS_SHIFT); + mps_from_u64(pa, &sge.Address); + + return (mps_push_sge(cm, &sge, sizeof sge, segsleft)); +} - sglspace -= MPS_SGE64_SIZE; - segsleft--; +static void +mps_data_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct mps_softc *sc; + struct mps_command *cm; + u_int i, dir, sflags; - /* Case 3, prepare for a chain on the next loop */ - if ((segsleft > 0) && (sglspace < MPS_SGE64_SIZE)) - sge->FlagsLength |= - (MPI2_SGE_FLAGS_LAST_ELEMENT << - MPI2_SGE_FLAGS_SHIFT); - - /* Advance to the next element to be filled in. */ - sge++; - } - - /* Last element of the last segment of the entire buffer */ - flags = MPI2_SGE_FLAGS_LAST_ELEMENT | - MPI2_SGE_FLAGS_END_OF_BUFFER | - MPI2_SGE_FLAGS_END_OF_LIST; - sge->FlagsLength |= (flags << MPI2_SGE_FLAGS_SHIFT); + cm = (struct mps_command *)arg; + sc = cm->cm_sc; + + /* + * Set up DMA direction flags. Note no support for + * bi-directional transactions. + */ + sflags = 0; + if (cm->cm_flags & MPS_CM_FLAGS_DATAOUT) { + sflags |= MPI2_SGE_FLAGS_DIRECTION; + dir = BUS_DMASYNC_PREWRITE; + } else + dir = BUS_DMASYNC_PREREAD; + + for (i = 0; i < nsegs; i++) { + error = mps_add_dmaseg(cm, segs[i].ds_addr, segs[i].ds_len, + sflags, nsegs - i); + if (error != 0) { + /* Resource shortage, roll back! */ + mps_printf(sc, "out of chain frames\n"); + return; + } + } bus_dmamap_sync(sc->buffer_dmat, cm->cm_dmamap, dir); mps_enqueue_request(sc, cm); Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Thu Oct 14 15:42:32 2010 (r213838) +++ head/sys/dev/mps/mps_user.c Thu Oct 14 16:44:05 2010 (r213839) @@ -322,6 +322,21 @@ mps_user_write_cfg_page(struct mps_softc return (0); } +static void +mpi_init_sge(struct mps_command *cm, void *req, void *sge) +{ + int off, space; + + space = (int)cm->cm_sc->facts->IOCRequestFrameSize * 4; + off = (uintptr_t)sge - (uintptr_t)req; + + KASSERT(off < space, ("bad pointers %p %p, off %d, space %d", + req, sge, off, space)); + + cm->cm_sge = sge; + cm->cm_sglsize = space - off; +} + /* * Prepare the mps_command for an IOC_FACTS request. */ @@ -374,8 +389,7 @@ mpi_pre_fw_download(struct mps_command * if (cmd->rpl_len != sizeof *rpl) return (EINVAL); - cm->cm_sge = (MPI2_SGE_IO_UNION *)&req->SGL; - cm->cm_sglsize = sizeof req->SGL; + mpi_init_sge(cm, req, &req->SGL); return (0); } @@ -387,45 +401,41 @@ mpi_pre_fw_upload(struct mps_command *cm { MPI2_FW_UPLOAD_REQUEST *req = (void *)cm->cm_req; MPI2_FW_UPLOAD_REPLY *rpl; - MPI2_FW_UPLOAD_TCSGE *tc; + MPI2_FW_UPLOAD_TCSGE tc; /* * This code assumes there is room in the request's SGL for * the TransactionContext plus at least a SGL chain element. */ - CTASSERT(sizeof req->SGL >= sizeof *tc + MPS_SGC_SIZE); + CTASSERT(sizeof req->SGL >= sizeof tc + MPS_SGC_SIZE); if (cmd->req_len != sizeof *req) return (EINVAL); if (cmd->rpl_len != sizeof *rpl) return (EINVAL); - cm->cm_sglsize = sizeof req->SGL; + mpi_init_sge(cm, req, &req->SGL); if (cmd->len == 0) { /* Perhaps just asking what the size of the fw is? */ - cm->cm_sge = (MPI2_SGE_IO_UNION *)&req->SGL; return (0); } - tc = (void *)&req->SGL; - bzero(tc, sizeof *tc); + bzero(&tc, sizeof tc); /* * The value of the first two elements is specified in the * Fusion-MPT Message Passing Interface document. */ - tc->ContextSize = 0; - tc->DetailsLength = 12; + tc.ContextSize = 0; + tc.DetailsLength = 12; /* * XXX Is there any reason to fetch a partial image? I.e. to * set ImageOffset to something other than 0? */ - tc->ImageOffset = 0; - tc->ImageSize = cmd->len; - cm->cm_sge = (MPI2_SGE_IO_UNION *)(tc + 1); - cm->cm_sglsize -= sizeof *tc; + tc.ImageOffset = 0; + tc.ImageSize = cmd->len; - return (0); + return (mps_push_sge(cm, &tc, sizeof tc, 0)); } /* @@ -442,8 +452,7 @@ mpi_pre_sata_passthrough(struct mps_comm if (cmd->rpl_len != sizeof *rpl) return (EINVAL); - cm->cm_sge = (MPI2_SGE_IO_UNION *)&req->SGL; - cm->cm_sglsize = sizeof req->SGL; + mpi_init_sge(cm, req, &req->SGL); return (0); } @@ -461,8 +470,7 @@ mpi_pre_smp_passthrough(struct mps_comma if (cmd->rpl_len != sizeof *rpl) return (EINVAL); - cm->cm_sge = (MPI2_SGE_IO_UNION *)&req->SGL; - cm->cm_sglsize = sizeof req->SGL; + mpi_init_sge(cm, req, &req->SGL); return (0); } @@ -480,8 +488,7 @@ mpi_pre_config(struct mps_command *cm, s if (cmd->rpl_len != sizeof *rpl) return (EINVAL); - cm->cm_sge = (MPI2_SGE_IO_UNION *)&req->PageBufferSGE; - cm->cm_sglsize = sizeof req->PageBufferSGE; + mpi_init_sge(cm, req, &req->PageBufferSGE); return (0); } Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Thu Oct 14 15:42:32 2010 (r213838) +++ head/sys/dev/mps/mpsvar.h Thu Oct 14 16:44:05 2010 (r213839) @@ -359,6 +359,9 @@ int mps_register_events(struct mps_softc int mps_update_events(struct mps_softc *, struct mps_event_handle *, uint8_t *); int mps_deregister_events(struct mps_softc *, struct mps_event_handle *); int mps_request_polled(struct mps_softc *sc, struct mps_command *cm); +void mps_enqueue_request(struct mps_softc *, struct mps_command *); +int mps_push_sge(struct mps_command *, void *, size_t, int); +int mps_add_dmaseg(struct mps_command *, vm_paddr_t, size_t, u_int, int); int mps_attach_sas(struct mps_softc *sc); int mps_detach_sas(struct mps_softc *sc); int mps_map_command(struct mps_softc *sc, struct mps_command *cm); From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 16:44:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A949A1065697; Thu, 14 Oct 2010 16:44:44 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 980158FC21; Thu, 14 Oct 2010 16:44:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EGii5U030230; Thu, 14 Oct 2010 16:44:44 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EGiiCk030228; Thu, 14 Oct 2010 16:44:44 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201010141644.o9EGiiCk030228@svn.freebsd.org> From: Matthew D Fleming Date: Thu, 14 Oct 2010 16:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213840 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 16:44:44 -0000 Author: mdf Date: Thu Oct 14 16:44:44 2010 New Revision: 213840 URL: http://svn.freebsd.org/changeset/base/213840 Log: Support firmware download. Modified: head/sys/dev/mps/mps_user.c Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Thu Oct 14 16:44:05 2010 (r213839) +++ head/sys/dev/mps/mps_user.c Thu Oct 14 16:44:44 2010 (r213840) @@ -383,14 +383,50 @@ mpi_pre_fw_download(struct mps_command * { MPI2_FW_DOWNLOAD_REQUEST *req = (void *)cm->cm_req; MPI2_FW_DOWNLOAD_REPLY *rpl; + MPI2_FW_DOWNLOAD_TCSGE tc; + int error; + + /* + * This code assumes there is room in the request's SGL for + * the TransactionContext plus at least a SGL chain element. + */ + CTASSERT(sizeof req->SGL >= sizeof tc + MPS_SGC_SIZE); if (cmd->req_len != sizeof *req) return (EINVAL); if (cmd->rpl_len != sizeof *rpl) return (EINVAL); + if (cmd->len == 0) + return (EINVAL); + + error = copyin(cmd->buf, cm->cm_data, cmd->len); + if (error != 0) + return (error); + mpi_init_sge(cm, req, &req->SGL); - return (0); + bzero(&tc, sizeof tc); + + /* + * For now, the F/W image must be provided in a single request. + */ + if ((req->MsgFlags & MPI2_FW_DOWNLOAD_MSGFLGS_LAST_SEGMENT) == 0) + return (EINVAL); + if (req->TotalImageSize != cmd->len) + return (EINVAL); + + /* + * The value of the first two elements is specified in the + * Fusion-MPT Message Passing Interface document. + */ + tc.ContextSize = 0; + tc.DetailsLength = 12; + tc.ImageOffset = 0; + tc.ImageSize = cmd->len; + + cm->cm_flags |= MPS_CM_FLAGS_DATAOUT; + + return (mps_push_sge(cm, &tc, sizeof tc, 0)); } /* From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 17:06:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 984C9106566B; Thu, 14 Oct 2010 17:06:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 654A88FC1E; Thu, 14 Oct 2010 17:06:08 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 036FA46C1A; Thu, 14 Oct 2010 13:06:08 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C6F8F8A009; Thu, 14 Oct 2010 13:06:06 -0400 (EDT) From: John Baldwin To: Dmitry Morozovsky Date: Thu, 14 Oct 2010 13:06:06 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201010131033.o9DAX1EE080534@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010141306.06248.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 14 Oct 2010 13:06:06 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: src-committers@freebsd.org, Rui Paulo , svn-src-all@freebsd.org, svn-src-head@freebsd.org, John Nielsen , Jung-uk Kim Subject: Re: svn commit: r213765 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 17:06:08 -0000 On Thursday, October 14, 2010 12:41:45 pm Dmitry Morozovsky wrote: > On Thu, 14 Oct 2010, John Nielsen wrote: > > JN> >> I'm migrating a box from 8-STABLE to -CURRENT this morning and this > JN> >> commit seems to break buildkernel: > JN> >> > JN> >> cc -O2 -pipe -nostdinc -I/usr/include -I. > JN> >> -I/usr/src/sys/dev/aic7xxx/aicasm -std=gnu99 -Wsystem-headers > JN> >> -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter > JN> >> -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith > JN> >> -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow > JN> >> -Wunused-parameter -Wcast-align -Wno-pointer-sign -c aicasm_scan.c > JN> >> cc1: warnings being treated as errors > JN> >> /usr/src/sys/dev/aic7xxx/aicasm/aicasm_scan.l:840: warning: > JN> >> function declaration isn't a prototype *** Error code 1 > JN> >> > JN> >> I don't have any custom CFLAGS, etc defined. Commenting out the new > JN> >> #defines from this patch allows the build to continue. > JN> >> > JN> >> I'm guessing this doesn't happen on machines already running > JN> >> -CURRENT or tinderbox (and others) would have noticed. However if > JN> >> this is (going to be) a supported upgrade path from 8.x to 9.0 > JN> >> perhaps there's a way to make both clang and gcc from 8.x happy? > JN> > > JN> > If you want to upgrade from N to N+1, "make buildworld" is required. > JN> > JN> Sorry, I did do a "make buildworld" (which succeeded) prior to the "make buildkernel" (which failed as I described). > > I can confirm this: my build machine, which is > > FreeBSD beaver.rinet.ru 8.1-STABLE FreeBSD 8.1-STABLE #1 r213380M: Sun Oct 3 > 13:25:15 MSD 2010 > > is now failing 'buildworld buildkernel __MAKE_CONF=/dev/null' for HEAD sources > both for TARGET=amd64 and i386 The tinderboxes are also failing (at least sun4v). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 17:22:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 934A61065672; Thu, 14 Oct 2010 17:22:38 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 766858FC20; Thu, 14 Oct 2010 17:22:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EHMcs7031102; Thu, 14 Oct 2010 17:22:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EHMcZO031099; Thu, 14 Oct 2010 17:22:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010141722.o9EHMcZO031099@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Oct 2010 17:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213841 - head/sys/dev/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 17:22:38 -0000 Author: yongari Date: Thu Oct 14 17:22:38 2010 New Revision: 213841 URL: http://svn.freebsd.org/changeset/base/213841 Log: It seems some multi-port dc(4) controllers shares SROM of the first port such that reading station address from second port always returned 0xFF:0xFF:0xFF:0xFF:0xFF:0xFF Unfortunately it seems there is no easy way to know whether SROM is shared or not. Workaround the issue by traversing dc(4) device list and see whether we're using second port and use station address of controller 0 as base station address of second port. PR: kern/79262 MFC after: 2 weeks Modified: head/sys/dev/dc/if_dc.c head/sys/dev/dc/if_dcreg.h Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Thu Oct 14 16:44:44 2010 (r213840) +++ head/sys/dev/dc/if_dc.c Thu Oct 14 17:22:38 2010 (r213841) @@ -293,6 +293,7 @@ static void dc_decode_leaf_sia(struct dc static void dc_decode_leaf_mii(struct dc_softc *, struct dc_eblock_mii *); static void dc_decode_leaf_sym(struct dc_softc *, struct dc_eblock_sym *); static void dc_apply_fixup(struct dc_softc *, int); +static int dc_check_multiport(struct dc_softc *); #ifdef DC_USEIOSPACE #define DC_RES SYS_RES_IOPORT @@ -2088,6 +2089,20 @@ dc_attach(device_t dev) break; } + bcopy(eaddr, sc->dc_eaddr, sizeof(eaddr)); + /* + * If we still have invalid station address, see whether we can + * find station address for chip 0. Some multi-port controllers + * just store station address for chip 0 if they have a shared + * SROM. + */ + if ((sc->dc_eaddr[0] == 0 && (sc->dc_eaddr[1] & ~0xffff) == 0) || + (sc->dc_eaddr[0] == 0xffffffff && + (sc->dc_eaddr[1] & 0xffff) == 0xffff)) { + if (dc_check_multiport(sc) == 0) + bcopy(sc->dc_eaddr, eaddr, sizeof(eaddr)); + } + /* Allocate a busdma tag and DMA safe memory for TX/RX descriptors. */ error = bus_dma_tag_create(bus_get_dma_tag(dev), PAGE_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, @@ -3808,3 +3823,34 @@ dc_shutdown(device_t dev) return (0); } + +static int +dc_check_multiport(struct dc_softc *sc) +{ + struct dc_softc *dsc; + devclass_t dc; + device_t child; + uint8_t *eaddr; + int unit; + + dc = devclass_find("dc"); + for (unit = 0; unit < devclass_get_maxunit(dc); unit++) { + child = devclass_get_device(dc, unit); + if (child == NULL) + continue; + if (child == sc->dc_dev) + continue; + if (device_get_parent(child) != device_get_parent(sc->dc_dev)) + continue; + if (unit > device_get_unit(sc->dc_dev)) + continue; + dsc = device_get_softc(child); + device_printf(sc->dc_dev, "Using station address of %s as base", + device_get_nameunit(child)); + bcopy(dsc->dc_eaddr, sc->dc_eaddr, ETHER_ADDR_LEN); + eaddr = (uint8_t *)sc->dc_eaddr; + eaddr[5]++; + return (0); + } + return (ENOENT); +} Modified: head/sys/dev/dc/if_dcreg.h ============================================================================== --- head/sys/dev/dc/if_dcreg.h Thu Oct 14 16:44:44 2010 (r213840) +++ head/sys/dev/dc/if_dcreg.h Thu Oct 14 17:22:38 2010 (r213841) @@ -745,6 +745,7 @@ struct dc_softc { int dc_if_media; u_int32_t dc_flags; u_int32_t dc_txthresh; + u_int32_t dc_eaddr[2]; u_int8_t *dc_srom; struct dc_mediainfo *dc_mi; struct dc_list_data *dc_ldata; From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 17:57:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C4701065674; Thu, 14 Oct 2010 17:57:53 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 006588FC17; Thu, 14 Oct 2010 17:57:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EHvq4J031886; Thu, 14 Oct 2010 17:57:52 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EHvqm8031884; Thu, 14 Oct 2010 17:57:52 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010141757.o9EHvqm8031884@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Oct 2010 17:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213842 - head/sys/dev/alc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 17:57:53 -0000 Author: yongari Date: Thu Oct 14 17:57:52 2010 New Revision: 213842 URL: http://svn.freebsd.org/changeset/base/213842 Log: Backout r204230. TX mbuf parser for VLAN is still required to enable TX checksum offloading if VLAN hardware tagging is disabled. Modified: head/sys/dev/alc/if_alc.c Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Thu Oct 14 17:22:38 2010 (r213841) +++ head/sys/dev/alc/if_alc.c Thu Oct 14 17:57:52 2010 (r213842) @@ -2019,7 +2019,7 @@ alc_encap(struct alc_softc *sc, struct m struct tcphdr *tcp; bus_dma_segment_t txsegs[ALC_MAXTXSEGS]; bus_dmamap_t map; - uint32_t cflags, hdrlen, poff, vtag; + uint32_t cflags, hdrlen, ip_off, poff, vtag; int error, idx, nsegs, prod; ALC_LOCK_ASSERT(sc); @@ -2029,7 +2029,7 @@ alc_encap(struct alc_softc *sc, struct m m = *m_head; ip = NULL; tcp = NULL; - poff = 0; + ip_off = poff = 0; if ((m->m_pkthdr.csum_flags & (ALC_CSUM_FEATURES | CSUM_TSO)) != 0) { /* * AR813x/AR815x requires offset of TCP/UDP header in its @@ -2039,6 +2039,7 @@ alc_encap(struct alc_softc *sc, struct m * cycles on FreeBSD so fast host CPU is required to get * smooth TSO performance. */ + struct ether_header *eh; if (M_WRITABLE(m) == 0) { /* Get a writable copy. */ @@ -2052,15 +2053,32 @@ alc_encap(struct alc_softc *sc, struct m *m_head = m; } - m = m_pullup(m, sizeof(struct ether_header) + - sizeof(struct ip)); + ip_off = sizeof(struct ether_header); + m = m_pullup(m, ip_off); if (m == NULL) { *m_head = NULL; return (ENOBUFS); } - ip = (struct ip *)(mtod(m, char *) + - sizeof(struct ether_header)); - poff = sizeof(struct ether_header) + (ip->ip_hl << 2); + eh = mtod(m, struct ether_header *); + /* + * Check if hardware VLAN insertion is off. + * Additional check for LLC/SNAP frame? + */ + if (eh->ether_type == htons(ETHERTYPE_VLAN)) { + ip_off = sizeof(struct ether_vlan_header); + m = m_pullup(m, ip_off); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } + } + m = m_pullup(m, ip_off + sizeof(struct ip)); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } + ip = (struct ip *)(mtod(m, char *) + ip_off); + poff = ip_off + (ip->ip_hl << 2); if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { m = m_pullup(m, poff + sizeof(struct tcphdr)); if (m == NULL) { From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 18:02:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FC0F106564A; Thu, 14 Oct 2010 18:02:32 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43FA78FC12; Thu, 14 Oct 2010 18:02:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EI2WWJ032054; Thu, 14 Oct 2010 18:02:32 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EI2Wvn032052; Thu, 14 Oct 2010 18:02:32 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201010141802.o9EI2Wvn032052@svn.freebsd.org> From: Jaakko Heinonen Date: Thu, 14 Oct 2010 18:02:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213843 - stable/7/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 18:02:32 -0000 Author: jh Date: Thu Oct 14 18:02:31 2010 New Revision: 213843 URL: http://svn.freebsd.org/changeset/base/213843 Log: MFC r200036 by scottl: Fix several cases where the periph lock was held over malloc. PR: kern/130735 Modified: stable/7/sys/cam/scsi/scsi_cd.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_cd.c Thu Oct 14 17:57:52 2010 (r213842) +++ stable/7/sys/cam/scsi/scsi_cd.c Thu Oct 14 18:02:31 2010 (r213843) @@ -2666,12 +2666,10 @@ cdioctl(struct disk *dp, u_long cmd, voi authinfo = (struct dvd_authinfo *)addr; - cam_periph_lock(periph); if (cmd == DVDIOCREPORTKEY) error = cdreportkey(periph, authinfo); else error = cdsendkey(periph, authinfo); - cam_periph_unlock(periph); break; } case DVDIOCREADSTRUCTURE: { @@ -2679,9 +2677,7 @@ cdioctl(struct disk *dp, u_long cmd, voi dvdstruct = (struct dvd_struct *)addr; - cam_periph_lock(periph); error = cdreaddvdstructure(periph, dvdstruct); - cam_periph_unlock(periph); break; } @@ -3726,8 +3722,6 @@ cdreportkey(struct cam_periph *periph, s databuf = NULL; lba = 0; - ccb = cdgetccb(periph, /* priority */ 1); - switch (authinfo->format) { case DVD_REPORT_AGID: length = sizeof(struct scsi_report_key_data_agid); @@ -3753,9 +3747,7 @@ cdreportkey(struct cam_periph *periph, s length = 0; break; default: - error = EINVAL; - goto bailout; - break; /* NOTREACHED */ + return (EINVAL); } if (length != 0) { @@ -3763,6 +3755,8 @@ cdreportkey(struct cam_periph *periph, s } else databuf = NULL; + cam_periph_lock(periph); + ccb = cdgetccb(periph, /* priority */ 1); scsi_report_key(&ccb->csio, /* retries */ 1, @@ -3863,12 +3857,14 @@ cdreportkey(struct cam_periph *periph, s goto bailout; break; /* NOTREACHED */ } + bailout: + xpt_release_ccb(ccb); + cam_periph_unlock(periph); + if (databuf != NULL) free(databuf, M_DEVBUF); - xpt_release_ccb(ccb); - return(error); } @@ -3883,8 +3879,6 @@ cdsendkey(struct cam_periph *periph, str error = 0; databuf = NULL; - ccb = cdgetccb(periph, /* priority */ 1); - switch(authinfo->format) { case DVD_SEND_CHALLENGE: { struct scsi_report_key_data_challenge *challenge_data; @@ -3936,11 +3930,12 @@ cdsendkey(struct cam_periph *periph, str break; } default: - error = EINVAL; - goto bailout; - break; /* NOTREACHED */ + return (EINVAL); } + cam_periph_lock(periph); + ccb = cdgetccb(periph, /* priority */ 1); + scsi_send_key(&ccb->csio, /* retries */ 1, /* cbfcnp */ cddone, @@ -3955,13 +3950,12 @@ cdsendkey(struct cam_periph *periph, str error = cdrunccb(ccb, cderror, /*cam_flags*/CAM_RETRY_SELTO, /*sense_flags*/SF_RETRY_UA); -bailout: + xpt_release_ccb(ccb); + cam_periph_unlock(periph); if (databuf != NULL) free(databuf, M_DEVBUF); - xpt_release_ccb(ccb); - return(error); } @@ -3979,8 +3973,6 @@ cdreaddvdstructure(struct cam_periph *pe /* The address is reserved for many of the formats */ address = 0; - ccb = cdgetccb(periph, /* priority */ 1); - switch(dvdstruct->format) { case DVD_STRUCT_PHYSICAL: length = sizeof(struct scsi_read_dvd_struct_data_physical); @@ -3998,13 +3990,7 @@ cdreaddvdstructure(struct cam_periph *pe length = sizeof(struct scsi_read_dvd_struct_data_manufacturer); break; case DVD_STRUCT_CMI: - error = ENODEV; - goto bailout; -#ifdef notyet - length = sizeof(struct scsi_read_dvd_struct_data_copy_manage); - address = dvdstruct->address; -#endif - break; /* NOTREACHED */ + return (ENODEV); case DVD_STRUCT_PROTDISCID: length = sizeof(struct scsi_read_dvd_struct_data_prot_discid); break; @@ -4021,21 +4007,9 @@ cdreaddvdstructure(struct cam_periph *pe length = sizeof(struct scsi_read_dvd_struct_data_spare_area); break; case DVD_STRUCT_RMD_LAST: - error = ENODEV; - goto bailout; -#ifdef notyet - length = sizeof(struct scsi_read_dvd_struct_data_rmd_borderout); - address = dvdstruct->address; -#endif - break; /* NOTREACHED */ + return (ENODEV); case DVD_STRUCT_RMD_RMA: - error = ENODEV; - goto bailout; -#ifdef notyet - length = sizeof(struct scsi_read_dvd_struct_data_rmd); - address = dvdstruct->address; -#endif - break; /* NOTREACHED */ + return (ENODEV); case DVD_STRUCT_PRERECORDED: length = sizeof(struct scsi_read_dvd_struct_data_leadin); break; @@ -4043,13 +4017,7 @@ cdreaddvdstructure(struct cam_periph *pe length = sizeof(struct scsi_read_dvd_struct_data_disc_id); break; case DVD_STRUCT_DCB: - error = ENODEV; - goto bailout; -#ifdef notyet - length = sizeof(struct scsi_read_dvd_struct_data_dcb); - address = dvdstruct->address; -#endif - break; /* NOTREACHED */ + return (ENODEV); case DVD_STRUCT_LIST: /* * This is the maximum allocation length for the READ DVD @@ -4061,9 +4029,7 @@ cdreaddvdstructure(struct cam_periph *pe length = 65535; break; default: - error = EINVAL; - goto bailout; - break; /* NOTREACHED */ + return (EINVAL); } if (length != 0) { @@ -4071,6 +4037,9 @@ cdreaddvdstructure(struct cam_periph *pe } else databuf = NULL; + cam_periph_lock(periph); + ccb = cdgetccb(periph, /* priority */ 1); + scsi_read_dvd_structure(&ccb->csio, /* retries */ 1, /* cbfcnp */ cddone, @@ -4158,13 +4127,14 @@ cdreaddvdstructure(struct cam_periph *pe min(sizeof(dvdstruct->data), dvdstruct->length)); break; } + bailout: + xpt_release_ccb(ccb); + cam_periph_unlock(periph); if (databuf != NULL) free(databuf, M_DEVBUF); - xpt_release_ccb(ccb); - return(error); } From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 18:31:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85F6A1065674; Thu, 14 Oct 2010 18:31:40 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 733CA8FC0C; Thu, 14 Oct 2010 18:31:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EIVeAo032753; Thu, 14 Oct 2010 18:31:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EIVehW032744; Thu, 14 Oct 2010 18:31:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201010141831.o9EIVehW032744@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 14 Oct 2010 18:31:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213844 - in head/sys/dev: age alc ale bce bge fxp jme sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 18:31:40 -0000 Author: yongari Date: Thu Oct 14 18:31:40 2010 New Revision: 213844 URL: http://svn.freebsd.org/changeset/base/213844 Log: Make sure to not use stale ip/tcp header pointers. The ip/tcp header parser uses m_pullup(9) to get access to mbuf chain. m_pullup(9) can allocate new mbuf chain and free old one if the space left in the mbuf chain is not enough to hold requested contiguous bytes. Previously drivers can use stale ip/tcp header pointer if m_pullup(9) returned new mbuf chain. Reported by: Andrew Boyer (aboyer <> averesystems dot com) MFC after: 10 days Modified: head/sys/dev/age/if_age.c head/sys/dev/alc/if_alc.c head/sys/dev/ale/if_ale.c head/sys/dev/bce/if_bce.c head/sys/dev/bge/if_bge.c head/sys/dev/fxp/if_fxp.c head/sys/dev/jme/if_jme.c head/sys/dev/sge/if_sge.c Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Thu Oct 14 18:02:31 2010 (r213843) +++ head/sys/dev/age/if_age.c Thu Oct 14 18:31:40 2010 (r213844) @@ -1565,6 +1565,7 @@ age_encap(struct age_softc *sc, struct m *m_head = NULL; return (ENOBUFS); } + ip = (struct ip *)(mtod(m, char *) + ip_off); tcp = (struct tcphdr *)(mtod(m, char *) + poff); /* * L1 requires IP/TCP header size and offset as Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Thu Oct 14 18:02:31 2010 (r213843) +++ head/sys/dev/alc/if_alc.c Thu Oct 14 18:31:40 2010 (r213844) @@ -2104,6 +2104,8 @@ alc_encap(struct alc_softc *sc, struct m * Reset IP checksum and recompute TCP pseudo * checksum as NDIS specification said. */ + ip = (struct ip *)(mtod(m, char *) + ip_off); + tcp = (struct tcphdr *)(mtod(m, char *) + poff); ip->ip_sum = 0; tcp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Thu Oct 14 18:02:31 2010 (r213843) +++ head/sys/dev/ale/if_ale.c Thu Oct 14 18:31:40 2010 (r213844) @@ -1677,6 +1677,7 @@ ale_encap(struct ale_softc *sc, struct m *m_head = NULL; return (ENOBUFS); } + ip = (struct ip *)(mtod(m, char *) + ip_off); tcp = (struct tcphdr *)(mtod(m, char *) + poff); m = m_pullup(m, poff + (tcp->th_off << 2)); if (m == NULL) { Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Thu Oct 14 18:02:31 2010 (r213843) +++ head/sys/dev/bce/if_bce.c Thu Oct 14 18:31:40 2010 (r213844) @@ -6736,6 +6736,7 @@ bce_tso_setup(struct bce_softc *sc, stru } /* Get the TCP header length in bytes (min 20) */ + ip = (struct ip *)(m->m_data + sizeof(struct ether_header)); th = (struct tcphdr *)((caddr_t)ip + ip_hlen); tcp_hlen = (th->th_off << 2); @@ -6748,6 +6749,7 @@ bce_tso_setup(struct bce_softc *sc, stru } /* IP header length and checksum will be calc'd by hardware */ + ip = (struct ip *)(m->m_data + sizeof(struct ether_header)); ip_len = ip->ip_len; ip->ip_len = 0; ip->ip_sum = 0; Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Thu Oct 14 18:02:31 2010 (r213843) +++ head/sys/dev/bge/if_bge.c Thu Oct 14 18:31:40 2010 (r213844) @@ -4097,9 +4097,11 @@ bge_setup_tso(struct bge_softc *sc, stru * checksum. These checksum computed by upper stack should be 0. */ *mss = m->m_pkthdr.tso_segsz; + ip = (struct ip *)(mtod(m, char *) + sizeof(struct ether_header)); ip->ip_sum = 0; ip->ip_len = htons(*mss + (ip->ip_hl << 2) + (tcp->th_off << 2)); /* Clear pseudo checksum computed by TCP stack. */ + tcp = (struct tcphdr *)(mtod(m, char *) + poff); tcp->th_sum = 0; /* * Broadcom controllers uses different descriptor format for Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Thu Oct 14 18:02:31 2010 (r213843) +++ head/sys/dev/fxp/if_fxp.c Thu Oct 14 18:31:40 2010 (r213844) @@ -1454,6 +1454,8 @@ fxp_encap(struct fxp_softc *sc, struct m * Since 82550/82551 doesn't modify IP length and pseudo * checksum in the first frame driver should compute it. */ + ip = (struct ip *)(mtod(m, char *) + ip_off); + tcp = (struct tcphdr *)(mtod(m, char *) + poff); ip->ip_sum = 0; ip->ip_len = htons(m->m_pkthdr.tso_segsz + (ip->ip_hl << 2) + (tcp->th_off << 2)); Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Thu Oct 14 18:02:31 2010 (r213843) +++ head/sys/dev/jme/if_jme.c Thu Oct 14 18:31:40 2010 (r213844) @@ -1657,11 +1657,12 @@ jme_encap(struct jme_softc *sc, struct m *m_head = NULL; return (ENOBUFS); } - tcp = (struct tcphdr *)(mtod(m, char *) + poff); /* * Reset IP checksum and recompute TCP pseudo * checksum that NDIS specification requires. */ + ip = (struct ip *)(mtod(m, char *) + ip_off); + tcp = (struct tcphdr *)(mtod(m, char *) + poff); ip->ip_sum = 0; if (poff + (tcp->th_off << 2) == m->m_pkthdr.len) { tcp->th_sum = in_pseudo(ip->ip_src.s_addr, Modified: head/sys/dev/sge/if_sge.c ============================================================================== --- head/sys/dev/sge/if_sge.c Thu Oct 14 18:02:31 2010 (r213843) +++ head/sys/dev/sge/if_sge.c Thu Oct 14 18:31:40 2010 (r213844) @@ -1457,7 +1457,9 @@ sge_encap(struct sge_softc *sc, struct m * Reset IP checksum and recompute TCP pseudo * checksum that NDIS specification requires. */ + ip = (struct ip *)(mtod(m, char *) + ip_off); ip->ip_sum = 0; + tcp = (struct tcphdr *)(mtod(m, char *) + poff); tcp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); *m_head = m; From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 19:05:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id D74A01065672; Thu, 14 Oct 2010 19:05:22 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Thu, 14 Oct 2010 15:05:13 -0400 User-Agent: KMail/1.6.2 References: <201010131033.o9DAX1EE080534@svn.freebsd.org> <201010141306.06248.jhb@freebsd.org> In-Reply-To: <201010141306.06248.jhb@freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010141505.14869.jkim@FreeBSD.org> Cc: src-committers@freebsd.org, Rui Paulo , svn-src-all@freebsd.org, Dmitry Morozovsky , svn-src-head@freebsd.org, John Nielsen Subject: Re: svn commit: r213765 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 19:05:23 -0000 On Thursday 14 October 2010 01:06 pm, John Baldwin wrote: > On Thursday, October 14, 2010 12:41:45 pm Dmitry Morozovsky wrote: > > On Thu, 14 Oct 2010, John Nielsen wrote: > > > > JN> >> I'm migrating a box from 8-STABLE to -CURRENT this morning > > and this JN> >> commit seems to break buildkernel: > > JN> >> > > JN> >> cc -O2 -pipe -nostdinc -I/usr/include -I. > > JN> >> -I/usr/src/sys/dev/aic7xxx/aicasm -std=gnu99 > > -Wsystem-headers JN> >> -Werror -Wall -Wno-format-y2k -W > > -Wno-unused-parameter JN> >> -Wstrict-prototypes > > -Wmissing-prototypes -Wpointer-arith JN> >> -Wreturn-type > > -Wcast-qual -Wwrite-strings -Wswitch -Wshadow JN> >> > > -Wunused-parameter -Wcast-align -Wno-pointer-sign -c > > aicasm_scan.c JN> >> cc1: warnings being treated as errors > > JN> >> /usr/src/sys/dev/aic7xxx/aicasm/aicasm_scan.l:840: > > warning: JN> >> function declaration isn't a prototype *** Error > > code 1 JN> >> > > JN> >> I don't have any custom CFLAGS, etc defined. Commenting > > out the new JN> >> #defines from this patch allows the build to > > continue. JN> >> > > JN> >> I'm guessing this doesn't happen on machines already > > running JN> >> -CURRENT or tinderbox (and others) would have > > noticed. However if JN> >> this is (going to be) a supported > > upgrade path from 8.x to 9.0 JN> >> perhaps there's a way to make > > both clang and gcc from 8.x happy? JN> > > > JN> > If you want to upgrade from N to N+1, "make buildworld" is > > required. JN> > > JN> Sorry, I did do a "make buildworld" (which succeeded) prior > > to the "make buildkernel" (which failed as I described). > > > > I can confirm this: my build machine, which is > > > > FreeBSD beaver.rinet.ru 8.1-STABLE FreeBSD 8.1-STABLE #1 > > r213380M: Sun Oct 3 13:25:15 MSD 2010 > > > > is now failing 'buildworld buildkernel __MAKE_CONF=/dev/null' for > > HEAD sources both for TARGET=amd64 and i386 > > The tinderboxes are also failing (at least sun4v). No, it's fixed already: http://svn.freebsd.org/viewvc/base?view=revision&revision=213764 Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 19:11:36 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E85931065672; Thu, 14 Oct 2010 19:11:36 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 4C5548FC17; Thu, 14 Oct 2010 19:11:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.4/8.14.4) with ESMTP id o9EJBY2n087186; Thu, 14 Oct 2010 23:11:34 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Thu, 14 Oct 2010 23:11:34 +0400 (MSD) From: Dmitry Morozovsky To: Jung-uk Kim In-Reply-To: <201010141505.14869.jkim@FreeBSD.org> Message-ID: References: <201010131033.o9DAX1EE080534@svn.freebsd.org> <201010141306.06248.jhb@freebsd.org> <201010141505.14869.jkim@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (woozle.rinet.ru [0.0.0.0]); Thu, 14 Oct 2010 23:11:34 +0400 (MSD) Cc: src-committers@FreeBSD.org, Rui Paulo , John Baldwin , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, John Nielsen Subject: Re: svn commit: r213765 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 19:11:37 -0000 On Thu, 14 Oct 2010, Jung-uk Kim wrote: JK> > > JN> >> I'm migrating a box from 8-STABLE to -CURRENT this morning JK> > > and this JN> >> commit seems to break buildkernel: [snip] JK> > > I can confirm this: my build machine, which is JK> > > JK> > > FreeBSD beaver.rinet.ru 8.1-STABLE FreeBSD 8.1-STABLE #1 JK> > > r213380M: Sun Oct 3 13:25:15 MSD 2010 JK> > > JK> > > is now failing 'buildworld buildkernel __MAKE_CONF=/dev/null' for JK> > > HEAD sources both for TARGET=amd64 and i386 JK> > JK> > The tinderboxes are also failing (at least sun4v). JK> JK> No, it's fixed already: JK> JK> http://svn.freebsd.org/viewvc/base?view=revision&revision=213764 It does not seem so, at least in my case: marck@beaver:/FreeBSD> svn info src.current.svn/ Path: src.current.svn URL: file:///FreeBSD/svnmirror/base/head Repository Root: file:///FreeBSD/svnmirror/base Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f Revision: 213844 Node Kind: directory Schedule: normal Last Changed Author: yongari Last Changed Rev: 213844 Last Changed Date: 2010-10-14 22:31:40 +0400 (Thu, 14 Oct 2010) marck@beaver:/FreeBSD> tail /var/tmp/buildlog.svn.i386 cc -O2 -pipe -nostdinc -I/usr/include -I. -I/FreeBSD/src.current.svn/sys/dev/aic7xxx/aicasm -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wno-pointer-sign -c aicasm_macro_gram.c cc -O2 -pipe -nostdinc -I/usr/include -I. -I/FreeBSD/src.current.svn/sys/dev/aic7xxx/aicasm -std=gnu99 -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wno-pointer-sign -c aicasm_scan.c cc1: warnings being treated as errors /FreeBSD/src.current.svn/sys/dev/aic7xxx/aicasm/aicasm_scan.l:840: warning: function declaration isn't a prototype *** Error code 1 1 error *** Error code 2 1 error *** Error code 2 1 error -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 19:15:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id E8409106564A; Thu, 14 Oct 2010 19:15:14 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Thu, 14 Oct 2010 15:15:05 -0400 User-Agent: KMail/1.6.2 References: <201010131033.o9DAX1EE080534@svn.freebsd.org> <201010141306.06248.jhb@freebsd.org> <201010141505.14869.jkim@FreeBSD.org> In-Reply-To: <201010141505.14869.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010141515.07249.jkim@FreeBSD.org> Cc: src-committers@freebsd.org, Rui Paulo , svn-src-all@freebsd.org, Dmitry Morozovsky , svn-src-head@freebsd.org, John Nielsen Subject: Re: svn commit: r213765 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 19:15:15 -0000 On Thursday 14 October 2010 03:05 pm, Jung-uk Kim wrote: > On Thursday 14 October 2010 01:06 pm, John Baldwin wrote: > > On Thursday, October 14, 2010 12:41:45 pm Dmitry Morozovsky wrote: > > > On Thu, 14 Oct 2010, John Nielsen wrote: > > > > > > JN> >> I'm migrating a box from 8-STABLE to -CURRENT this > > > morning and this JN> >> commit seems to break buildkernel: > > > JN> >> > > > JN> >> cc -O2 -pipe -nostdinc -I/usr/include -I. > > > JN> >> -I/usr/src/sys/dev/aic7xxx/aicasm -std=gnu99 > > > -Wsystem-headers JN> >> -Werror -Wall -Wno-format-y2k -W > > > -Wno-unused-parameter JN> >> -Wstrict-prototypes > > > -Wmissing-prototypes -Wpointer-arith JN> >> -Wreturn-type > > > -Wcast-qual -Wwrite-strings -Wswitch -Wshadow JN> >> > > > -Wunused-parameter -Wcast-align -Wno-pointer-sign -c > > > aicasm_scan.c JN> >> cc1: warnings being treated as errors > > > JN> >> /usr/src/sys/dev/aic7xxx/aicasm/aicasm_scan.l:840: > > > warning: JN> >> function declaration isn't a prototype *** > > > Error code 1 JN> >> > > > JN> >> I don't have any custom CFLAGS, etc defined. Commenting > > > out the new JN> >> #defines from this patch allows the build to > > > continue. JN> >> > > > JN> >> I'm guessing this doesn't happen on machines already > > > running JN> >> -CURRENT or tinderbox (and others) would have > > > noticed. However if JN> >> this is (going to be) a supported > > > upgrade path from 8.x to 9.0 JN> >> perhaps there's a way to > > > make both clang and gcc from 8.x happy? JN> > > > > JN> > If you want to upgrade from N to N+1, "make buildworld" > > > is required. JN> > > > JN> Sorry, I did do a "make buildworld" (which succeeded) prior > > > to the "make buildkernel" (which failed as I described). > > > > > > I can confirm this: my build machine, which is > > > > > > FreeBSD beaver.rinet.ru 8.1-STABLE FreeBSD 8.1-STABLE #1 > > > r213380M: Sun Oct 3 13:25:15 MSD 2010 > > > > > > is now failing 'buildworld buildkernel __MAKE_CONF=/dev/null' > > > for HEAD sources both for TARGET=amd64 and i386 > > > > The tinderboxes are also failing (at least sun4v). > > No, it's fixed already: > > http://svn.freebsd.org/viewvc/base?view=revision&revision=213764 I should have said lex(1) was fixed first, then aicasm_scan.l was changed. I guess there was a brief inconsistency in tinderbox environment. Shrug... Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 19:19:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBB321065696; Thu, 14 Oct 2010 19:19:19 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA20B8FC13; Thu, 14 Oct 2010 19:19:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EJJJ7j034035; Thu, 14 Oct 2010 19:19:19 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EJJJIc034032; Thu, 14 Oct 2010 19:19:19 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201010141919.o9EJJJIc034032@svn.freebsd.org> From: Rui Paulo Date: Thu, 14 Oct 2010 19:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213845 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 19:19:20 -0000 Author: rpaulo Date: Thu Oct 14 19:19:19 2010 New Revision: 213845 URL: http://svn.freebsd.org/changeset/base/213845 Log: Revert r213765. This is required because our build infrastructure uses the host lex instead of the lex built during buildworld. I will MFC the lex changes soon and in a few weeks this I'll commit again r213765. Modified: head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Modified: head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l Thu Oct 14 18:31:40 2010 (r213844) +++ head/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l Thu Oct 14 19:19:19 2010 (r213845) @@ -61,7 +61,6 @@ #include "aicasm_symbol.h" #include "aicasm_macro_gram.h" -#define YY_NO_INPUT #define MAX_STR_CONST 4096 static char string_buf[MAX_STR_CONST]; static char *string_buf_ptr; Modified: head/sys/dev/aic7xxx/aicasm/aicasm_scan.l ============================================================================== --- head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Thu Oct 14 18:31:40 2010 (r213844) +++ head/sys/dev/aic7xxx/aicasm/aicasm_scan.l Thu Oct 14 19:19:19 2010 (r213845) @@ -61,7 +61,6 @@ #include "aicasm_symbol.h" #include "aicasm_gram.h" -#define YY_NO_INPUT /* This is used for macro body capture too, so err on the large size. */ #define MAX_STR_CONST 4096 static char string_buf[MAX_STR_CONST]; From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 19:23:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 8F2E41065679; Thu, 14 Oct 2010 19:23:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Dmitry Morozovsky Date: Thu, 14 Oct 2010 15:23:17 -0400 User-Agent: KMail/1.6.2 References: <201010131033.o9DAX1EE080534@svn.freebsd.org> <201010141505.14869.jkim@FreeBSD.org> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010141523.29842.jkim@FreeBSD.org> Cc: src-committers@freebsd.org, Rui Paulo , John Baldwin , svn-src-all@freebsd.org, svn-src-head@freebsd.org, John Nielsen Subject: Re: svn commit: r213765 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 19:23:38 -0000 On Thursday 14 October 2010 03:11 pm, Dmitry Morozovsky wrote: > On Thu, 14 Oct 2010, Jung-uk Kim wrote: > > JK> > > JN> >> I'm migrating a box from 8-STABLE to -CURRENT this > morning JK> > > and this JN> >> commit seems to break buildkernel: > > [snip] > > JK> > > I can confirm this: my build machine, which is > JK> > > > JK> > > FreeBSD beaver.rinet.ru 8.1-STABLE FreeBSD 8.1-STABLE #1 > JK> > > r213380M: Sun Oct 3 13:25:15 MSD 2010 > JK> > > > JK> > > is now failing 'buildworld buildkernel > __MAKE_CONF=/dev/null' for JK> > > HEAD sources both for > TARGET=amd64 and i386 > JK> > > JK> > The tinderboxes are also failing (at least sun4v). > JK> > JK> No, it's fixed already: > JK> > JK> > http://svn.freebsd.org/viewvc/base?view=revision&revision=213764 > > It does not seem so, at least in my case: > > marck@beaver:/FreeBSD> svn info src.current.svn/ > Path: src.current.svn > URL: file:///FreeBSD/svnmirror/base/head > Repository Root: file:///FreeBSD/svnmirror/base > Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f > Revision: 213844 > Node Kind: directory > Schedule: normal > Last Changed Author: yongari > Last Changed Rev: 213844 > Last Changed Date: 2010-10-14 22:31:40 +0400 (Thu, 14 Oct 2010) > > marck@beaver:/FreeBSD> tail /var/tmp/buildlog.svn.i386 > cc -O2 -pipe -nostdinc -I/usr/include -I. > -I/FreeBSD/src.current.svn/sys/dev/aic7xxx/aicasm -std=gnu99 > -Wsystem-headers -Werror -Wall -Wno-format-y2k -W > -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes > -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch > -Wshadow -Wunused-parameter -Wcast-align -Wno-pointer-sign -c > aicasm_macro_gram.c > cc -O2 -pipe -nostdinc -I/usr/include -I. > -I/FreeBSD/src.current.svn/sys/dev/aic7xxx/aicasm -std=gnu99 > -Wsystem-headers -Werror -Wall -Wno-format-y2k -W > -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes > -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch > -Wshadow -Wunused-parameter -Wcast-align -Wno-pointer-sign -c > aicasm_scan.c > cc1: warnings being treated as errors > /FreeBSD/src.current.svn/sys/dev/aic7xxx/aicasm/aicasm_scan.l:840: > warning: function declaration isn't a prototype > *** Error code 1 > 1 error > *** Error code 2 > 1 error > *** Error code 2 > 1 error Hmm... That means "make buildkernel" did not pick up newly built lex. That's bad. :-( Jung-uk Kim From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 19:25:44 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE817106566B; Thu, 14 Oct 2010 19:25:44 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 5EDA38FC15; Thu, 14 Oct 2010 19:25:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.4/8.14.4) with ESMTP id o9EJPh4f087386; Thu, 14 Oct 2010 23:25:43 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Thu, 14 Oct 2010 23:25:43 +0400 (MSD) From: Dmitry Morozovsky To: Jung-uk Kim In-Reply-To: <201010141523.29842.jkim@FreeBSD.org> Message-ID: References: <201010131033.o9DAX1EE080534@svn.freebsd.org> <201010141505.14869.jkim@FreeBSD.org> <201010141523.29842.jkim@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (woozle.rinet.ru [0.0.0.0]); Thu, 14 Oct 2010 23:25:43 +0400 (MSD) Cc: src-committers@FreeBSD.org, Rui Paulo , John Baldwin , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, John Nielsen Subject: Re: svn commit: r213765 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 19:25:45 -0000 On Thu, 14 Oct 2010, Jung-uk Kim wrote: JK> > JK> > JK> > > JN> >> I'm migrating a box from 8-STABLE to -CURRENT this JK> > morning JK> > > and this JN> >> commit seems to break buildkernel: JK> > JK> > [snip] JK> > JK> > JK> > > I can confirm this: my build machine, which is JK> > JK> > > JK> > JK> > > FreeBSD beaver.rinet.ru 8.1-STABLE FreeBSD 8.1-STABLE #1 JK> > JK> > > r213380M: Sun Oct 3 13:25:15 MSD 2010 JK> > JK> > > JK> > JK> > > is now failing 'buildworld buildkernel JK> > __MAKE_CONF=/dev/null' for JK> > > HEAD sources both for JK> > TARGET=amd64 and i386 JK> > JK> > JK> > JK> > The tinderboxes are also failing (at least sun4v). JK> > JK> JK> > JK> No, it's fixed already: JK> > JK> JK> > JK> JK> > http://svn.freebsd.org/viewvc/base?view=revision&revision=213764 JK> > JK> > It does not seem so, at least in my case: JK> > JK> > marck@beaver:/FreeBSD> svn info src.current.svn/ JK> > Path: src.current.svn JK> > URL: file:///FreeBSD/svnmirror/base/head JK> > Repository Root: file:///FreeBSD/svnmirror/base JK> > Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f JK> > Revision: 213844 JK> > Node Kind: directory JK> > Schedule: normal JK> > Last Changed Author: yongari JK> > Last Changed Rev: 213844 JK> > Last Changed Date: 2010-10-14 22:31:40 +0400 (Thu, 14 Oct 2010) JK> > JK> > marck@beaver:/FreeBSD> tail /var/tmp/buildlog.svn.i386 JK> > cc -O2 -pipe -nostdinc -I/usr/include -I. JK> > -I/FreeBSD/src.current.svn/sys/dev/aic7xxx/aicasm -std=gnu99 JK> > -Wsystem-headers -Werror -Wall -Wno-format-y2k -W JK> > -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes JK> > -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch JK> > -Wshadow -Wunused-parameter -Wcast-align -Wno-pointer-sign -c JK> > aicasm_macro_gram.c JK> > cc -O2 -pipe -nostdinc -I/usr/include -I. JK> > -I/FreeBSD/src.current.svn/sys/dev/aic7xxx/aicasm -std=gnu99 JK> > -Wsystem-headers -Werror -Wall -Wno-format-y2k -W JK> > -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes JK> > -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch JK> > -Wshadow -Wunused-parameter -Wcast-align -Wno-pointer-sign -c JK> > aicasm_scan.c JK> > cc1: warnings being treated as errors JK> > /FreeBSD/src.current.svn/sys/dev/aic7xxx/aicasm/aicasm_scan.l:840: JK> > warning: function declaration isn't a prototype JK> > *** Error code 1 JK> > 1 error JK> > *** Error code 2 JK> > 1 error JK> > *** Error code 2 JK> > 1 error JK> JK> Hmm... That means "make buildkernel" did not pick up newly built lex. JK> That's bad. :-( It seems Rui's r213845 should fix this; I'm checking this right now... -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 19:30:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF44C1065670; Thu, 14 Oct 2010 19:30: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 BE0A28FC14; Thu, 14 Oct 2010 19:30:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EJUi3T034418; Thu, 14 Oct 2010 19:30:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EJUii3034416; Thu, 14 Oct 2010 19:30:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010141930.o9EJUii3034416@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 14 Oct 2010 19:30:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213846 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 19:30:44 -0000 Author: kib Date: Thu Oct 14 19:30:44 2010 New Revision: 213846 URL: http://svn.freebsd.org/changeset/base/213846 Log: Remove stale comment. Submitted by: arundel MFC after: 3 days Modified: head/sys/compat/linux/linux_util.h Modified: head/sys/compat/linux/linux_util.h ============================================================================== --- head/sys/compat/linux/linux_util.h Thu Oct 14 19:19:19 2010 (r213845) +++ head/sys/compat/linux/linux_util.h Thu Oct 14 19:30:44 2010 (r213846) @@ -31,11 +31,6 @@ * $FreeBSD$ */ -/* - * This file is pretty much the same as Christos' svr4_util.h - * (for now). - */ - #ifndef _LINUX_UTIL_H_ #define _LINUX_UTIL_H_ From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 19:39:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2D6F106566C; Thu, 14 Oct 2010 19:39:54 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8295A8FC0C; Thu, 14 Oct 2010 19:39:54 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 2D87046B65; Thu, 14 Oct 2010 15:39:54 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 224CE8A009; Thu, 14 Oct 2010 15:39:53 -0400 (EDT) From: John Baldwin To: Rui Paulo Date: Thu, 14 Oct 2010 15:39:23 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201010141919.o9EJJJIc034032@svn.freebsd.org> In-Reply-To: <201010141919.o9EJJJIc034032@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201010141539.23573.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 14 Oct 2010 15:39:53 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213845 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 19:39:54 -0000 On Thursday, October 14, 2010 3:19:19 pm Rui Paulo wrote: > Author: rpaulo > Date: Thu Oct 14 19:19:19 2010 > New Revision: 213845 > URL: http://svn.freebsd.org/changeset/base/213845 > > Log: > Revert r213765. This is required because our build infrastructure uses > the host lex instead of the lex built during buildworld. I will MFC the > lex changes soon and in a few weeks this I'll commit again r213765. Can't you make 'lex' a build-tool to workaround this? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 19:58:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id F1EBB106566B; Thu, 14 Oct 2010 19:58:11 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Bruce Evans Date: Thu, 14 Oct 2010 15:58:00 -0400 User-Agent: KMail/1.6.2 References: <201010131717.o9DHHobD094458@svn.freebsd.org> <201010131359.44590.jkim@FreeBSD.org> <20101014113203.N1092@besplex.bde.org> In-Reply-To: <20101014113203.N1092@besplex.bde.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_LD2tMht+KpGaPcX" Message-Id: <201010141558.03154.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, Roman Divacky , src-committers@freebsd.org, Rui Paulo , svn-src-all@freebsd.org Subject: Re: svn commit: r213793 - in head/sys/dev: ce cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 19:58:13 -0000 --Boundary-00=_LD2tMht+KpGaPcX Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wednesday 13 October 2010 09:16 pm, Bruce Evans wrote: > On Wed, 13 Oct 2010, Jung-uk Kim wrote: > > On Wednesday 13 October 2010 01:27 pm, Roman Divacky wrote: > >>> Modified: head/sys/dev/ce/if_ce.c > >>> =============================================================== > >>>== ============= --- head/sys/dev/ce/if_ce.c Wed Oct 13 17:16:08 > >>> 2010 (r213792) +++ head/sys/dev/ce/if_ce.c Wed Oct 13 17:17:50 > >>> 2010 (r213793) @@ -1313,7 +1313,7 @@ static int ce_ioctl > >>> (struct cdev *dev, u IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); > >>> IFP2SP(d->ifp)->pp_flags |= PP_KEEPALIVE; > >>> d->ifp->if_flags |= PP_CISCO; > >>> - } else if (! strcmp ("fr", (char*)data) && PP_FR) { > >>> + } else if (! strcmp ("fr", (char*)data)) { > >> > >> this is wrong I think... the PP_FR was used for compiling in/out > >> support for something.. see the comment: > >> > >> /* If we don't have Cronyx's sppp version, we don't have fr > >> support via sppp */ #ifndef PP_FR > >> #define PP_FR 0 > >> #endif > >> > >> note that PP_FR is used in some other places as a flag. I guess > >> that by compiling with something like make -DPP_FR=42 some magic > >> would happen. > >> > >> anyway - this does not look like a bug but like an intent, > >> please revert. > > > > I think the attached patch should do. > > % Index: sys/dev/ce/if_ce.c > % > =================================================================== > % --- sys/dev/ce/if_ce.c (revision 213782) > % +++ sys/dev/ce/if_ce.c (working copy) > % @@ -1313,9 +1313,11 @@ static int ce_ioctl (struct cdev *dev, > u_long cmd, % IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); > % IFP2SP(d->ifp)->pp_flags |= PP_KEEPALIVE; > % d->ifp->if_flags |= PP_CISCO; > % - } else if (! strcmp ("fr", (char*)data) && PP_FR) { > % +#if PP_FR > 0 > % + } else if (! strcmp ("fr", (char*)data)) { > % d->ifp->if_flags &= ~(PP_CISCO); > % IFP2SP(d->ifp)->pp_flags |= PP_FR | PP_KEEPALIVE; > % +#endif > % } else if (! strcmp ("ppp", (char*)data)) { > % IFP2SP(d->ifp)->pp_flags &= ~PP_FR; > % IFP2SP(d->ifp)->pp_flags &= ~PP_KEEPALIVE; > % ... > > This gives different behaviour if PP_FR is even or negative. Even > values used to fail the match, but now the match succeeds for even > values > 0 and then the bits of PP_FR are put in pp_flags. > Negative values used to pass the match if they were odd, but now > the match is not attempted for any negative value. It just might > be useful for PP_FR to have multiple bits set, with the 1 bit used > for enabling this and the other bits used for setting pp_flags. If > not, then only values of 0 and 1 for PP_FR make sense, and the > ifdef should be "#if PP_FR == 1". I don't understand your remarks about PP_FR being even/odd. Maybe you are confused '&&' with '&'? ;-) Is the attached patch okay for you, then? Jung-uk Kim --Boundary-00=_LD2tMht+KpGaPcX Content-Type: text/plain; charset="iso-8859-1"; name="cronyx2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cronyx2.diff" Index: sys/dev/ce/if_ce.c =================================================================== --- sys/dev/ce/if_ce.c (revision 213846) +++ sys/dev/ce/if_ce.c (working copy) @@ -1313,9 +1313,11 @@ static int ce_ioctl (struct cdev *dev, u_long cmd, IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); IFP2SP(d->ifp)->pp_flags |= PP_KEEPALIVE; d->ifp->if_flags |= PP_CISCO; - } else if (! strcmp ("fr", (char*)data) && PP_FR) { +#if PP_FR != 0 + } else if (! strcmp ("fr", (char*)data)) { d->ifp->if_flags &= ~(PP_CISCO); IFP2SP(d->ifp)->pp_flags |= PP_FR | PP_KEEPALIVE; +#endif } else if (! strcmp ("ppp", (char*)data)) { IFP2SP(d->ifp)->pp_flags &= ~PP_FR; IFP2SP(d->ifp)->pp_flags &= ~PP_KEEPALIVE; Index: sys/dev/cp/if_cp.c =================================================================== --- sys/dev/cp/if_cp.c (revision 213846) +++ sys/dev/cp/if_cp.c (working copy) @@ -1052,9 +1052,11 @@ static int cp_ioctl (struct cdev *dev, u_long cmd, IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); IFP2SP(d->ifp)->pp_flags |= PP_KEEPALIVE; d->ifp->if_flags |= PP_CISCO; - } else if (! strcmp ("fr", (char*)data) && PP_FR) { +#if PP_FR != 0 + } else if (! strcmp ("fr", (char*)data)) { d->ifp->if_flags &= ~(PP_CISCO); IFP2SP(d->ifp)->pp_flags |= PP_FR | PP_KEEPALIVE; +#endif } else if (! strcmp ("ppp", (char*)data)) { IFP2SP(d->ifp)->pp_flags &= ~PP_FR; IFP2SP(d->ifp)->pp_flags &= ~PP_KEEPALIVE; --Boundary-00=_LD2tMht+KpGaPcX-- From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 20:04:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 194E5106564A; Thu, 14 Oct 2010 20:04:37 +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 079818FC0C; Thu, 14 Oct 2010 20:04:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EK4a3S035423; Thu, 14 Oct 2010 20:04:36 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EK4aWu035417; Thu, 14 Oct 2010 20:04:36 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010142004.o9EK4aWu035417@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 14 Oct 2010 20:04:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213848 - head/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 20:04:37 -0000 Author: hselasky Date: Thu Oct 14 20:04:36 2010 New Revision: 213848 URL: http://svn.freebsd.org/changeset/base/213848 Log: LibUSB (new API): - Add a new API function to check the connected status of the USB handle in the LibUSB v1.0 and LibUSB v0.1 interfaces. Approved by: thompsa (mentor) Modified: head/lib/libusb/libusb.3 head/lib/libusb/libusb.h head/lib/libusb/libusb10.c head/lib/libusb/libusb20_compat01.c head/lib/libusb/usb.h Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Thu Oct 14 20:04:05 2010 (r213847) +++ head/lib/libusb/libusb.3 Thu Oct 14 20:04:36 2010 (r213848) @@ -231,6 +231,14 @@ been disconnected and a LIBUSB_ERROR cod .Pp . .Ft int +.Fn libusb_check_connected "libusb_device_handle *devh" +Test if USB device is still connected. Returns 0 on success, +LIBUSB_ERROR_NO_DEVICE if has been disconnected and a LIBUSB_ERROR +code on failure. +. +.Pp +. +.Ft int .Fn libusb_kernel_driver_active "libusb_device_handle *devh" "int interface" Determine if a driver is active on a interface. Returns 0 if no kernel driver is active, returns 1 if a kernel driver is active, returns LIBUSB_ERROR_NO_DEVICE @@ -488,6 +496,7 @@ The library is also compliant with LibUS .Fn usb_find_devices .Fn usb_device .Fn usb_get_busses +.Fn usb_check_connected . .Sh SEE ALSO .Xr libusb20 3 , Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Thu Oct 14 20:04:05 2010 (r213847) +++ head/lib/libusb/libusb.h Thu Oct 14 20:04:36 2010 (r213848) @@ -316,6 +316,7 @@ int libusb_set_configuration(libusb_devi int libusb_claim_interface(libusb_device_handle * devh, int interface_number); int libusb_release_interface(libusb_device_handle * devh, int interface_number); int libusb_reset_device(libusb_device_handle * devh); +int libusb_check_connected(libusb_device_handle * devh); int libusb_kernel_driver_active(libusb_device_handle * devh, int interface); int libusb_detach_kernel_driver(libusb_device_handle * devh, int interface); int libusb_attach_kernel_driver(libusb_device_handle * devh, int interface); Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Thu Oct 14 20:04:05 2010 (r213847) +++ head/lib/libusb/libusb10.c Thu Oct 14 20:04:36 2010 (r213848) @@ -663,6 +663,21 @@ libusb_reset_device(struct libusb20_devi } int +libusb_check_connected(struct libusb20_device *pdev) +{ + libusb_device *dev; + int err; + + dev = libusb_get_device(pdev); + if (dev == NULL) + return (LIBUSB_ERROR_INVALID_PARAM); + + err = libusb20_dev_check_connected(pdev); + + return (err ? LIBUSB_ERROR_NO_DEVICE : 0); +} + +int libusb_kernel_driver_active(struct libusb20_device *pdev, int interface) { if (pdev == NULL) Modified: head/lib/libusb/libusb20_compat01.c ============================================================================== --- head/lib/libusb/libusb20_compat01.c Thu Oct 14 20:04:05 2010 (r213847) +++ head/lib/libusb/libusb20_compat01.c Thu Oct 14 20:04:36 2010 (r213848) @@ -795,6 +795,19 @@ usb_reset(usb_dev_handle * dev) return (usb_close(dev)); } +int +usb_check_connected(usb_dev_handle * dev) +{ + int err; + + err = libusb20_dev_check_connected((void *)dev); + + if (err) + return (-1); + + return (0); +} + const char * usb_strerror(void) { Modified: head/lib/libusb/usb.h ============================================================================== --- head/lib/libusb/usb.h Thu Oct 14 20:04:05 2010 (r213847) +++ head/lib/libusb/usb.h Thu Oct 14 20:04:36 2010 (r213848) @@ -291,6 +291,7 @@ int usb_set_altinterface(usb_dev_handle int usb_resetep(usb_dev_handle * dev, unsigned int ep); int usb_clear_halt(usb_dev_handle * dev, unsigned int ep); int usb_reset(usb_dev_handle * dev); +int usb_check_connected(usb_dev_handle * dev); const char *usb_strerror(void); void usb_init(void); void usb_set_debug(int level); From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 20:18:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CE1A106566C; Thu, 14 Oct 2010 20:18:39 +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 5BAA68FC15; Thu, 14 Oct 2010 20:18:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EKIdWV035780; Thu, 14 Oct 2010 20:18:39 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EKIdLt035778; Thu, 14 Oct 2010 20:18:39 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010142018.o9EKIdLt035778@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 14 Oct 2010 20:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213849 - head/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 20:18:39 -0000 Author: hselasky Date: Thu Oct 14 20:18:39 2010 New Revision: 213849 URL: http://svn.freebsd.org/changeset/base/213849 Log: - Fix some compile warnings regarding comparing signed to unsigned. Approved by: thompsa (mentor) Modified: head/lib/libusb/libusb10_io.c Modified: head/lib/libusb/libusb10_io.c ============================================================================== --- head/lib/libusb/libusb10_io.c Thu Oct 14 20:04:36 2010 (r213848) +++ head/lib/libusb/libusb10_io.c Thu Oct 14 20:18:39 2010 (r213849) @@ -141,7 +141,7 @@ libusb10_handle_events_sub(struct libusb err = LIBUSB_ERROR_IO; if (err < 1) { - for (i = 0; i != nfds; i++) { + for (i = 0; i != (int)nfds; i++) { if (ppdev[i] != NULL) { CTX_UNLOCK(ctx); libusb_unref_device(libusb_get_device(ppdev[i])); @@ -150,7 +150,7 @@ libusb10_handle_events_sub(struct libusb } goto do_done; } - for (i = 0; i != nfds; i++) { + for (i = 0; i != (int)nfds; i++) { if (ppdev[i] != NULL) { dev = libusb_get_device(ppdev[i]); From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 20:35:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E31431065693; Thu, 14 Oct 2010 20:35:57 +0000 (UTC) (envelope-from marck@rinet.ru) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.freebsd.org (Postfix) with ESMTP id 2EF8B8FC0A; Thu, 14 Oct 2010 20:35:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.4/8.14.4) with ESMTP id o9EKZtnw088162; Fri, 15 Oct 2010 00:35:55 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Fri, 15 Oct 2010 00:35:55 +0400 (MSD) From: Dmitry Morozovsky To: Jung-uk Kim In-Reply-To: Message-ID: References: <201010131033.o9DAX1EE080534@svn.freebsd.org> <201010141505.14869.jkim@FreeBSD.org> <201010141523.29842.jkim@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (woozle.rinet.ru [0.0.0.0]); Fri, 15 Oct 2010 00:35:55 +0400 (MSD) Cc: src-committers@freebsd.org, Rui Paulo , John Baldwin , svn-src-all@freebsd.org, svn-src-head@freebsd.org, John Nielsen Subject: Re: svn commit: r213765 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 20:35:58 -0000 On Thu, 14 Oct 2010, Dmitry Morozovsky wrote: [snip] DM> JK> Hmm... That means "make buildkernel" did not pick up newly built lex. DM> JK> That's bad. :-( DM> DM> It seems Rui's r213845 should fix this; I'm checking this right now... Confirmed: this revision really fixed build. -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 20:38:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 166441065673; Thu, 14 Oct 2010 20:38:19 +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 03FB18FC0C; Thu, 14 Oct 2010 20:38:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EKcI66036366; Thu, 14 Oct 2010 20:38:18 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EKcImV036360; Thu, 14 Oct 2010 20:38:18 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010142038.o9EKcImV036360@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 14 Oct 2010 20:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213852 - in head: lib/libusb sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 20:38:19 -0000 Author: hselasky Date: Thu Oct 14 20:38:18 2010 New Revision: 213852 URL: http://svn.freebsd.org/changeset/base/213852 Log: - Add support for LibUSB in 32-bit compatibility mode. Approved by: thompsa (mentor) Modified: head/lib/libusb/Makefile head/lib/libusb/libusb20.c head/lib/libusb/libusb20_int.h head/lib/libusb/libusb20_ugen20.c head/sys/dev/usb/usb_ioctl.h Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Thu Oct 14 20:31:07 2010 (r213851) +++ head/lib/libusb/Makefile Thu Oct 14 20:38:18 2010 (r213852) @@ -30,5 +30,9 @@ SRCS+= libusb10.c SRCS+= libusb10_desc.c SRCS+= libusb10_io.c +.if defined(COMPAT_32BIT) +CFLAGS+= -DCOMPAT_32BIT +.endif + .include Modified: head/lib/libusb/libusb20.c ============================================================================== --- head/lib/libusb/libusb20.c Thu Oct 14 20:31:07 2010 (r213851) +++ head/lib/libusb/libusb20.c Thu Oct 14 20:38:18 2010 (r213852) @@ -320,7 +320,7 @@ libusb20_tr_clear_stall_sync(struct libu void libusb20_tr_set_buffer(struct libusb20_transfer *xfer, void *buffer, uint16_t frIndex) { - xfer->ppBuffer[frIndex] = buffer; + xfer->ppBuffer[frIndex] = libusb20_pass_ptr(buffer); return; } @@ -386,7 +386,7 @@ libusb20_tr_set_total_frames(struct libu void libusb20_tr_setup_bulk(struct libusb20_transfer *xfer, void *pBuf, uint32_t length, uint32_t timeout) { - xfer->ppBuffer[0] = pBuf; + xfer->ppBuffer[0] = libusb20_pass_ptr(pBuf); xfer->pLength[0] = length; xfer->timeout = timeout; xfer->nFrames = 1; @@ -398,7 +398,7 @@ libusb20_tr_setup_control(struct libusb2 { uint16_t len; - xfer->ppBuffer[0] = psetup; + xfer->ppBuffer[0] = libusb20_pass_ptr(psetup); xfer->pLength[0] = 8; /* fixed */ xfer->timeout = timeout; @@ -406,7 +406,7 @@ libusb20_tr_setup_control(struct libusb2 if (len != 0) { xfer->nFrames = 2; - xfer->ppBuffer[1] = pBuf; + xfer->ppBuffer[1] = libusb20_pass_ptr(pBuf); xfer->pLength[1] = len; } else { xfer->nFrames = 1; @@ -417,7 +417,7 @@ libusb20_tr_setup_control(struct libusb2 void libusb20_tr_setup_intr(struct libusb20_transfer *xfer, void *pBuf, uint32_t length, uint32_t timeout) { - xfer->ppBuffer[0] = pBuf; + xfer->ppBuffer[0] = libusb20_pass_ptr(pBuf); xfer->pLength[0] = length; xfer->timeout = timeout; xfer->nFrames = 1; @@ -431,7 +431,7 @@ libusb20_tr_setup_isoc(struct libusb20_t /* should not happen */ return; } - xfer->ppBuffer[frIndex] = pBuf; + xfer->ppBuffer[frIndex] = libusb20_pass_ptr(pBuf); xfer->pLength[frIndex] = length; return; } @@ -1167,7 +1167,7 @@ libusb20_be_alloc_ugen20(void) { struct libusb20_backend *pbe; -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) pbe = libusb20_be_alloc(&libusb20_ugen20_backend); #else pbe = NULL; Modified: head/lib/libusb/libusb20_int.h ============================================================================== --- head/lib/libusb/libusb20_int.h Thu Oct 14 20:31:07 2010 (r213851) +++ head/lib/libusb/libusb20_int.h Thu Oct 14 20:38:18 2010 (r213852) @@ -31,6 +31,12 @@ #ifndef _LIBUSB20_INT_H_ #define _LIBUSB20_INT_H_ +#ifdef COMPAT_32BIT +#define libusb20_pass_ptr(ptr) ((uint64_t)(uintptr_t)(ptr)) +#else +#define libusb20_pass_ptr(ptr) (ptr) +#endif + struct libusb20_device; struct libusb20_backend; struct libusb20_transfer; @@ -146,7 +152,11 @@ struct libusb20_transfer { /* * Pointer to a list of buffer pointers: */ +#ifdef COMPAT_32BIT + uint64_t *ppBuffer; +#else void **ppBuffer; +#endif /* * Pointer to frame lengths, which are updated to actual length * after the USB transfer completes: Modified: head/lib/libusb/libusb20_ugen20.c ============================================================================== --- head/lib/libusb/libusb20_ugen20.c Thu Oct 14 20:31:07 2010 (r213851) +++ head/lib/libusb/libusb20_ugen20.c Thu Oct 14 20:38:18 2010 (r213852) @@ -226,7 +226,7 @@ ugen20_readdir(struct ugen20_urd_state * repeat: if (st->ptr == NULL) { st->urd.urd_startentry += st->nparsed; - st->urd.urd_data = st->buf; + st->urd.urd_data = libusb20_pass_ptr(st->buf); st->urd.urd_maxlen = sizeof(st->buf); st->nparsed = 0; @@ -339,7 +339,7 @@ ugen20_tr_renew(struct libusb20_device * memset(&fs_init, 0, sizeof(fs_init)); - fs_init.pEndpoints = pdev->privBeData; + fs_init.pEndpoints = libusb20_pass_ptr(pdev->privBeData); fs_init.ep_index_max = nMaxTransfer; if (ioctl(pdev->file, USB_FS_INIT, &fs_init)) { @@ -453,7 +453,7 @@ ugen20_get_config_desc_full(struct libus memset(&cdesc, 0, sizeof(cdesc)); memset(&gen_desc, 0, sizeof(gen_desc)); - gen_desc.ugd_data = &cdesc; + gen_desc.ugd_data = libusb20_pass_ptr(&cdesc); gen_desc.ugd_maxlen = sizeof(cdesc); gen_desc.ugd_config_index = cfg_index; @@ -474,7 +474,7 @@ ugen20_get_config_desc_full(struct libus /* make sure memory is initialised */ memset(ptr, 0, len); - gen_desc.ugd_data = ptr; + gen_desc.ugd_data = libusb20_pass_ptr(ptr); gen_desc.ugd_maxlen = len; error = ioctl(pdev->file_ctrl, USB_GET_FULL_DESC, &gen_desc); @@ -666,7 +666,7 @@ ugen20_do_request_sync(struct libusb20_d memset(&req, 0, sizeof(req)); - req.ucr_data = data; + req.ucr_data = libusb20_pass_ptr(data); if (!(flags & LIBUSB20_TRANSFER_SINGLE_SHORT_NOT_OK)) { req.ucr_flags |= USB_SHORT_XFER_OK; } @@ -761,9 +761,9 @@ ugen20_tr_open(struct libusb20_transfer xfer->maxTotalLength = temp.max_bufsize; xfer->maxPacketLen = temp.max_packet_length; - /* setup buffer and length lists */ - fsep->ppBuffer = xfer->ppBuffer;/* zero copy */ - fsep->pLength = xfer->pLength; /* zero copy */ + /* setup buffer and length lists using zero copy */ + fsep->ppBuffer = libusb20_pass_ptr(xfer->ppBuffer); + fsep->pLength = libusb20_pass_ptr(xfer->pLength); return (0); /* success */ } @@ -883,7 +883,7 @@ ugen20_dev_get_iface_desc(struct libusb2 memset(&ugd, 0, sizeof(ugd)); - ugd.ugd_data = buf; + ugd.ugd_data = libusb20_pass_ptr(buf); ugd.ugd_maxlen = len; ugd.ugd_iface_index = iface_index; Modified: head/sys/dev/usb/usb_ioctl.h ============================================================================== --- head/sys/dev/usb/usb_ioctl.h Thu Oct 14 20:31:07 2010 (r213851) +++ head/sys/dev/usb/usb_ioctl.h Thu Oct 14 20:38:18 2010 (r213852) @@ -41,13 +41,21 @@ #define USB_GENERIC_NAME "ugen" struct usb_read_dir { +#ifdef COMPAT_32BIT + uint64_t urd_data; +#else void *urd_data; +#endif uint32_t urd_startentry; uint32_t urd_maxlen; }; struct usb_ctl_request { +#ifdef COMPAT_32BIT + uint64_t ucr_data; +#else void *ucr_data; +#endif uint16_t ucr_flags; uint16_t ucr_actlen; /* actual length transferred */ uint8_t ucr_addr; /* zero - currently not used */ @@ -60,7 +68,11 @@ struct usb_alt_interface { }; struct usb_gen_descriptor { +#ifdef COMPAT_32BIT + uint64_t ugd_data; +#else void *ugd_data; +#endif uint16_t ugd_lang_id; uint16_t ugd_maxlen; uint16_t ugd_actlen; @@ -126,9 +138,14 @@ struct usb_fs_endpoint { * NOTE: isochronous USB transfer only use one buffer, but can have * multiple frame lengths ! */ +#ifdef COMPAT_32BIT + uint64_t ppBuffer; + uint64_t pLength; +#else void **ppBuffer; /* pointer to userland buffers */ uint32_t *pLength; /* pointer to frame lengths, updated * to actual length */ +#endif uint32_t nFrames; /* number of frames */ uint32_t aFrames; /* actual number of frames */ uint16_t flags; @@ -150,7 +167,11 @@ struct usb_fs_endpoint { struct usb_fs_init { /* userland pointer to endpoints structure */ +#ifdef COMPAT_32BIT + uint64_t pEndpoints; +#else struct usb_fs_endpoint *pEndpoints; +#endif /* maximum number of endpoints */ uint8_t ep_index_max; }; From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 20:50:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E8871065673; Thu, 14 Oct 2010 20:50:34 +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 1BA528FC17; Thu, 14 Oct 2010 20:50:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EKoYgO036709; Thu, 14 Oct 2010 20:50:34 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EKoXJY036704; Thu, 14 Oct 2010 20:50:33 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010142050.o9EKoXJY036704@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 14 Oct 2010 20:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213853 - head/lib/libusb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 20:50:34 -0000 Author: hselasky Date: Thu Oct 14 20:50:33 2010 New Revision: 213853 URL: http://svn.freebsd.org/changeset/base/213853 Log: - Add missing LibUSB API functions: * libusb_strerror() * libusb_get_driver[_np]() * libusb_detach_kernel_driver[_np]() - Factor out setting of non-blocking flag inside libusb. - Add missing NULL check after libusb_get_device() call. - Correct some wrong error codes due to copy and paste error. PR: usb/150546 Submitted by: Robert Jenssen, Alexander Leidinger Approved by: thompsa (mentor) Modified: head/lib/libusb/libusb.3 head/lib/libusb/libusb.h head/lib/libusb/libusb10.c head/lib/libusb/libusb20.3 Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Thu Oct 14 20:38:18 2010 (r213852) +++ head/lib/libusb/libusb.3 Thu Oct 14 20:50:33 2010 (r213853) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 22, 2009 +.Dd October 14, 2010 .Dt LIBUSB 3 .Os .Sh NAME @@ -72,6 +72,15 @@ Deinitialise libusb. Must be called at t . .Pp . +.Ft const char * +.Fn libusb_strerror "int code" +Get ASCII representation of the error given by the +.Fa code +argument. +. +. +.Pp +. .Ft void .Fn libusb_set_debug "libusb_context *ctx" "int level" Set debug to the @@ -247,12 +256,37 @@ if the device has been disconnected and .Pp . .Ft int +.Fn libusb_get_driver "libusb_device_handle *devh" "int interface" "char *name" "int namelen" +or +.Ft int +.Fn libusb_get_driver_np "libusb_device_handle *devh" "int interface" "char *name" "int namelen" +Gets the name of the driver attached to the given +.Fa device +and +.Fa interface +into the buffer given by +.Fa name +and +.Fa namelen . +Returns 0 on success, LIBUSB_ERROR_NOT_FOUND if no kernel driver is attached +to the given interface and LIBUSB_ERROR_INVALID_PARAM if the interface does +not exist. +This function is non-portable. +The buffer pointed to by +.Fa name +is only zero terminated on success. +. +.Pp +. +.Ft int .Fn libusb_detach_kernel_driver "libusb_device_handle *devh" "int interface" -Detach a kernel driver from an interface. This is needed to claim an interface -required by a kernel driver. Returns 0 on success, LIBUSB_ERROR_NOT_FOUND if -no kernel driver was active, LIBUSB_ERROR_INVALID_PARAM if the interface does not -exist, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a -LIBUSB_ERROR code on failure. +or +.Ft int +.Fn libusb_detach_kernel_driver_np "libusb_device_handle *devh" "int interface" +Detach a kernel driver from an interface. +This is needed to claim an interface required by a kernel driver. +Returns 0 on success, LIBUSB_ERROR_NOT_FOUND if no kernel driver was active, +LIBUSB_ERROR_INVALID_PARAM if the interface does not exist, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a LIBUSB_ERROR code on failure. This function is non-portable. . .Pp . @@ -279,7 +313,7 @@ failure. . .Pp .Ft int -.Fn libsub_get_active_config_descriptor "libusb_device *dev" "libusb_device_descriptor **config" +.Fn libsub_get_active_config_descriptor "libusb_device *dev" "struct libusb_config_descriptor **config" Get the USB configuration descriptor for the active configuration. Returns 0 on success, returns LIBUSB_ERROR_NOT_FOUND if the device is in unconfigured state and return another LIBUSB_ERROR code on error. @@ -345,7 +379,7 @@ LIBUSB_ERROR code on failure. . .Pp .Ft int -.Fn libusb_control_transfer "libusb_device_handle *devh" "uint8_t bmRequestType" "uint16_t wIndex" "unsigned char *data" "uint16_t wLength" "unsigned int timeout" +.Fn libusb_control_transfer "libusb_device_handle *devh" "uint8_t bmRequestType" "uint8_t bRequest" "uint16_t wValue" "uint16_t wIndex" "unsigned char *data" "uint16_t wLength" "unsigned int timeout" Perform a USB control transfer. Returns 0 on success, LIBUSB_ERROR_TIMEOUT if the transfer timeout, LIBUSB_ERROR_PIPE if the control request was not supported, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Thu Oct 14 20:38:18 2010 (r213852) +++ head/lib/libusb/libusb.h Thu Oct 14 20:50:33 2010 (r213853) @@ -294,6 +294,7 @@ typedef struct libusb_transfer { /* Library initialisation */ void libusb_set_debug(libusb_context * ctx, int level); +const char *libusb_strerror(int code); int libusb_init(libusb_context ** context); void libusb_exit(struct libusb_context *ctx); @@ -318,6 +319,9 @@ int libusb_release_interface(libusb_devi int libusb_reset_device(libusb_device_handle * devh); int libusb_check_connected(libusb_device_handle * devh); int libusb_kernel_driver_active(libusb_device_handle * devh, int interface); +int libusb_get_driver_np(libusb_device_handle * devh, int interface, char *name, int namelen); +int libusb_get_driver(libusb_device_handle * devh, int interface, char *name, int namelen); +int libusb_detach_kernel_driver_np(libusb_device_handle * devh, int interface); int libusb_detach_kernel_driver(libusb_device_handle * devh, int interface); int libusb_attach_kernel_driver(libusb_device_handle * devh, int interface); int libusb_set_interface_alt_setting(libusb_device_handle * devh, int interface_number, int alternate_setting); Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Thu Oct 14 20:38:18 2010 (r213852) +++ head/lib/libusb/libusb10.c Thu Oct 14 20:50:33 2010 (r213853) @@ -70,12 +70,30 @@ libusb_set_debug(libusb_context *ctx, in ctx->debug = level; } +static void +libusb_set_nonblocking(int f) +{ + int flags; + + /* + * We ignore any failures in this function, hence the + * non-blocking flag is not critical to the operation of + * libUSB. We use F_GETFL and F_SETFL to be compatible with + * Linux. + */ + + flags = fcntl(f, F_GETFL, NULL); + if (flags == -1) + return; + flags |= O_NONBLOCK; + fcntl(f, F_SETFL, flags); +} + int libusb_init(libusb_context **context) { struct libusb_context *ctx; char *debug; - int flag; int ret; ctx = malloc(sizeof(*ctx)); @@ -106,12 +124,8 @@ libusb_init(libusb_context **context) return (LIBUSB_ERROR_OTHER); } /* set non-blocking mode on the control pipe to avoid deadlock */ - flag = 1; - ret = fcntl(ctx->ctrl_pipe[0], O_NONBLOCK, &flag); - assert(ret != -1 && "Couldn't set O_NONBLOCK for ctx->ctrl_pipe[0]"); - flag = 1; - ret = fcntl(ctx->ctrl_pipe[1], O_NONBLOCK, &flag); - assert(ret != -1 && "Couldn't set O_NONBLOCK for ctx->ctrl_pipe[1]"); + libusb_set_nonblocking(ctx->ctrl_pipe[0]); + libusb_set_nonblocking(ctx->ctrl_pipe[1]); libusb10_add_pollfd(ctx, &ctx->ctx_poll, NULL, ctx->ctrl_pipe[0], POLLIN); @@ -356,7 +370,7 @@ libusb_open(libusb_device *dev, libusb_d /* make sure our event loop detects the new device */ dummy = 0; err = write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); - if (err < sizeof(dummy)) { + if (err < (int)sizeof(dummy)) { /* ignore error, if any */ DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open write failed!"); } @@ -431,7 +445,7 @@ libusb_close(struct libusb20_device *pde /* make sure our event loop detects the closed device */ dummy = 0; err = write(ctx->ctrl_pipe[1], &dummy, sizeof(dummy)); - if (err < sizeof(dummy)) { + if (err < (int)sizeof(dummy)) { /* ignore error, if any */ DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_close write failed!"); } @@ -473,7 +487,6 @@ libusb_set_configuration(struct libusb20 uint8_t i; dev = libusb_get_device(pdev); - if (dev == NULL) return (LIBUSB_ERROR_INVALID_PARAM); @@ -620,6 +633,8 @@ libusb_clear_halt(struct libusb20_device return (LIBUSB_ERROR_INVALID_PARAM); dev = libusb_get_device(pdev); + if (dev == NULL) + return (LIBUSB_ERROR_INVALID_PARAM); CTX_LOCK(dev->ctx); err = libusb20_tr_open(xfer, 0, 0, endpoint); @@ -647,7 +662,7 @@ libusb_reset_device(struct libusb20_devi dev = libusb_get_device(pdev); if (dev == NULL) - return (LIBUSB20_ERROR_INVALID_PARAM); + return (LIBUSB_ERROR_INVALID_PARAM); libusb10_cancel_all_transfer(dev); @@ -688,6 +703,45 @@ libusb_kernel_driver_active(struct libus } int +libusb_get_driver_np(struct libusb20_device *pdev, int interface, + char *name, int namelen) +{ + return (libusb_get_driver(pdev, interface, name, namelen)); +} + +int +libusb_get_driver(struct libusb20_device *pdev, int interface, + char *name, int namelen) +{ + char *ptr; + int err; + + if (pdev == NULL) + return (LIBUSB_ERROR_INVALID_PARAM); + if (namelen < 1) + return (LIBUSB_ERROR_INVALID_PARAM); + + err = libusb20_dev_get_iface_desc( + pdev, interface, name, namelen); + + if (err != 0) + return (LIBUSB_ERROR_OTHER); + + /* we only want the driver name */ + ptr = strstr(name, ":"); + if (ptr != NULL) + *ptr = 0; + + return (0); +} + +int +libusb_detach_kernel_driver_np(struct libusb20_device *pdev, int interface) +{ + return (libusb_detach_kernel_driver(pdev, interface)); +} + +int libusb_detach_kernel_driver(struct libusb20_device *pdev, int interface) { int err; @@ -698,7 +752,7 @@ libusb_detach_kernel_driver(struct libus err = libusb20_dev_detach_kernel_driver( pdev, interface); - return (err ? LIBUSB20_ERROR_OTHER : 0); + return (err ? LIBUSB_ERROR_OTHER : 0); } int @@ -1377,3 +1431,9 @@ libusb_le16_to_cpu(uint16_t x) return (le16toh(x)); } +const char * +libusb_strerror(int code) +{ + /* TODO */ + return ("Unknown error"); +} Modified: head/lib/libusb/libusb20.3 ============================================================================== --- head/lib/libusb/libusb20.3 Thu Oct 14 20:38:18 2010 (r213852) +++ head/lib/libusb/libusb20.3 Thu Oct 14 20:50:33 2010 (r213853) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 18, 2009 +.Dd October 14, 2010 .Dt LIBUSB20 3 .Os .Sh NAME @@ -177,7 +177,7 @@ USB access library (libusb -lusb) .Ft int .Fn libusb20_be_set_template "struct libusb20_backend *pbe" "int temp" .Ft int -.Fn libusb20_be_get_dev_quirk "struct libusb20_backend *pber", "uint16_t index" "struct libusb20_quirk *pq" +.Fn libusb20_be_get_dev_quirk "struct libusb20_backend *pber" "uint16_t index" "struct libusb20_quirk *pq" .Ft int .Fn libusb20_be_get_quirk_name "struct libusb20_backend *pbe" "uint16_t index" "struct libusb20_quirk *pq" .Ft int From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:09:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 850731065696; Thu, 14 Oct 2010 21:09:37 +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 729648FC16; Thu, 14 Oct 2010 21:09:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EL9bWW037208; Thu, 14 Oct 2010 21:09:37 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EL9bOr037205; Thu, 14 Oct 2010 21:09:37 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010142109.o9EL9bOr037205@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 14 Oct 2010 21:09:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213856 - in head/sys/dev/usb: . quirk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:09:37 -0000 Author: hselasky Date: Thu Oct 14 21:09:37 2010 New Revision: 213856 URL: http://svn.freebsd.org/changeset/base/213856 Log: - Add more USB devices to usbdevs and rename some previously unknown ones. - Add more USB mass storage quirks. Submitted by: Dmitry Luhtionov PR: usb/149934, usb/143045 Approved by: thompsa (mentor) Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Thu Oct 14 21:09:04 2010 (r213855) +++ head/sys/dev/usb/quirk/usb_quirk.c Thu Oct 14 21:09:37 2010 (r213856) @@ -159,10 +159,8 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(ALCOR, AU6390, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(ALCOR, UMCR_9361, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), - USB_QUIRK(ALCOR, TRANSCEND, 0x0142, 0x0142, UQ_MSC_FORCE_WIRE_BBB, - UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN, UQ_MSC_NO_SYNC_CACHE), - USB_QUIRK(ALCOR, TRANSCEND, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, - UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_GETMAXLUN), + USB_QUIRK(ALCOR, TRANSCEND, 0x0000, 0xffff, UQ_MSC_NO_GETMAXLUN, + UQ_MSC_NO_SYNC_CACHE, UQ_MSC_NO_TEST_UNIT_READY), USB_QUIRK(APACER, HT202, 0x0000, 0xffff, UQ_MSC_NO_TEST_UNIT_READY, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(ASAHIOPTICAL, OPTIO230, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, @@ -195,7 +193,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(FREECOM, DVD, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(FREECOM, HDD, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(FUJIPHOTO, MASS0100, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_CBI_I, - UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_RS_CLEAR_UA), + UQ_MSC_FORCE_PROTO_ATAPI, UQ_MSC_NO_RS_CLEAR_UA, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(GENESYS, GL641USB2IDE, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_FORCE_SHORT_INQ, UQ_MSC_NO_START_STOP, UQ_MSC_IGNORE_RESIDUE, UQ_MSC_NO_SYNC_CACHE), @@ -456,8 +454,9 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(ACTIONS, MP4, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_SYNC_CACHE), USB_QUIRK(ASUS, GMSC, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), - USB_QUIRK(UNKNOWN4, USBMEMSTICK, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), - USB_QUIRK(UNKNOWN5, USB2IDEBRIDGE, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(CHIPSBANK, USBMEMSTICK, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(CHIPSBANK, USBMEMSTICK1, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), + USB_QUIRK(NEWLINK, USB2IDEBRIDGE, 0x0000, 0xffff, UQ_MSC_NO_SYNC_CACHE), }; #undef USB_QUIRK_VP #undef USB_QUIRK Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Oct 14 21:09:04 2010 (r213855) +++ head/sys/dev/usb/usbdevs Thu Oct 14 21:09:37 2010 (r213856) @@ -58,7 +58,7 @@ $FreeBSD$ vendor UNKNOWN1 0x0053 Unknown vendor vendor UNKNOWN2 0x0105 Unknown vendor vendor EGALAX2 0x0123 eGalax, Inc. -vendor UNKNOWN4 0x0204 Unknown vendor +vendor CHIPSBANK 0x0204 Chipsbank Microelectronics Co. vendor HUMAX 0x02ad HUMAX vendor LTS 0x0386 LTS vendor BWCT 0x03da Bernd Walter Computer Technology @@ -403,7 +403,7 @@ vendor ARASAN 0x07da Arasan Chip System vendor ALLIEDCABLE 0x07e6 Allied Cable vendor STSN 0x07ef STSN vendor CENTURY 0x07f7 Century Corp -vendor UNKNOWN5 0x07ff Unknown +vendor NEWLINK 0x07ff NEWlink vendor ZOOM 0x0803 Zoom Telephonics vendor PCS 0x0810 Personal Communication Systems vendor ALPHASMART 0x081e AlphaSmart, Inc. @@ -651,18 +651,21 @@ vendor METAGEEK 0x1781 MetaGeek vendor WAVESENSE 0x17f4 WaveSense vendor VAISALA 0x1843 Vaisala vendor AMIT 0x18c5 AMIT +vendor GOOGLE 0x18d1 Google vendor QCOM 0x18e8 Qcom vendor ELV 0x18ef ELV vendor LINKSYS3 0x1915 Linksys vendor QUALCOMMINC 0x19d2 Qualcomm, Incorporated vendor WCH2 0x1a86 QinHeng Electronics vendor STELERA 0x1a8d Stelera Wireless +vendor MATRIXORBITAL 0x1b3d Matrix Orbital vendor OVISLINK 0x1b75 OvisLink vendor TCTMOBILE 0x1bbb TCT Mobile vendor TELIT 0x1bc7 Telit vendor LONGCHEER 0x1c9e Longcheer Holdings, Ltd. vendor MPMAN 0x1cae MpMan vendor DRESDENELEKTRONIK 0x1cf1 dresden elektronik +vendor NEOTEL 0x1d09 Neotel vendor PEGATRON 0x1d4d Pegatron vendor QISDA 0x1da5 Qisda vendor METAGEEK2 0x1dd5 MetaGeek @@ -1292,6 +1295,10 @@ product CREATIVE3 OPTICAL_MOUSE 0x0001 N product CSR BT_DONGLE 0x0001 Bluetooth USB dongle product CSR CSRDFU 0xffff USB Bluetooth Device in DFU State +/* Chipsbank Microelectronics Co., Ltd */ +product CHIPSBANK USBMEMSTICK 0x6025 CBM2080 Flash drive controller +product CHIPSBANK USBMEMSTICK1 0x6026 CBM1180 Flash drive controller + /* CTX products */ product CTX EX1300 0x9999 Ex1300 hub @@ -1401,6 +1408,7 @@ product DLINK DSB650TX_PNA 0x4003 1/10/1 product DLINK DSB650TX3 0x400b 10/100 Ethernet product DLINK DSB650TX2 0x4102 10/100 Ethernet product DLINK DSB650 0xabc1 10/100 Ethernet +product DLINK DUBH7 0xf103 DUB-H7 USB 2.0 7-Port Hub product DLINK2 DWA120 0x3a0c DWA-120 product DLINK2 DWA120_NF 0x3a0d DWA-120 (no firmware) product DLINK2 DWLG122C1 0x3c03 DWL-G122 c1 @@ -1583,7 +1591,8 @@ product FTDI UOPTBR 0xe889 USB-RS232 Op product FTDI EMCU2D 0xe88a Expert mouseCLOCK USB II product FTDI PCMSFU 0xe88b Precision Clock MSF USB product FTDI EMCU2H 0xe88c Expert mouseCLOCK USB II HBG -product FTDI MAXSTREAM 0xee18 Maxstream PKG-U +product FTDI MAXSTREAM 0xee18 Maxstream PKG-U +product FTDI USB_UIRT 0xf850 USB-UIRT product FTDI USBSERIAL 0xfa00 Matrix Orbital USB Serial product FTDI MX2_3 0xfa01 Matrix Orbital MX2 or MX3 product FTDI MX4_5 0xfa02 Matrix Orbital MX4 or MX5 @@ -1619,7 +1628,8 @@ product GENERALINSTMNTS SB5100 0x5100 SU /* Genesys Logic products */ product GENESYS GL620USB 0x0501 GL620USB Host-Host interface -product GENESYS GL650 0x0604 GL650 Hub +product GENESYS GL650 0x0604 GL650 HUB +product GENESYS GL606 0x0606 USB 2.0 HUB product GENESYS GL641USB 0x0700 GL641USB CompactFlash Card Reader product GENESYS GL641USB2IDE_2 0x0701 GL641USB USB-IDE Bridge No 2 product GENESYS GL641USB2IDE 0x0702 GL641USB USB-IDE Bridge @@ -1666,6 +1676,9 @@ product GOHUBS GOCOM232 0x1001 GoCOM232 product GOODWAY GWUSB2E 0x6200 GWUSB2E product GOODWAY RT2573 0xc019 RT2573 +/* Google products */ +product GOOGLE NEXUSONE 0x4e11 Nexus One + /* Gravis products */ product GRAVIS GAMEPADPRO 0x4001 GamePad Pro @@ -1842,6 +1855,7 @@ product HUAWEI E143D 0x143d 3G modem product HUAWEI E143E 0x143e 3G modem product HUAWEI E143F 0x143f 3G modem product HUAWEI E1752 0x1446 3G modem +product HUAWEI K3765 0x1465 3G modem product HUAWEI E14AC 0x14ac 3G modem /* HUAWEI 3com products */ @@ -1900,6 +1914,9 @@ product IODATA2 USB2SC 0x0a09 USB2.0-SC product IOMEGA ZIP100 0x0001 Zip 100 product IOMEGA ZIP250 0x0030 Zip 250 +/* Integrated System Solution Corp. products */ +product ISSC ISSCBTA 0x1001 Bluetooth USB Adapter + /* iTegno products */ product ITEGNO WM1080A 0x1080 WM1080A GSM/GPRS modem product ITEGNO WM2080A 0x2080 WM2080A CDMA modem @@ -2082,6 +2099,9 @@ product MACALLY MOUSE1 0x0101 mouse /* Marvell Technology Group, Ltd. products */ product MARVELL SHEEVAPLUG 0x9e8f SheevaPlug serial interface + +/* Matrix Orbital products */ +product MATRIXORBITAL MOUA 0x0153 Martrix Orbital MOU-Axxxx LCD displays /* MCT Corp. */ product MCT HUB0100 0x0100 Hub @@ -2110,6 +2130,8 @@ product MELCO G54HP 0x00d9 WLI-U2-G54HP product MELCO KG54L 0x00da WLI-U2-KG54L product MELCO WLIUCG300N 0x00e8 WLI-UC-G300N product MELCO SG54HG 0x00f4 WLI-U2-SG54HG +product MELCO WLRUCG 0x0116 WLR-UC-G +product MELCO WLRUCGAOSS 0x0119 WLR-UC-G-AOSS product MELCO WLIUCAG300N 0x012e WLI-UC-AG300N product MELCO RT2870_1 0x0148 RT2870 product MELCO RT2870_2 0x0150 RT2870 @@ -2261,6 +2283,7 @@ product MSYSTEMS DISKONKEY2 0x0011 DiskO /* Myson products */ product MYSON HEDEN_8813 0x8813 USB-IDE product MYSON HEDEN 0x8818 USB-IDE +product MYSON HUBREADER 0x8819 COMBO Card reader with USB HUB product MYSON STARREADER 0x9920 USB flash card adapter /* National Semiconductor */ @@ -2277,6 +2300,9 @@ product NEC HUB_B 0x55ab hub product NEODIO ND3260 0x3260 8-in-1 Multi-format Flash Controller product NEODIO ND5010 0x5010 Multi-format Flash Controller +/* Neotel products */ +product NEOTEL PRIME 0x4000 Prime USB modem + /* Netac products */ product NETAC CF_CARD 0x1060 USB-CF-Card product NETAC ONLYDISK 0x0003 OnlyDisk @@ -2307,6 +2333,9 @@ product NETGEAR3 WPN111_2 0x5f02 WPN111 /* NetIndex products */ product NETINDEX WS002IN 0x2001 Willcom WS002IN +/* NEWlink */ +product NEWLINK USB2IDEBRIDGE 0x00ff USB 2.0 Hard Drive Enclosure + /* Nikon products */ product NIKON E990 0x0102 Digital Camera E990 product NIKON LS40 0x4000 CoolScan LS40 ED @@ -2657,7 +2686,6 @@ product QUALCOMMINC E0076 0x0076 3G mode product QUALCOMMINC E0078 0x0078 3G modem product QUALCOMMINC E0082 0x0082 3G modem product QUALCOMMINC E0086 0x0086 3G modem -product QUALCOMMINC E2000 0x2000 3G modem product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem @@ -2670,7 +2698,7 @@ product QUANTA Q111 0xea03 HSDPA modem product QUANTA GLX 0xea04 HSDPA modem product QUANTA GKE 0xea05 HSDPA modem product QUANTA GLE 0xea06 HSDPA modem -product QUANTA RW6815_2 0xf003 HP iPAQ rw6815 +product QUANTA RW6815R 0xf003 HP iPAQ rw6815 RNDIS /* Qtronix products */ product QTRONIX 980N 0x2011 Scorpion-980N keyboard @@ -2707,6 +2735,7 @@ product RATOC REXUSB60F 0xb020 USB seri /* ReakTek products */ /* Green House and CompUSA OEM this part */ +product REALTEK USB20CRW 0x0158 USB20CRW Card Reader product REALTEK USBKR100 0x8150 USBKR100 USB Ethernet product REALTEK RTL8187 0x8187 RTL8187 Wireless Adapter product REALTEK RTL8187B_0 0x8189 RTL8187B Wireless Adapter @@ -3241,9 +3270,6 @@ product UMEDIA AR5523_2_NF 0x3206 AR5523 product UNIACCESS PANACHE 0x0101 Panache Surf USB ISDN Adapter /* Unknown vendors */ -product UNKNOWN4 USBMEMSTICK 0x6025 Flash Disk CBM - -/* Unknown vendors */ product UNKNOWN5 USB2IDEBRIDGE 0x00ff USB 2.0 ATA/SATA Bridge /* USI products */ From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:09:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EADF51065697; Thu, 14 Oct 2010 21:09:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id A98588FC0A; Thu, 14 Oct 2010 21:09:55 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:e01f:75a4:f72f:81e2] (unknown [IPv6:2001:7b8:3a7:0:e01f:75a4:f72f:81e2]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id C67165C43; Thu, 14 Oct 2010 23:09:54 +0200 (CEST) Message-ID: <4CB771A6.1070103@FreeBSD.org> Date: Thu, 14 Oct 2010 23:09:58 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.12pre) Gecko/20101007 Lanikai/3.1.6pre MIME-Version: 1.0 To: John Baldwin References: <201010141919.o9EJJJIc034032@svn.freebsd.org> <201010141539.23573.jhb@freebsd.org> In-Reply-To: <201010141539.23573.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo Subject: Re: svn commit: r213845 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:09:56 -0000 On 2010-10-14 21:39, John Baldwin wrote: > On Thursday, October 14, 2010 3:19:19 pm Rui Paulo wrote: ... >> Revert r213765. This is required because our build infrastructure uses >> the host lex instead of the lex built during buildworld. I will MFC the >> lex changes soon and in a few weeks this I'll commit again r213765. > Can't you make 'lex' a build-tool to workaround this? That will not help for "cd conf/CONF && make kernel", apparently. It will always use the host lex. From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:14:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 732B5106566B; Thu, 14 Oct 2010 21:14:33 +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 619928FC14; Thu, 14 Oct 2010 21:14:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELEXr2037410; Thu, 14 Oct 2010 21:14:33 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELEXeH037408; Thu, 14 Oct 2010 21:14:33 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010142114.o9ELEXeH037408@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 14 Oct 2010 21:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213857 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:14:33 -0000 Author: hselasky Date: Thu Oct 14 21:14:33 2010 New Revision: 213857 URL: http://svn.freebsd.org/changeset/base/213857 Log: Correct EHCI port register read. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/controller/ehci.c Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Thu Oct 14 21:09:37 2010 (r213856) +++ head/sys/dev/usb/controller/ehci.c Thu Oct 14 21:14:33 2010 (r213857) @@ -3318,7 +3318,7 @@ ehci_roothub_exec(struct usb_device *ude err = USB_ERR_IOERROR; goto done; } - v = EOREAD4(sc, EHCI_HCSPARAMS); + v = EREAD4(sc, EHCI_HCSPARAMS); sc->sc_hub_desc.hubd = ehci_hubd; sc->sc_hub_desc.hubd.bNbrPorts = sc->sc_noport; From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:14:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C35701065675; Thu, 14 Oct 2010 21:14:58 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B10858FC18; Thu, 14 Oct 2010 21:14:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELEwdD037449; Thu, 14 Oct 2010 21:14:58 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELEw2g037447; Thu, 14 Oct 2010 21:14:58 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201010142114.o9ELEw2g037447@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 14 Oct 2010 21:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213858 - stable/6/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:14:58 -0000 Author: edwin Date: Thu Oct 14 21:14:58 2010 New Revision: 213858 URL: http://svn.freebsd.org/changeset/base/213858 Log: MFC of r213032 r213033 Fix location and year of the Battle of the Plains of Abraham PR: 150504 Submitted by: Douglas Berry Modified: stable/6/usr.bin/calendar/calendars/calendar.history Directory Properties: stable/6/usr.bin/calendar/ (props changed) Modified: stable/6/usr.bin/calendar/calendars/calendar.history ============================================================================== --- stable/6/usr.bin/calendar/calendars/calendar.history Thu Oct 14 21:14:33 2010 (r213857) +++ stable/6/usr.bin/calendar/calendars/calendar.history Thu Oct 14 21:14:58 2010 (r213858) @@ -303,7 +303,7 @@ 09/12 German paratroopers rescue Mussolini from captivity in Rome, 1943 09/12 Germany annexes Sudetenland, 1938 09/13 58° C (136.4° F) measured at el Azizia, Libya, 1922 -09/13 British defeat the French at Abraham near Quebec City, 1788 +09/13 British defeat the French at the Plains of Abraham, just outside the walls of Quebec City, 1759 09/13 Building of Hadrian's Wall begun, 122 09/13 Chiang Kai-Shek becomes president of China, 1943 09/14 Benjamin Franklin is sent to France as an American minister, 1778 From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:16:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BF6A106566C; Thu, 14 Oct 2010 21:16:15 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09B528FC15; Thu, 14 Oct 2010 21:16:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELGEt5037536; Thu, 14 Oct 2010 21:16:14 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELGEgX037534; Thu, 14 Oct 2010 21:16:14 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201010142116.o9ELGEgX037534@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 14 Oct 2010 21:16:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213859 - stable/8/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:16:15 -0000 Author: edwin Date: Thu Oct 14 21:16:14 2010 New Revision: 213859 URL: http://svn.freebsd.org/changeset/base/213859 Log: MFC of r213032 r213033 Fix location and year of the Battle of the Plains of Abraham PR: 150504 Submitted by: Douglas Berry Modified: stable/8/usr.bin/calendar/calendars/calendar.history Directory Properties: stable/8/usr.bin/calendar/ (props changed) Modified: stable/8/usr.bin/calendar/calendars/calendar.history ============================================================================== --- stable/8/usr.bin/calendar/calendars/calendar.history Thu Oct 14 21:14:58 2010 (r213858) +++ stable/8/usr.bin/calendar/calendars/calendar.history Thu Oct 14 21:16:14 2010 (r213859) @@ -303,7 +303,7 @@ 09/12 German paratroopers rescue Mussolini from captivity in Rome, 1943 09/12 Germany annexes Sudetenland, 1938 09/13 58° C (136.4° F) measured at el Azizia, Libya, 1922 -09/13 British defeat the French at Abraham near Quebec City, 1788 +09/13 British defeat the French at the Plains of Abraham, just outside the walls of Quebec City, 1759 09/13 Building of Hadrian's Wall begun, 122 09/13 Chiang Kai-Shek becomes president of China, 1943 09/14 Benjamin Franklin is sent to France as an American minister, 1778 From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:17:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36E0C1065693; Thu, 14 Oct 2010 21:17:33 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 249C68FC16; Thu, 14 Oct 2010 21:17:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELHXR8037623; Thu, 14 Oct 2010 21:17:33 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELHXMG037621; Thu, 14 Oct 2010 21:17:33 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201010142117.o9ELHXMG037621@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 14 Oct 2010 21:17:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213860 - stable/7/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:17:33 -0000 Author: edwin Date: Thu Oct 14 21:17:32 2010 New Revision: 213860 URL: http://svn.freebsd.org/changeset/base/213860 Log: MFC of r213032 r213033 Fix location and year of the Battle of the Plains of Abraham PR: 150504 Submitted by: Douglas Berry Modified: stable/7/usr.bin/calendar/calendars/calendar.history Directory Properties: stable/7/usr.bin/calendar/ (props changed) Modified: stable/7/usr.bin/calendar/calendars/calendar.history ============================================================================== --- stable/7/usr.bin/calendar/calendars/calendar.history Thu Oct 14 21:16:14 2010 (r213859) +++ stable/7/usr.bin/calendar/calendars/calendar.history Thu Oct 14 21:17:32 2010 (r213860) @@ -303,7 +303,7 @@ 09/12 German paratroopers rescue Mussolini from captivity in Rome, 1943 09/12 Germany annexes Sudetenland, 1938 09/13 58° C (136.4° F) measured at el Azizia, Libya, 1922 -09/13 British defeat the French at Abraham near Quebec City, 1788 +09/13 British defeat the French at the Plains of Abraham, just outside the walls of Quebec City, 1759 09/13 Building of Hadrian's Wall begun, 122 09/13 Chiang Kai-Shek becomes president of China, 1943 09/14 Benjamin Franklin is sent to France as an American minister, 1778 From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:18:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43DA01065672; Thu, 14 Oct 2010 21:18:19 +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 325DB8FC13; Thu, 14 Oct 2010 21:18:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELIJI9037713; Thu, 14 Oct 2010 21:18:19 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELIJ13037711; Thu, 14 Oct 2010 21:18:19 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010142118.o9ELIJ13037711@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 14 Oct 2010 21:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213861 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:18:19 -0000 Author: hselasky Date: Thu Oct 14 21:18:18 2010 New Revision: 213861 URL: http://svn.freebsd.org/changeset/base/213861 Log: Correct EHCI root HUB interface descriptor. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/controller/ehci.c Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Thu Oct 14 21:17:32 2010 (r213860) +++ head/sys/dev/usb/controller/ehci.c Thu Oct 14 21:18:18 2010 (r213861) @@ -3063,8 +3063,7 @@ static const struct ehci_config_desc ehc .bNumEndpoints = 1, .bInterfaceClass = UICLASS_HUB, .bInterfaceSubClass = UISUBCLASS_HUB, - .bInterfaceProtocol = UIPROTO_HSHUBSTT, - 0 + .bInterfaceProtocol = 0, }, .endpd = { .bLength = sizeof(struct usb_endpoint_descriptor), From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:19:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11B6B1065673; Thu, 14 Oct 2010 21:19:05 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F34408FC1D; Thu, 14 Oct 2010 21:19:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELJ4UA037771; Thu, 14 Oct 2010 21:19:04 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELJ4ue037769; Thu, 14 Oct 2010 21:19:04 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201010142119.o9ELJ4ue037769@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 14 Oct 2010 21:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213862 - stable/7/usr.bin/calendar/calendars/fr_FR.ISO8859-1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:19:05 -0000 Author: edwin Date: Thu Oct 14 21:19:04 2010 New Revision: 213862 URL: http://svn.freebsd.org/changeset/base/213862 Log: MFC of r212163 Adding a missing firstname (Monique) PR: conf/150049 Submitted by: Thierry Thomas Modified: stable/7/usr.bin/calendar/calendars/fr_FR.ISO8859-1/calendar.fetes Directory Properties: stable/7/usr.bin/calendar/ (props changed) Modified: stable/7/usr.bin/calendar/calendars/fr_FR.ISO8859-1/calendar.fetes ============================================================================== --- stable/7/usr.bin/calendar/calendars/fr_FR.ISO8859-1/calendar.fetes Thu Oct 14 21:18:18 2010 (r213861) +++ stable/7/usr.bin/calendar/calendars/fr_FR.ISO8859-1/calendar.fetes Thu Oct 14 21:19:04 2010 (r213862) @@ -382,7 +382,7 @@ LANG=fr_FR.ISO8859-1 08/26 Bonne fête aux Zéphirin ! 08/26 Aujourd'hui, c'est la St(e) Eulade. 08/27 N'oubliez pas les Edwige ! -08/27 Bonne fête aux Joseph ! +08/27 Bonne fête aux Monique et aux Joseph ! 08/28 Aujourd'hui, c'est la St(e) Augustin. 08/29 N'oubliez pas les Sabine ! 08/30 Bonne fête aux Fiacre ! From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:19:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AAE41065797; Thu, 14 Oct 2010 21:19:08 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 484EF8FC21; Thu, 14 Oct 2010 21:19:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELJ8Im037809; Thu, 14 Oct 2010 21:19:08 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELJ8pJ037807; Thu, 14 Oct 2010 21:19:08 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201010142119.o9ELJ8pJ037807@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 14 Oct 2010 21:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213863 - stable/6/usr.bin/calendar/calendars/fr_FR.ISO8859-1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:19:08 -0000 Author: edwin Date: Thu Oct 14 21:19:08 2010 New Revision: 213863 URL: http://svn.freebsd.org/changeset/base/213863 Log: MFC of r212163 Adding a missing firstname (Monique) PR: conf/150049 Submitted by: Thierry Thomas Modified: stable/6/usr.bin/calendar/calendars/fr_FR.ISO8859-1/calendar.fetes Directory Properties: stable/6/usr.bin/calendar/ (props changed) Modified: stable/6/usr.bin/calendar/calendars/fr_FR.ISO8859-1/calendar.fetes ============================================================================== --- stable/6/usr.bin/calendar/calendars/fr_FR.ISO8859-1/calendar.fetes Thu Oct 14 21:19:04 2010 (r213862) +++ stable/6/usr.bin/calendar/calendars/fr_FR.ISO8859-1/calendar.fetes Thu Oct 14 21:19:08 2010 (r213863) @@ -382,7 +382,7 @@ LANG=fr_FR.ISO8859-1 08/26 Bonne fête aux Zéphirin ! 08/26 Aujourd'hui, c'est la St(e) Eulade. 08/27 N'oubliez pas les Edwige ! -08/27 Bonne fête aux Joseph ! +08/27 Bonne fête aux Monique et aux Joseph ! 08/28 Aujourd'hui, c'est la St(e) Augustin. 08/29 N'oubliez pas les Sabine ! 08/30 Bonne fête aux Fiacre ! From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:26:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E79D2106564A; Thu, 14 Oct 2010 21:26:06 +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 D62A48FC0C; Thu, 14 Oct 2010 21:26:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELQ6lX038070; Thu, 14 Oct 2010 21:26:06 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELQ6NO038068; Thu, 14 Oct 2010 21:26:06 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010142126.o9ELQ6NO038068@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 14 Oct 2010 21:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213864 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:26:07 -0000 Author: hselasky Date: Thu Oct 14 21:26:06 2010 New Revision: 213864 URL: http://svn.freebsd.org/changeset/base/213864 Log: Avoid using endless retransmission at EHCI hardware level, hence this hide errors from the applications. Only use endless retransmission while in the non-addressed state on a High-Speed device. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/controller/ehci.c Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Thu Oct 14 21:19:08 2010 (r213863) +++ head/sys/dev/usb/controller/ehci.c Thu Oct 14 21:26:06 2010 (r213864) @@ -1860,7 +1860,8 @@ ehci_setup_standard_chain(struct usb_xfe temp.auto_data_toggle = 1; } - if (usbd_get_speed(xfer->xroot->udev) != USB_SPEED_HIGH) { + if (xfer->xroot->udev->parent_hs_hub != NULL || + xfer->xroot->udev->address != 0) { /* max 3 retries */ temp.qtd_status |= htohc32(temp.sc, EHCI_QTD_SET_CERR(3)); From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:29:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF66B106566C; Thu, 14 Oct 2010 21:29:50 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD3488FC1A; Thu, 14 Oct 2010 21:29:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELToWT038206; Thu, 14 Oct 2010 21:29:50 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELToEt038204; Thu, 14 Oct 2010 21:29:50 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201010142129.o9ELToEt038204@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 14 Oct 2010 21:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213865 - stable/7/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:29:51 -0000 Author: edwin Date: Thu Oct 14 21:29:50 2010 New Revision: 213865 URL: http://svn.freebsd.org/changeset/base/213865 Log: MFC of r206568 Allerheilingen -> Allerheiligen Submitted by: Ronald Klop Modified: stable/7/usr.bin/calendar/calendars/calendar.dutch Directory Properties: stable/7/usr.bin/calendar/ (props changed) Modified: stable/7/usr.bin/calendar/calendars/calendar.dutch ============================================================================== --- stable/7/usr.bin/calendar/calendars/calendar.dutch Thu Oct 14 21:26:06 2010 (r213864) +++ stable/7/usr.bin/calendar/calendars/calendar.dutch Thu Oct 14 21:29:50 2010 (r213865) @@ -17,7 +17,7 @@ LANG=nl_NL.ISO8859-15 05/04 Dodenherdenking 05/05 Bevrijdingsdag 10/04 Dierendag -11/01 Allerheilingen +11/01 Allerheiligen 11/02 Allerzielen 11/11 Sint Maarten 11/11 Elfde-van-de-elfde From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:29:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 387691065745; Thu, 14 Oct 2010 21:29:52 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 09ECA8FC12; Thu, 14 Oct 2010 21:29:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELTpOJ038239; Thu, 14 Oct 2010 21:29:51 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELTpOe038237; Thu, 14 Oct 2010 21:29:51 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201010142129.o9ELTpOe038237@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 14 Oct 2010 21:29:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213866 - stable/6/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:29:52 -0000 Author: edwin Date: Thu Oct 14 21:29:51 2010 New Revision: 213866 URL: http://svn.freebsd.org/changeset/base/213866 Log: MFC of r206568 Allerheilingen -> Allerheiligen Submitted by: Ronald Klop Modified: stable/6/usr.bin/calendar/calendars/calendar.dutch Directory Properties: stable/6/usr.bin/calendar/ (props changed) Modified: stable/6/usr.bin/calendar/calendars/calendar.dutch ============================================================================== --- stable/6/usr.bin/calendar/calendars/calendar.dutch Thu Oct 14 21:29:50 2010 (r213865) +++ stable/6/usr.bin/calendar/calendars/calendar.dutch Thu Oct 14 21:29:51 2010 (r213866) @@ -17,7 +17,7 @@ LANG=nl_NL.ISO8859-15 05/04 Dodenherdenking 05/05 Bevrijdingsdag 10/04 Dierendag -11/01 Allerheilingen +11/01 Allerheiligen 11/02 Allerzielen 11/11 Sint Maarten 11/11 Elfde-van-de-elfde From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:30:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DFE8106566C; Thu, 14 Oct 2010 21:30:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CAED8FC1C; Thu, 14 Oct 2010 21:30:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELUEDS038290; Thu, 14 Oct 2010 21:30:14 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELUEV9038288; Thu, 14 Oct 2010 21:30:14 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010142130.o9ELUEV9038288@svn.freebsd.org> From: Marius Strobl Date: Thu, 14 Oct 2010 21:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213867 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:30:14 -0000 Author: marius Date: Thu Oct 14 21:30:13 2010 New Revision: 213867 URL: http://svn.freebsd.org/changeset/base/213867 Log: Just like xmphy(4) this driver doesn't use any of the generic subroutines so there's no need to fill mii_{ext,}capabilities either. Modified: head/sys/dev/mii/brgphy.c Modified: head/sys/dev/mii/brgphy.c ============================================================================== --- head/sys/dev/mii/brgphy.c Thu Oct 14 21:29:51 2010 (r213866) +++ head/sys/dev/mii/brgphy.c Thu Oct 14 21:30:13 2010 (r213867) @@ -279,10 +279,6 @@ brgphy_attach(device_t dev) brgphy_reset(sc); - /* Read the PHY's capabilities. */ - sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - if (sc->mii_capabilities & BMSR_EXTSTAT) - sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); device_printf(dev, " "); #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:34:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D77D1065673; Thu, 14 Oct 2010 21:34:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C38A8FC14; Thu, 14 Oct 2010 21:34:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELYr9j038443; Thu, 14 Oct 2010 21:34:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELYrXE038441; Thu, 14 Oct 2010 21:34:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010142134.o9ELYrXE038441@svn.freebsd.org> From: Marius Strobl Date: Thu, 14 Oct 2010 21:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213868 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:34:53 -0000 Author: marius Date: Thu Oct 14 21:34:53 2010 New Revision: 213868 URL: http://svn.freebsd.org/changeset/base/213868 Log: - In the spirit of r212559 add a comment describing what will eventually lower the PIL. - Just as with the AP ensure that the (S)TICK timer(s) are in a known state when starting BSPs. Modified: head/sys/sparc64/sparc64/mp_machdep.c Modified: head/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/mp_machdep.c Thu Oct 14 21:30:13 2010 (r213867) +++ head/sys/sparc64/sparc64/mp_machdep.c Thu Oct 14 21:34:53 2010 (r213868) @@ -433,6 +433,12 @@ cpu_mp_bootstrap(struct pcpu *pc) */ cache_enable(pc->pc_impl); + /* + * Clear (S)TICK timer(s) (including NPT) and ensure they are stopped. + */ + tick_clear(pc->pc_impl); + tick_stop(pc->pc_impl); + /* Lock the kernel TSB in the TLB. */ pmap_map_tsb(); @@ -445,7 +451,11 @@ cpu_mp_bootstrap(struct pcpu *pc) /* Initialize global registers. */ cpu_setregs(pc); - /* Enable interrupts. */ + /* + * Enable interrupts. + * Note that the PIL we be lowered indirectly via sched_throw(NULL) + * when fake spinlock held by the idle thread eventually is released. + */ wrpr(pstate, 0, PSTATE_KERNEL); smp_cpus++; From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:38:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 826FB106564A; Thu, 14 Oct 2010 21:38:06 +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 7007F8FC08; Thu, 14 Oct 2010 21:38:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELc6na038564; Thu, 14 Oct 2010 21:38:06 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELc6uq038561; Thu, 14 Oct 2010 21:38:06 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010142138.o9ELc6uq038561@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 14 Oct 2010 21:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213869 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:38:06 -0000 Author: hselasky Date: Thu Oct 14 21:38:06 2010 New Revision: 213869 URL: http://svn.freebsd.org/changeset/base/213869 Log: Revert most of r197682 (EHCI Hardware BUG workaround). Implement proper solution which is to not use the TERMINATE pointer, but rather link to a halted TD. The initial fix was due to a misunderstanding about how the EHCI hardware works. Thanks to Alan Stern for clearing this up. This patch can increase mass storage read performance significantly when the IRQ rate is less than 8000 IRQ/s. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ehci.h Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Thu Oct 14 21:34:53 2010 (r213868) +++ head/sys/dev/usb/controller/ehci.c Thu Oct 14 21:38:06 2010 (r213869) @@ -145,7 +145,6 @@ struct ehci_std_temp { uint8_t auto_data_toggle; uint8_t setup_alt_next; uint8_t last_frame; - uint8_t can_use_next; }; void @@ -157,6 +156,9 @@ ehci_iterate_hw_softc(struct usb_bus *bu cb(bus, &sc->sc_hw.pframes_pc, &sc->sc_hw.pframes_pg, sizeof(uint32_t) * EHCI_FRAMELIST_COUNT, EHCI_FRAMELIST_ALIGN); + cb(bus, &sc->sc_hw.terminate_pc, &sc->sc_hw.terminate_pg, + sizeof(struct ehci_qh_sub), EHCI_QH_ALIGN); + cb(bus, &sc->sc_hw.async_start_pc, &sc->sc_hw.async_start_pg, sizeof(ehci_qh_t), EHCI_QH_ALIGN); @@ -310,6 +312,24 @@ ehci_init(ehci_softc_t *sc) sc->sc_eintrs = EHCI_NORMAL_INTRS; + if (1) { + struct ehci_qh_sub *qh; + + usbd_get_page(&sc->sc_hw.terminate_pc, 0, &buf_res); + + qh = buf_res.buffer; + + sc->sc_terminate_self = htohc32(sc, buf_res.physaddr); + + /* init terminate TD */ + qh->qtd_next = + htohc32(sc, EHCI_LINK_TERMINATE); + qh->qtd_altnext = + htohc32(sc, EHCI_LINK_TERMINATE); + qh->qtd_status = + htohc32(sc, EHCI_QTD_HALTED); + } + for (i = 0; i < EHCI_VIRTUAL_FRAMELIST_COUNT; i++) { ehci_qh_t *qh; @@ -1416,15 +1436,7 @@ ehci_check_transfer(struct usb_xfer *xfe */ if (status & EHCI_QTD_ACTIVE) { /* update cache */ - if (xfer->td_transfer_cache != td) { - xfer->td_transfer_cache = td; - if (qh->qh_qtd.qtd_next & - htohc32(sc, EHCI_LINK_TERMINATE)) { - /* XXX - manually advance to next frame */ - qh->qh_qtd.qtd_next = td->qtd_self; - usb_pc_cpu_flush(td->page_cache); - } - } + xfer->td_transfer_cache = td; goto done; } /* @@ -1634,10 +1646,12 @@ ehci_setup_standard_chain_sub(struct ehc uint32_t average; uint32_t len_old; uint32_t terminate; + uint32_t qtd_altnext; uint8_t shortpkt_old; uint8_t precompute; - terminate = htohc32(temp->sc, EHCI_LINK_TERMINATE); + terminate = temp->sc->sc_terminate_self; + qtd_altnext = temp->sc->sc_terminate_self; td_alt_next = NULL; buf_offset = 0; shortpkt_old = temp->shortpkt; @@ -1771,23 +1785,11 @@ restart: td->qtd_buffer_hi[x] = 0; } - if (temp->can_use_next) { - if (td_next) { - /* link the current TD with the next one */ - td->qtd_next = td_next->qtd_self; - } - } else { - /* - * BUG WARNING: The EHCI HW can use the - * qtd_next field instead of qtd_altnext when - * a short packet is received! We work this - * around in software by not queueing more - * than one job/TD at a time! - */ - td->qtd_next = terminate; + if (td_next) { + /* link the current TD with the next one */ + td->qtd_next = td_next->qtd_self; } - - td->qtd_altnext = terminate; + td->qtd_altnext = qtd_altnext; td->alt_next = td_alt_next; usb_pc_cpu_flush(td->page_cache); @@ -1799,9 +1801,15 @@ restart: /* setup alt next pointer, if any */ if (temp->last_frame) { td_alt_next = NULL; + qtd_altnext = terminate; } else { /* we use this field internally */ td_alt_next = td_next; + if (temp->setup_alt_next) { + qtd_altnext = td_next->qtd_self; + } else { + qtd_altnext = terminate; + } } /* restore */ @@ -1846,8 +1854,6 @@ ehci_setup_standard_chain(struct usb_xfe temp.qtd_status = 0; temp.last_frame = 0; temp.setup_alt_next = xfer->flags_int.short_frames_ok; - temp.can_use_next = (xfer->flags_int.control_xfr || - (UE_GET_DIR(xfer->endpointno) == UE_DIR_OUT)); if (xfer->flags_int.control_xfr) { if (xfer->endpoint->toggle_next) { @@ -1860,8 +1866,8 @@ ehci_setup_standard_chain(struct usb_xfe temp.auto_data_toggle = 1; } - if (xfer->xroot->udev->parent_hs_hub != NULL || - xfer->xroot->udev->address != 0) { + if ((xfer->xroot->udev->parent_hs_hub != NULL) || + (xfer->xroot->udev->address != 0)) { /* max 3 retries */ temp.qtd_status |= htohc32(temp.sc, EHCI_QTD_SET_CERR(3)); @@ -3114,7 +3120,6 @@ ehci_roothub_exec(struct usb_device *ude uint16_t i; uint16_t value; uint16_t index; - uint8_t l; usb_error_t err; USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED); @@ -3322,16 +3327,19 @@ ehci_roothub_exec(struct usb_device *ude sc->sc_hub_desc.hubd = ehci_hubd; sc->sc_hub_desc.hubd.bNbrPorts = sc->sc_noport; - USETW(sc->sc_hub_desc.hubd.wHubCharacteristics, - (EHCI_HCS_PPC(v) ? UHD_PWR_INDIVIDUAL : UHD_PWR_NO_SWITCH) | - (EHCI_HCS_P_INDICATOR(EREAD4(sc, EHCI_HCSPARAMS)) ? - UHD_PORT_IND : 0)); + + if (EHCI_HCS_PPC(v)) + i = UHD_PWR_INDIVIDUAL; + else + i = UHD_PWR_NO_SWITCH; + + if (EHCI_HCS_P_INDICATOR(v)) + i |= UHD_PORT_IND; + + USETW(sc->sc_hub_desc.hubd.wHubCharacteristics, i); /* XXX can't find out? */ sc->sc_hub_desc.hubd.bPwrOn2PwrGood = 200; - for (l = 0; l < sc->sc_noport; l++) { - /* XXX can't find out? */ - sc->sc_hub_desc.hubd.DeviceRemovable[l / 8] &= ~(1 << (l % 8)); - } + /* XXX don't know if ports are removable or not */ sc->sc_hub_desc.hubd.bDescLength = 8 + ((sc->sc_noport + 7) / 8); len = sc->sc_hub_desc.hubd.bDescLength; Modified: head/sys/dev/usb/controller/ehci.h ============================================================================== --- head/sys/dev/usb/controller/ehci.h Thu Oct 14 21:34:53 2010 (r213868) +++ head/sys/dev/usb/controller/ehci.h Thu Oct 14 21:38:06 2010 (r213869) @@ -285,12 +285,14 @@ typedef struct ehci_fstn ehci_fstn_t; struct ehci_hw_softc { struct usb_page_cache pframes_pc; + struct usb_page_cache terminate_pc; struct usb_page_cache async_start_pc; struct usb_page_cache intr_start_pc[EHCI_VIRTUAL_FRAMELIST_COUNT]; struct usb_page_cache isoc_hs_start_pc[EHCI_VIRTUAL_FRAMELIST_COUNT]; struct usb_page_cache isoc_fs_start_pc[EHCI_VIRTUAL_FRAMELIST_COUNT]; struct usb_page pframes_pg; + struct usb_page terminate_pg; struct usb_page async_start_pg; struct usb_page intr_start_pg[EHCI_VIRTUAL_FRAMELIST_COUNT]; struct usb_page isoc_hs_start_pg[EHCI_VIRTUAL_FRAMELIST_COUNT]; @@ -329,6 +331,7 @@ typedef struct ehci_softc { bus_space_tag_t sc_io_tag; bus_space_handle_t sc_io_hdl; + uint32_t sc_terminate_self; /* TD short packet termination pointer */ uint32_t sc_eintrs; uint32_t sc_cmd; /* shadow of cmd register during * suspend */ From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:38:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10FAD1065674; Thu, 14 Oct 2010 21:38:21 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1DE68FC16; Thu, 14 Oct 2010 21:38:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELcKTE038606; Thu, 14 Oct 2010 21:38:20 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELcK04038601; Thu, 14 Oct 2010 21:38:20 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201010142138.o9ELcK04038601@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 14 Oct 2010 21:38: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: r213870 - in stable/8/usr.bin/calendar: . calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:38:21 -0000 Author: edwin Date: Thu Oct 14 21:38:20 2010 New Revision: 213870 URL: http://svn.freebsd.org/changeset/base/213870 Log: MFC of r211517 r212035 r211517: '\0' -> 0 Fix silly mistake by being overly zeaolous[sp] of applying the style rules. r212035: For calendars which don't match the solar-based Gregorian calendar, be able to specify a year string in an entry. Modified: stable/8/usr.bin/calendar/calendar.1 stable/8/usr.bin/calendar/calendar.h stable/8/usr.bin/calendar/calendars/calendar.judaic stable/8/usr.bin/calendar/parsedata.c Directory Properties: stable/8/usr.bin/calendar/ (props changed) Modified: stable/8/usr.bin/calendar/calendar.1 ============================================================================== --- stable/8/usr.bin/calendar/calendar.1 Thu Oct 14 21:38:06 2010 (r213869) +++ stable/8/usr.bin/calendar/calendar.1 Thu Oct 14 21:38:20 2010 (r213870) @@ -103,6 +103,7 @@ Print lines from today and the next days (forward, future). Ignore weekends when calculating the number of days. .El +.Sh FILE FORMAT .Pp To handle calendars in your national code table you can specify .Dq LANG= @@ -196,6 +197,7 @@ Jun. 15\fB\et\fRJune 15. Thursday\fB\et\fREvery Thursday. June\fB\et\fREvery June 1st. 15 *\fB\et\fR15th of every month. +2010/4/15\fB\et\fR15 April 2010 May Sun+2\fB\et\fRsecond Sunday in May (Muttertag) 04/SunLast\fB\et\fRlast Sunday in April, Modified: stable/8/usr.bin/calendar/calendar.h ============================================================================== --- stable/8/usr.bin/calendar/calendar.h Thu Oct 14 21:38:06 2010 (r213869) +++ stable/8/usr.bin/calendar/calendar.h Thu Oct 14 21:38:20 2010 (r213870) @@ -80,6 +80,7 @@ extern int EastLongitude; #define F_SEPEQUINOX 0x08000 #define F_JUNSOLSTICE 0x10000 #define F_DECSOLSTICE 0x20000 +#define F_YEAR 0x40000 #define STRING_EASTER "Easter" #define STRING_PASKHA "Paskha" Modified: stable/8/usr.bin/calendar/calendars/calendar.judaic ============================================================================== --- stable/8/usr.bin/calendar/calendars/calendar.judaic Thu Oct 14 21:38:06 2010 (r213869) +++ stable/8/usr.bin/calendar/calendars/calendar.judaic Thu Oct 14 21:38:20 2010 (r213870) @@ -13,10 +13,477 @@ #define _calendar_judaic_ /* - * Jewish calendar for the CE year 2007 - * 11 Tevet 5767 - 22 tevet 5768 + * The calendar below has gotten from the port deskutils/hebcal for + * the year of 2010 and for the city of New York. + * This should be updated every year! */ +2010/Jan/16* Rosh Chodesh Sh'vat +2010/Jan/30* Tu B'Shvat +2010/Feb/13* Shabbat Shekalim +2010/Feb/14* Rosh Chodesh Adar +2010/Feb/15* Rosh Chodesh Adar +2010/Feb/25* Ta'anit Esther +2010/Feb/27* Shabbat Zachor +2010/Feb/28* Purim +2010/Mar/1* Shushan Purim +2010/Mar/6* Shabbat Parah +2010/Mar/13* Shabbat HaChodesh +2010/Mar/16* Rosh Chodesh Nisan +2010/Mar/27* Shabbat HaGadol +2010/Mar/29* Ta'anit Bechorot +2010/Mar/29* Erev Pesach +2010/Mar/30* Pesach I +2010/Mar/31* Pesach II +2010/Apr/1* Pesach III (CH''M) +2010/Apr/2* Pesach IV (CH''M) +2010/Apr/3* Pesach V (CH''M) +2010/Apr/4* Pesach VI (CH''M) +2010/Apr/5* Pesach VII +2010/Apr/6* Pesach VIII +2010/Apr/11* Yom HaShoah +2010/Apr/14* Rosh Chodesh Iyyar +2010/Apr/15* Rosh Chodesh Iyyar +2010/Apr/19* Yom HaZikaron +2010/Apr/20* Yom HaAtzma'ut +2010/May/2* Lag B'Omer +2010/May/Dec* Yom Yerushalayim +2010/May/14* Rosh Chodesh Sivan +2010/May/18* Erev Shavuot +2010/May/19* Shavuot I +2010/May/20* Shavuot II +2010/Jun/Dec* Rosh Chodesh Tamuz +2010/Jun/13* Rosh Chodesh Tamuz +2010/Jun/29* Tzom Tammuz +2010/Jul/Dec* Rosh Chodesh Av +2010/Jul/17* Shabbat Hazon +2010/Jul/20* Tish'a B'Av +2010/Jul/24* Shabbat Nachamu +2010/Aug/Oct* Rosh Chodesh Elul +2010/Aug/11* Rosh Chodesh Elul +2010/Sep/8* Erev Rosh Hashana +2010/Sep/9* Rosh Hashana 5771 +2010/Sep/Oct* Rosh Hashana II +2010/Sep/11* Shabbat Shuva +2010/Sep/Dec* Tzom Gedaliah +2010/Sep/17* Erev Yom Kippur +2010/Sep/18* Yom Kippur +2010/Sep/22* Erev Sukkot +2010/Sep/23* Sukkot I +2010/Sep/24* Sukkot II +2010/Sep/25* Sukkot III (CH''M) +2010/Sep/26* Sukkot IV (CH''M) +2010/Sep/27* Sukkot V (CH''M) +2010/Sep/28* Sukkot VI (CH''M) +2010/Sep/29* Sukkot VII (Hoshana Raba) +2010/Sep/30* Shmini Atzeret +2010/Oct/1* Simchat Torah +2010/Oct/8* Rosh Chodesh Cheshvan +2010/Oct/9* Rosh Chodesh Cheshvan +2010/Nov/7* Rosh Chodesh Kislev +2010/Nov/8* Rosh Chodesh Kislev +2010/Dec/1* Chanukah: 1 Candle +2010/Dec/2* Chanukah: 2 Candles +2010/Dec/3* Chanukah: 3 Candles +2010/Dec/4* Chanukah: 4 Candles +2010/Dec/5* Chanukah: 5 Candles +2010/Dec/6* Chanukah: 6 Candles +2010/Dec/7* Rosh Chodesh Tevet +2010/Dec/7* Chanukah: 7 Candles +2010/Dec/8* Rosh Chodesh Tevet +2010/Dec/8* Chanukah: 8 Candles +2010/Dec/9* Chanukah: 8th Day +2010/Dec/16* Asara B'Tevet +2011/1/6* Rosh Chodesh Sh'vat +2011/1/20* Tu B'Shvat +2011/2/4* Rosh Chodesh Adar I +2011/2/5* Rosh Chodesh Adar I +2011/2/18* Purim Katan +2011/3/5* Shabbat Shekalim +2011/3/6* Rosh Chodesh Adar II +2011/3/7* Rosh Chodesh Adar II +2011/3/17* Ta'anit Esther +2011/3/19* Shabbat Zachor +2011/3/20* Purim +2011/3/21* Shushan Purim +2011/3/26* Shabbat Parah +2011/4/2* Shabbat HaChodesh +2011/4/5* Rosh Chodesh Nisan +2011/4/16* Shabbat HaGadol +2011/4/18* Ta'anit Bechorot +2011/4/18* Erev Pesach +2011/4/19* Pesach I +2011/4/20* Pesach II +2011/4/21* Pesach III (CH''M) +2011/4/22* Pesach IV (CH''M) +2011/4/23* Pesach V (CH''M) +2011/4/24* Pesach VI (CH''M) +2011/4/25* Pesach VII +2011/4/26* Pesach VIII +2011/5/1* Yom HaShoah +2011/5/4* Rosh Chodesh Iyyar +2011/5/5* Rosh Chodesh Iyyar +2011/5/9* Yom HaZikaron +2011/5/10* Yom HaAtzma'ut +2011/5/22* Lag B'Omer +2011/6/1* Yom Yerushalayim +2011/6/3* Rosh Chodesh Sivan +2011/6/7* Erev Shavuot +2011/6/8* Shavuot I +2011/6/9* Shavuot II +2011/7/2* Rosh Chodesh Tamuz +2011/7/3* Rosh Chodesh Tamuz +2011/7/19* Tzom Tammuz +2011/8/1* Rosh Chodesh Av +2011/8/6* Shabbat Hazon +2011/8/9* Tish'a B'Av +2011/8/13* Shabbat Nachamu +2011/8/30* Rosh Chodesh Elul +2011/8/31* Rosh Chodesh Elul +2011/9/28* Erev Rosh Hashana +2011/9/29* Rosh Hashana 5772 +2011/9/30* Rosh Hashana II +2011/10/1* Shabbat Shuva +2011/10/2* Tzom Gedaliah +2011/10/7* Erev Yom Kippur +2011/10/8* Yom Kippur +2011/10/12* Erev Sukkot +2011/10/13* Sukkot I +2011/10/14* Sukkot II +2011/10/15* Sukkot III (CH''M) +2011/10/16* Sukkot IV (CH''M) +2011/10/17* Sukkot V (CH''M) +2011/10/18* Sukkot VI (CH''M) +2011/10/19* Sukkot VII (Hoshana Raba) +2011/10/20* Shmini Atzeret +2011/10/21* Simchat Torah +2011/10/28* Rosh Chodesh Cheshvan +2011/10/29* Rosh Chodesh Cheshvan +2011/11/27* Rosh Chodesh Kislev +2011/12/20* Chanukah: 1 Candle +2011/12/21* Chanukah: 2 Candles +2011/12/22* Chanukah: 3 Candles +2011/12/23* Chanukah: 4 Candles +2011/12/24* Chanukah: 5 Candles +2011/12/25* Chanukah: 6 Candles +2011/12/26* Rosh Chodesh Tevet +2011/12/26* Chanukah: 7 Candles +2011/12/27* Rosh Chodesh Tevet +2011/12/27* Chanukah: 8 Candles +2011/12/28* Chanukah: 8th Day +2012/1/5* Asara B'Tevet +2012/1/25* Rosh Chodesh Sh'vat +2012/2/8* Tu B'Shvat +2012/2/18* Shabbat Shekalim +2012/2/23* Rosh Chodesh Adar +2012/2/24* Rosh Chodesh Adar +2012/3/3* Shabbat Zachor +2012/3/7* Ta'anit Esther +2012/3/8* Purim +2012/3/9* Shushan Purim +2012/3/17* Shabbat Parah +2012/3/24* Rosh Chodesh Nisan +2012/3/24* Shabbat HaChodesh +2012/3/31* Shabbat HaGadol +2012/4/5* Ta'anit Bechorot +2012/4/6* Erev Pesach +2012/4/7* Pesach I +2012/4/8* Pesach II +2012/4/9* Pesach III (CH''M) +2012/4/10* Pesach IV (CH''M) +2012/4/11* Pesach V (CH''M) +2012/4/12* Pesach VI (CH''M) +2012/4/13* Pesach VII +2012/4/14* Pesach VIII +2012/4/19* Yom HaShoah +2012/4/22* Rosh Chodesh Iyyar +2012/4/23* Rosh Chodesh Iyyar +2012/4/25* Yom HaZikaron +2012/4/26* Yom HaAtzma'ut +2012/5/10* Lag B'Omer +2012/5/20* Yom Yerushalayim +2012/5/22* Rosh Chodesh Sivan +2012/5/26* Erev Shavuot +2012/5/27* Shavuot I +2012/5/28* Shavuot II +2012/6/20* Rosh Chodesh Tamuz +2012/6/21* Rosh Chodesh Tamuz +2012/7/8* Tzom Tammuz +2012/7/20* Rosh Chodesh Av +2012/7/28* Shabbat Hazon +2012/7/29* Tish'a B'Av +2012/8/4* Shabbat Nachamu +2012/8/18* Rosh Chodesh Elul +2012/8/19* Rosh Chodesh Elul +2012/9/16* Erev Rosh Hashana +2012/9/17* Rosh Hashana 5773 +2012/9/18* Rosh Hashana II +2012/9/19* Tzom Gedaliah +2012/9/22* Shabbat Shuva +2012/9/25* Erev Yom Kippur +2012/9/26* Yom Kippur +2012/9/30* Erev Sukkot +2012/10/1* Sukkot I +2012/10/2* Sukkot II +2012/10/3* Sukkot III (CH''M) +2012/10/4* Sukkot IV (CH''M) +2012/10/5* Sukkot V (CH''M) +2012/10/6* Sukkot VI (CH''M) +2012/10/7* Sukkot VII (Hoshana Raba) +2012/10/8* Shmini Atzeret +2012/10/9* Simchat Torah +2012/10/16* Rosh Chodesh Cheshvan +2012/10/17* Rosh Chodesh Cheshvan +2012/11/15* Rosh Chodesh Kislev +2012/12/8* Chanukah: 1 Candle +2012/12/9* Chanukah: 2 Candles +2012/12/10* Chanukah: 3 Candles +2012/12/11* Chanukah: 4 Candles +2012/12/12* Chanukah: 5 Candles +2012/12/13* Chanukah: 6 Candles +2012/12/14* Rosh Chodesh Tevet +2012/12/14* Chanukah: 7 Candles +2012/12/15* Chanukah: 8 Candles +2012/12/16* Chanukah: 8th Day +2012/12/23* Asara B'Tevet +2013/1/12* Rosh Chodesh Sh'vat +2013/1/26* Tu B'Shvat +2013/2/9* Shabbat Shekalim +2013/2/10* Rosh Chodesh Adar +2013/2/11* Rosh Chodesh Adar +2013/2/21* Ta'anit Esther +2013/2/23* Shabbat Zachor +2013/2/24* Purim +2013/2/25* Shushan Purim +2013/3/2* Shabbat Parah +2013/3/9* Shabbat HaChodesh +2013/3/12* Rosh Chodesh Nisan +2013/3/23* Shabbat HaGadol +2013/3/25* Ta'anit Bechorot +2013/3/25* Erev Pesach +2013/3/26* Pesach I +2013/3/27* Pesach II +2013/3/28* Pesach III (CH''M) +2013/3/29* Pesach IV (CH''M) +2013/3/30* Pesach V (CH''M) +2013/3/31* Pesach VI (CH''M) +2013/4/1* Pesach VII +2013/4/2* Pesach VIII +2013/4/7* Yom HaShoah +2013/4/10* Rosh Chodesh Iyyar +2013/4/11* Rosh Chodesh Iyyar +2013/4/15* Yom HaZikaron +2013/4/16* Yom HaAtzma'ut +2013/4/28* Lag B'Omer +2013/5/8* Yom Yerushalayim +2013/5/10* Rosh Chodesh Sivan +2013/5/14* Erev Shavuot +2013/5/15* Shavuot I +2013/5/16* Shavuot II +2013/6/8* Rosh Chodesh Tamuz +2013/6/9* Rosh Chodesh Tamuz +2013/6/25* Tzom Tammuz +2013/7/8* Rosh Chodesh Av +2013/7/13* Shabbat Hazon +2013/7/16* Tish'a B'Av +2013/7/20* Shabbat Nachamu +2013/8/6* Rosh Chodesh Elul +2013/8/7* Rosh Chodesh Elul +2013/9/4* Erev Rosh Hashana +2013/9/5* Rosh Hashana 5774 +2013/9/6* Rosh Hashana II +2013/9/7* Shabbat Shuva +2013/9/8* Tzom Gedaliah +2013/9/13* Erev Yom Kippur +2013/9/14* Yom Kippur +2013/9/18* Erev Sukkot +2013/9/19* Sukkot I +2013/9/20* Sukkot II +2013/9/21* Sukkot III (CH''M) +2013/9/22* Sukkot IV (CH''M) +2013/9/23* Sukkot V (CH''M) +2013/9/24* Sukkot VI (CH''M) +2013/9/25* Sukkot VII (Hoshana Raba) +2013/9/26* Shmini Atzeret +2013/9/27* Simchat Torah +2013/10/4* Rosh Chodesh Cheshvan +2013/10/5* Rosh Chodesh Cheshvan +2013/11/3* Rosh Chodesh Kislev +2013/11/4* Rosh Chodesh Kislev +2013/11/27* Chanukah: 1 Candle +2013/11/28* Chanukah: 2 Candles +2013/11/29* Chanukah: 3 Candles +2013/11/30* Chanukah: 4 Candles +2013/12/1* Chanukah: 5 Candles +2013/12/2* Chanukah: 6 Candles +2013/12/3* Rosh Chodesh Tevet +2013/12/3* Chanukah: 7 Candles +2013/12/4* Rosh Chodesh Tevet +2013/12/4* Chanukah: 8 Candles +2013/12/5* Chanukah: 8th Day +2013/12/12* Asara B'Tevet +2014/1/2* Rosh Chodesh Sh'vat +2014/1/16* Tu B'Shvat +2014/1/31* Rosh Chodesh Adar I +2014/2/1* Rosh Chodesh Adar I +2014/2/14* Purim Katan +2014/3/1* Shabbat Shekalim +2014/3/2* Rosh Chodesh Adar II +2014/3/3* Rosh Chodesh Adar II +2014/3/13* Ta'anit Esther +2014/3/15* Shabbat Zachor +2014/3/16* Purim +2014/3/17* Shushan Purim +2014/3/22* Shabbat Parah +2014/3/29* Shabbat HaChodesh +2014/4/1* Rosh Chodesh Nisan +2014/4/12* Shabbat HaGadol +2014/4/14* Ta'anit Bechorot +2014/4/14* Erev Pesach +2014/4/15* Pesach I +2014/4/16* Pesach II +2014/4/17* Pesach III (CH''M) +2014/4/18* Pesach IV (CH''M) +2014/4/19* Pesach V (CH''M) +2014/4/20* Pesach VI (CH''M) +2014/4/21* Pesach VII +2014/4/22* Pesach VIII +2014/4/27* Yom HaShoah +2014/4/30* Rosh Chodesh Iyyar +2014/5/1* Rosh Chodesh Iyyar +2014/5/5* Yom HaZikaron +2014/5/6* Yom HaAtzma'ut +2014/5/18* Lag B'Omer +2014/5/28* Yom Yerushalayim +2014/5/30* Rosh Chodesh Sivan +2014/6/3* Erev Shavuot +2014/6/4* Shavuot I +2014/6/5* Shavuot II +2014/6/28* Rosh Chodesh Tamuz +2014/6/29* Rosh Chodesh Tamuz +2014/7/15* Tzom Tammuz +2014/7/28* Rosh Chodesh Av +2014/8/2* Shabbat Hazon +2014/8/5* Tish'a B'Av +2014/8/9* Shabbat Nachamu +2014/8/26* Rosh Chodesh Elul +2014/8/27* Rosh Chodesh Elul +2014/9/24* Erev Rosh Hashana +2014/9/25* Rosh Hashana 5775 +2014/9/26* Rosh Hashana II +2014/9/27* Shabbat Shuva +2014/9/28* Tzom Gedaliah +2014/10/3* Erev Yom Kippur +2014/10/4* Yom Kippur +2014/10/8* Erev Sukkot +2014/10/9* Sukkot I +2014/10/10* Sukkot II +2014/10/11* Sukkot III (CH''M) +2014/10/12* Sukkot IV (CH''M) +2014/10/13* Sukkot V (CH''M) +2014/10/14* Sukkot VI (CH''M) +2014/10/15* Sukkot VII (Hoshana Raba) +2014/10/16* Shmini Atzeret +2014/10/17* Simchat Torah +2014/10/24* Rosh Chodesh Cheshvan +2014/10/25* Rosh Chodesh Cheshvan +2014/11/23* Rosh Chodesh Kislev +2014/12/16* Chanukah: 1 Candle +2014/12/17* Chanukah: 2 Candles +2014/12/18* Chanukah: 3 Candles +2014/12/19* Chanukah: 4 Candles +2014/12/20* Chanukah: 5 Candles +2014/12/21* Chanukah: 6 Candles +2014/12/22* Rosh Chodesh Tevet +2014/12/22* Chanukah: 7 Candles +2014/12/23* Rosh Chodesh Tevet +2014/12/23* Chanukah: 8 Candles +2014/12/24* Chanukah: 8th Day +2015/1/1* Asara B'Tevet +2015/1/21* Rosh Chodesh Sh'vat +2015/2/4* Tu B'Shvat +2015/2/14* Shabbat Shekalim +2015/2/19* Rosh Chodesh Adar +2015/2/20* Rosh Chodesh Adar +2015/2/28* Shabbat Zachor +2015/3/4* Ta'anit Esther +2015/3/5* Purim +2015/3/6* Shushan Purim +2015/3/14* Shabbat Parah +2015/3/21* Rosh Chodesh Nisan +2015/3/21* Shabbat HaChodesh +2015/3/28* Shabbat HaGadol +2015/4/2* Ta'anit Bechorot +2015/4/3* Erev Pesach +2015/4/4* Pesach I +2015/4/5* Pesach II +2015/4/6* Pesach III (CH''M) +2015/4/7* Pesach IV (CH''M) +2015/4/8* Pesach V (CH''M) +2015/4/9* Pesach VI (CH''M) +2015/4/10* Pesach VII +2015/4/11* Pesach VIII +2015/4/16* Yom HaShoah +2015/4/19* Rosh Chodesh Iyyar +2015/4/20* Rosh Chodesh Iyyar +2015/4/22* Yom HaZikaron +2015/4/23* Yom HaAtzma'ut +2015/5/7* Lag B'Omer +2015/5/17* Yom Yerushalayim +2015/5/19* Rosh Chodesh Sivan +2015/5/23* Erev Shavuot +2015/5/24* Shavuot I +2015/5/25* Shavuot II +2015/6/17* Rosh Chodesh Tamuz +2015/6/18* Rosh Chodesh Tamuz +2015/7/5* Tzom Tammuz +2015/7/17* Rosh Chodesh Av +2015/7/25* Shabbat Hazon +2015/7/26* Tish'a B'Av +2015/8/1* Shabbat Nachamu +2015/8/15* Rosh Chodesh Elul +2015/8/16* Rosh Chodesh Elul +2015/9/13* Erev Rosh Hashana +2015/9/14* Rosh Hashana 5776 +2015/9/15* Rosh Hashana II +2015/9/16* Tzom Gedaliah +2015/9/19* Shabbat Shuva +2015/9/22* Erev Yom Kippur +2015/9/23* Yom Kippur +2015/9/27* Erev Sukkot +2015/9/28* Sukkot I +2015/9/29* Sukkot II +2015/9/30* Sukkot III (CH''M) +2015/10/1* Sukkot IV (CH''M) +2015/10/2* Sukkot V (CH''M) +2015/10/3* Sukkot VI (CH''M) +2015/10/4* Sukkot VII (Hoshana Raba) +2015/10/5* Shmini Atzeret +2015/10/6* Simchat Torah +2015/10/13* Rosh Chodesh Cheshvan +2015/10/14* Rosh Chodesh Cheshvan +2015/11/12* Rosh Chodesh Kislev +2015/11/13* Rosh Chodesh Kislev +2015/12/6* Chanukah: 1 Candle +2015/12/7* Chanukah: 2 Candles +2015/12/8* Chanukah: 3 Candles +2015/12/9* Chanukah: 4 Candles +2015/12/10* Chanukah: 5 Candles +2015/12/11* Chanukah: 6 Candles +2015/12/12* Rosh Chodesh Tevet +2015/12/12* Chanukah: 7 Candles +2015/12/13* Rosh Chodesh Tevet +2015/12/13* Chanukah: 8 Candles +2015/12/14* Chanukah: 8th Day +2015/12/22* Asara B'Tevet + +/* + * The calendar data below was for 2007, so it is commented out. + */ + +/* + * Jewish calendar for the CE year 2007 + * 11 Tevet 5767 - 22 tevet 5768 01/06* Parshas Vayechi 01/13* Parshas Shemos @@ -223,5 +690,6 @@ 12/22* Parshas Vayechi 12/29* Parshas Shemos +*/ #endif /* !_calendar_judaic_ */ Modified: stable/8/usr.bin/calendar/parsedata.c ============================================================================== --- stable/8/usr.bin/calendar/parsedata.c Thu Oct 14 21:38:06 2010 (r213869) +++ stable/8/usr.bin/calendar/parsedata.c Thu Oct 14 21:38:20 2010 (r213870) @@ -87,9 +87,9 @@ static int determinestyle(char *date, int *flags, char *month, int *imonth, char *dayofmonth, int *idayofmonth, char *dayofweek, int *idayofweek, char *modifieroffset, - char *modifierindex, char *specialday) + char *modifierindex, char *specialday, char *year, int *iyear) { - char *p, *p1, *p2; + char *p, *p1, *p2, *py; const char *dow, *pmonth; char pold; size_t len, offset; @@ -97,6 +97,8 @@ determinestyle(char *date, int *flags, *flags = F_NONE; *month = '\0'; *imonth = 0; + *year = '\0'; + *iyear = 0; *dayofmonth = '\0'; *idayofmonth = 0; *dayofweek = '\0'; @@ -191,6 +193,22 @@ determinestyle(char *date, int *flags, p2 = p + 1; /* Now p2 points to the next field and p1 to the first field */ + if ((py = strchr(p2, '/')) != NULL) { + /* We have a year in the string. Now this is getting tricky */ + strcpy(year, p1); + *iyear = (int)strtol(year, NULL, 10); + p1 = p2; + p2 = py + 1; + *py = 0; + *flags |= F_YEAR; + } + + /* + printf("p1: %s\n", p1); + printf("p2: %s\n", p2); + printf("year: %s\n", year); + */ + /* Check if there is a month-string in the date */ if ((checkmonth(p1, &len, &offset, &pmonth) != 0) || (checkmonth(p2, &len, &offset, &pmonth) != 0 && (p2 = p1))) { @@ -323,7 +341,8 @@ remember(int *rememberindex, int *y, int static void debug_determinestyle(int dateonly, char *date, int flags, char *month, int imonth, char *dayofmonth, int idayofmonth, char *dayofweek, - int idayofweek, char *modifieroffset, char *modifierindex, char *specialday) + int idayofweek, char *modifieroffset, char *modifierindex, char *specialday, + char *year, int iyear) { if (dateonly != 0) { @@ -336,6 +355,8 @@ debug_determinestyle(int dateonly, char printf("modifieroffset: |%s|\n", modifieroffset); if (modifierindex[0] != '\0') printf("modifierindex: |%s|\n", modifierindex); + if (year[0] != '\0') + printf("year: |%s| (%d)\n", year, iyear); if (month[0] != '\0') printf("month: |%s| (%d)\n", month, imonth); if (dayofmonth[0] != '\0') @@ -371,8 +392,10 @@ parsedaymonth(char *date, int *yearp, in char **edp) { char month[100], dayofmonth[100], dayofweek[100], modifieroffset[100]; + char syear[100]; char modifierindex[100], specialday[100]; - int idayofweek = -1, imonth = -1, idayofmonth = -1, year, remindex; + int idayofweek = -1, imonth = -1, idayofmonth = -1, iyear = -1; + int year, remindex; int d, m, dow, rm, rd, offset; char *ed; int retvalsign = 1; @@ -394,10 +417,10 @@ parsedaymonth(char *date, int *yearp, in if (debug) debug_determinestyle(1, date, *flags, month, imonth, dayofmonth, idayofmonth, dayofweek, idayofweek, - modifieroffset, modifierindex, specialday); + modifieroffset, modifierindex, specialday, syear, iyear); if (determinestyle(date, flags, month, &imonth, dayofmonth, &idayofmonth, dayofweek, &idayofweek, modifieroffset, - modifierindex, specialday) == 0) { + modifierindex, specialday, syear, &iyear) == 0) { if (debug) printf("Failed!\n"); return (0); @@ -406,10 +429,18 @@ parsedaymonth(char *date, int *yearp, in if (debug) debug_determinestyle(0, date, *flags, month, imonth, dayofmonth, idayofmonth, dayofweek, idayofweek, - modifieroffset, modifierindex, specialday); + modifieroffset, modifierindex, specialday, syear, iyear); remindex = 0; for (year = year1; year <= year2; year++) { + + int lflags = *flags; + /* If the year is specified, only do it if it is this year! */ + if ((lflags & F_YEAR) != 0) + if (iyear != year) + continue; + lflags &= ~F_YEAR; + /* Get important dates for this year */ yearinfo = years; while (yearinfo != NULL) { @@ -452,7 +483,7 @@ parsedaymonth(char *date, int *yearp, in } /* Same day every year */ - if (*flags == (F_MONTH | F_DAYOFMONTH)) { + if (lflags == (F_MONTH | F_DAYOFMONTH)) { if (!remember_ymd(year, imonth, idayofmonth)) continue; remember(&remindex, yearp, monthp, dayp, edp, @@ -461,7 +492,7 @@ parsedaymonth(char *date, int *yearp, in } /* XXX Same day every year, but variable */ - if (*flags == (F_MONTH | F_DAYOFMONTH | F_VARIABLE)) { + if (lflags == (F_MONTH | F_DAYOFMONTH | F_VARIABLE)) { if (!remember_ymd(year, imonth, idayofmonth)) continue; remember(&remindex, yearp, monthp, dayp, edp, @@ -470,7 +501,7 @@ parsedaymonth(char *date, int *yearp, in } /* Same day every month */ - if (*flags == (F_ALLMONTH | F_DAYOFMONTH)) { + if (lflags == (F_ALLMONTH | F_DAYOFMONTH)) { for (m = 1; m <= 12; m++) { if (!remember_ymd(year, m, idayofmonth)) continue; @@ -481,7 +512,7 @@ parsedaymonth(char *date, int *yearp, in } /* Every day of a month */ - if (*flags == (F_ALLDAY | F_MONTH)) { + if (lflags == (F_ALLDAY | F_MONTH)) { for (d = 1; d <= yearinfo->mondays[imonth]; d++) { if (!remember_ymd(year, imonth, d)) continue; @@ -492,7 +523,7 @@ parsedaymonth(char *date, int *yearp, in } /* One day of every month */ - if (*flags == (F_ALLMONTH | F_DAYOFWEEK)) { + if (lflags == (F_ALLMONTH | F_DAYOFWEEK)) { for (m = 1; m <= 12; m++) { if (!remember_ymd(year, m, idayofmonth)) continue; @@ -503,7 +534,7 @@ parsedaymonth(char *date, int *yearp, in } /* Every dayofweek of the year */ - if (*flags == (F_DAYOFWEEK | F_VARIABLE)) { + if (lflags == (F_DAYOFWEEK | F_VARIABLE)) { dow = first_dayofweek_of_year(year); d = (idayofweek - dow + 8) % 7; while (d <= 366) { @@ -517,7 +548,7 @@ parsedaymonth(char *date, int *yearp, in } /* A certain dayofweek of a month */ - if (*flags == + if (lflags == (F_MONTH | F_DAYOFWEEK | F_MODIFIERINDEX | F_VARIABLE)) { offset = indextooffset(modifierindex); dow = first_dayofweek_of_month(year, imonth); @@ -553,7 +584,7 @@ parsedaymonth(char *date, int *yearp, in } /* Every dayofweek of the month */ - if (*flags == (F_DAYOFWEEK | F_MONTH | F_VARIABLE)) { + if (lflags == (F_DAYOFWEEK | F_MONTH | F_VARIABLE)) { dow = first_dayofweek_of_month(year, imonth); d = (idayofweek - dow + 8) % 7; while (d <= yearinfo->mondays[imonth]) { @@ -567,10 +598,10 @@ parsedaymonth(char *date, int *yearp, in } /* Easter */ - if ((*flags & ~F_MODIFIEROFFSET) == + if ((lflags & ~F_MODIFIEROFFSET) == (F_SPECIALDAY | F_VARIABLE | F_EASTER)) { offset = 0; - if ((*flags & F_MODIFIEROFFSET) != 0) + if ((lflags & F_MODIFIEROFFSET) != 0) offset = parseoffset(modifieroffset); if (remember_yd(year, yearinfo->ieaster + offset, &rm, &rd)) @@ -580,10 +611,10 @@ parsedaymonth(char *date, int *yearp, in } /* Paskha */ - if ((*flags & ~F_MODIFIEROFFSET) == + if ((lflags & ~F_MODIFIEROFFSET) == (F_SPECIALDAY | F_VARIABLE | F_PASKHA)) { offset = 0; - if ((*flags & F_MODIFIEROFFSET) != 0) + if ((lflags & F_MODIFIEROFFSET) != 0) offset = parseoffset(modifieroffset); if (remember_yd(year, yearinfo->ipaskha + offset, &rm, &rd)) @@ -593,10 +624,10 @@ parsedaymonth(char *date, int *yearp, in } /* Chinese New Year */ - if ((*flags & ~F_MODIFIEROFFSET) == + if ((lflags & ~F_MODIFIEROFFSET) == (F_SPECIALDAY | F_VARIABLE | F_CNY)) { offset = 0; - if ((*flags & F_MODIFIEROFFSET) != 0) + if ((lflags & F_MODIFIEROFFSET) != 0) offset = parseoffset(modifieroffset); if (remember_yd(year, yearinfo->firstcnyday + offset, &rm, &rd)) @@ -606,12 +637,12 @@ parsedaymonth(char *date, int *yearp, in } /* FullMoon */ - if ((*flags & ~F_MODIFIEROFFSET) == + if ((lflags & ~F_MODIFIEROFFSET) == (F_SPECIALDAY | F_VARIABLE | F_FULLMOON)) { int i; offset = 0; - if ((*flags & F_MODIFIEROFFSET) != 0) + if ((lflags & F_MODIFIEROFFSET) != 0) offset = parseoffset(modifieroffset); for (i = 0; yearinfo->ffullmoon[i] > 0; i++) { if (remember_yd(year, @@ -628,12 +659,12 @@ parsedaymonth(char *date, int *yearp, in } /* NewMoon */ - if ((*flags & ~F_MODIFIEROFFSET) == + if ((lflags & ~F_MODIFIEROFFSET) == (F_SPECIALDAY | F_VARIABLE | F_NEWMOON)) { int i; offset = 0; - if ((*flags & F_MODIFIEROFFSET) != 0) + if ((lflags & F_MODIFIEROFFSET) != 0) offset = parseoffset(modifieroffset); for (i = 0; yearinfo->ffullmoon[i] > 0; i++) { if (remember_yd(year, @@ -649,10 +680,10 @@ parsedaymonth(char *date, int *yearp, in } /* (Mar|Sep)Equinox */ - if ((*flags & ~F_MODIFIEROFFSET) == + if ((lflags & ~F_MODIFIEROFFSET) == (F_SPECIALDAY | F_VARIABLE | F_MAREQUINOX)) { offset = 0; - if ((*flags & F_MODIFIEROFFSET) != 0) + if ((lflags & F_MODIFIEROFFSET) != 0) offset = parseoffset(modifieroffset); if (remember_yd(year, yearinfo->equinoxdays[0] + offset, &rm, &rd)) { @@ -662,10 +693,10 @@ parsedaymonth(char *date, int *yearp, in } continue; } - if ((*flags & ~F_MODIFIEROFFSET) == + if ((lflags & ~F_MODIFIEROFFSET) == (F_SPECIALDAY | F_VARIABLE | F_SEPEQUINOX)) { offset = 0; - if ((*flags & F_MODIFIEROFFSET) != 0) + if ((lflags & F_MODIFIEROFFSET) != 0) offset = parseoffset(modifieroffset); if (remember_yd(year, yearinfo->equinoxdays[1] + offset, &rm, &rd)) { @@ -677,10 +708,10 @@ parsedaymonth(char *date, int *yearp, in } /* (Jun|Dec)Solstice */ - if ((*flags & ~F_MODIFIEROFFSET) == + if ((lflags & ~F_MODIFIEROFFSET) == (F_SPECIALDAY | F_VARIABLE | F_JUNSOLSTICE)) { offset = 0; - if ((*flags & F_MODIFIEROFFSET) != 0) + if ((lflags & F_MODIFIEROFFSET) != 0) offset = parseoffset(modifieroffset); if (remember_yd(year, yearinfo->solsticedays[0] + offset, &rm, &rd)) { @@ -690,10 +721,10 @@ parsedaymonth(char *date, int *yearp, in } continue; } - if ((*flags & ~F_MODIFIEROFFSET) == + if ((lflags & ~F_MODIFIEROFFSET) == (F_SPECIALDAY | F_VARIABLE | F_DECSOLSTICE)) { offset = 0; - if ((*flags & F_MODIFIEROFFSET) != 0) + if ((lflags & F_MODIFIEROFFSET) != 0) offset = parseoffset(modifieroffset); if (remember_yd(year, yearinfo->solsticedays[1] + offset, &rm, &rd)) { @@ -705,9 +736,9 @@ parsedaymonth(char *date, int *yearp, in } printf("Unprocessed:\n"); - debug_determinestyle(2, date, *flags, month, imonth, + debug_determinestyle(2, date, lflags, month, imonth, dayofmonth, idayofmonth, dayofweek, idayofweek, - modifieroffset, modifierindex, specialday); + modifieroffset, modifierindex, specialday, syear, iyear); retvalsign = -1; } @@ -723,6 +754,8 @@ showflags(int flags) static char s[1000]; s[0] = '\0'; + if ((flags & F_YEAR) != 0) + strcat(s, "year "); if ((flags & F_MONTH) != 0) strcat(s, "month "); if ((flags & F_DAYOFWEEK) != 0) From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:41:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D518D106564A; Thu, 14 Oct 2010 21:41:08 +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 C38AC8FC1A; Thu, 14 Oct 2010 21:41:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELf817038698; Thu, 14 Oct 2010 21:41:08 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELf8gk038695; Thu, 14 Oct 2010 21:41:08 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010142141.o9ELf8gk038695@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 14 Oct 2010 21:41:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213871 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:41:08 -0000 Author: hselasky Date: Thu Oct 14 21:41:08 2010 New Revision: 213871 URL: http://svn.freebsd.org/changeset/base/213871 Log: Remove unused EHCI register definition. Define reserved EHCI register. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/controller/ehci_pci.c head/sys/dev/usb/controller/ehcireg.h Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Thu Oct 14 21:38:20 2010 (r213870) +++ head/sys/dev/usb/controller/ehci_pci.c Thu Oct 14 21:41:08 2010 (r213871) @@ -93,8 +93,6 @@ __FBSDID("$FreeBSD$"); #define PCI_EHCI_VENDORID_NVIDIA2 0x10DE #define PCI_EHCI_VENDORID_VIA 0x1106 -#define PCI_EHCI_BASE_REG 0x10 - static void ehci_pci_takecontroller(device_t self); static device_probe_t ehci_pci_probe; Modified: head/sys/dev/usb/controller/ehcireg.h ============================================================================== --- head/sys/dev/usb/controller/ehcireg.h Thu Oct 14 21:38:20 2010 (r213870) +++ head/sys/dev/usb/controller/ehcireg.h Thu Oct 14 21:41:08 2010 (r213871) @@ -55,7 +55,7 @@ /* EHCI capability registers */ #define EHCI_CAPLENGTH 0x00 /* RO Capability register length field */ -/* reserved 0x01 */ +#define EHCI_RESERVED 0x01 /* Reserved register */ #define EHCI_HCIVERSION 0x02 /* RO Interface version number */ #define EHCI_HCSPARAMS 0x04 /* RO Structural parameters */ #define EHCI_HCS_DEBUGPORT(x) (((x) >> 20) & 0xf) From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:45:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 646FC106564A; Thu, 14 Oct 2010 21:45:41 +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 530EF8FC19; Thu, 14 Oct 2010 21:45:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELjfhh038823; Thu, 14 Oct 2010 21:45:41 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELjf2O038821; Thu, 14 Oct 2010 21:45:41 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010142145.o9ELjf2O038821@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 14 Oct 2010 21:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213872 - head/sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:45:41 -0000 Author: hselasky Date: Thu Oct 14 21:45:41 2010 New Revision: 213872 URL: http://svn.freebsd.org/changeset/base/213872 Log: Fix forwarding of Line Register Status changes to TTY layer. PR: usb/149675 Approved by: thompsa (mentor) Modified: head/sys/dev/usb/serial/usb_serial.c Modified: head/sys/dev/usb/serial/usb_serial.c ============================================================================== --- head/sys/dev/usb/serial/usb_serial.c Thu Oct 14 21:41:08 2010 (r213871) +++ head/sys/dev/usb/serial/usb_serial.c Thu Oct 14 21:45:41 2010 (r213872) @@ -942,6 +942,7 @@ ucom_cfg_status_change(struct usb_proc_m uint8_t new_msr; uint8_t new_lsr; uint8_t onoff; + uint8_t lsr_delta; tp = sc->sc_tty; @@ -965,6 +966,7 @@ ucom_cfg_status_change(struct usb_proc_m return; } onoff = ((sc->sc_msr ^ new_msr) & SER_DCD); + lsr_delta = (sc->sc_lsr ^ new_lsr); sc->sc_msr = new_msr; sc->sc_lsr = new_lsr; @@ -977,6 +979,30 @@ ucom_cfg_status_change(struct usb_proc_m ttydisc_modem(tp, onoff); } + + if ((lsr_delta & ULSR_BI) && (sc->sc_lsr & ULSR_BI)) { + + DPRINTF("BREAK detected\n"); + + ttydisc_rint(tp, 0, TRE_BREAK); + ttydisc_rint_done(tp); + } + + if ((lsr_delta & ULSR_FE) && (sc->sc_lsr & ULSR_FE)) { + + DPRINTF("Frame error detected\n"); + + ttydisc_rint(tp, 0, TRE_FRAMING); + ttydisc_rint_done(tp); + } + + if ((lsr_delta & ULSR_PE) && (sc->sc_lsr & ULSR_PE)) { + + DPRINTF("Parity error detected\n"); + + ttydisc_rint(tp, 0, TRE_PARITY); + ttydisc_rint_done(tp); + } } void From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:46:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B044A106564A; Thu, 14 Oct 2010 21:46:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EE8B8FC08; Thu, 14 Oct 2010 21:46:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELkrXX038881; Thu, 14 Oct 2010 21:46:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELkrCc038879; Thu, 14 Oct 2010 21:46:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010142146.o9ELkrCc038879@svn.freebsd.org> From: Marius Strobl Date: Thu, 14 Oct 2010 21:46:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213873 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:46:53 -0000 Author: marius Date: Thu Oct 14 21:46:53 2010 New Revision: 213873 URL: http://svn.freebsd.org/changeset/base/213873 Log: Explicitly lower the PIL to 0 as part of enabling interrupts, similar to what is done on other platforms. Unlike as with the sched_throw(NULL) called on BSPs during their startup apparently there's nothing which will reliably lower it on APs. I'm unsure why this only came up on V215 though, breaking these with r207248. My best guess is that these are the only supported ones so far fast enough to loose some race. PR: 151404 MFC after: 3 days Modified: head/sys/sparc64/sparc64/machdep.c Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Thu Oct 14 21:45:41 2010 (r213872) +++ head/sys/sparc64/sparc64/machdep.c Thu Oct 14 21:46:53 2010 (r213873) @@ -590,6 +590,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * enable them. */ intr_init2(); + wrpr(pil, 0, 0); wrpr(pstate, 0, PSTATE_KERNEL); /* From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:51:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34D981065695; Thu, 14 Oct 2010 21:51:54 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 228C08FC31; Thu, 14 Oct 2010 21:51:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELpsXQ039017; Thu, 14 Oct 2010 21:51:54 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELpscd039015; Thu, 14 Oct 2010 21:51:54 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201010142151.o9ELpscd039015@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 14 Oct 2010 21:51:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213874 - stable/7/usr.bin/calendar/calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:51:54 -0000 Author: edwin Date: Thu Oct 14 21:51:53 2010 New Revision: 213874 URL: http://svn.freebsd.org/changeset/base/213874 Log: Remove calendar.judaic from RELENG_7: - It is out of date. - It is properly fixed in HEAD and RELENG_8. Deleted: stable/7/usr.bin/calendar/calendars/calendar.judaic Modified: stable/7/usr.bin/calendar/calendars/calendar.world Modified: stable/7/usr.bin/calendar/calendars/calendar.world ============================================================================== --- stable/7/usr.bin/calendar/calendars/calendar.world Thu Oct 14 21:46:53 2010 (r213873) +++ stable/7/usr.bin/calendar/calendars/calendar.world Thu Oct 14 21:51:53 2010 (r213874) @@ -13,7 +13,6 @@ #include #include #include -#include #include #endif /* !_calendar_world_ */ From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:53:25 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0B1B106564A; Thu, 14 Oct 2010 21:53:25 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF0858FC16; Thu, 14 Oct 2010 21:53:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELrPeP039084; Thu, 14 Oct 2010 21:53:25 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELrPo2039081; Thu, 14 Oct 2010 21:53:25 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201010142153.o9ELrPo2039081@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 14 Oct 2010 21:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213875 - in head/usr.bin/calendar: . calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:53:25 -0000 Author: edwin Date: Thu Oct 14 21:53:25 2010 New Revision: 213875 URL: http://svn.freebsd.org/changeset/base/213875 Log: Update manual with regarding to the status of calendars/calendar.judaic. Modified: head/usr.bin/calendar/calendar.1 head/usr.bin/calendar/calendars/calendar.judaic Modified: head/usr.bin/calendar/calendar.1 ============================================================================== --- head/usr.bin/calendar/calendar.1 Thu Oct 14 21:51:53 2010 (r213874) +++ head/usr.bin/calendar/calendar.1 Thu Oct 14 21:53:25 2010 (r213875) @@ -257,8 +257,8 @@ Other holidays, including the not-well-k obscure. .It Pa calendar.judaic Jewish holidays. -This calendar should be updated yearly by the local system administrator -so that roving holidays are set correctly for the current year. +The entries for this calendar have been obtained from the port +deskutils/hebcal. .It Pa calendar.music Musical events, births, and deaths. Strongly oriented toward rock 'n' roll. Modified: head/usr.bin/calendar/calendars/calendar.judaic ============================================================================== --- head/usr.bin/calendar/calendars/calendar.judaic Thu Oct 14 21:51:53 2010 (r213874) +++ head/usr.bin/calendar/calendars/calendar.judaic Thu Oct 14 21:53:25 2010 (r213875) @@ -13,9 +13,8 @@ #define _calendar_judaic_ /* - * The calendar below has gotten from the port deskutils/hebcal for - * the year of 2010 and for the city of New York. - * This should be updated every year! + * The calendar below has been obtained from the port deskutils/hebcal + * for the year of 2010 to 2015 and for the city of New York. */ 2010/Jan/16* Rosh Chodesh Sh'vat From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:53:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1B2110657CB; Thu, 14 Oct 2010 21:53:42 +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 B028E8FC16; Thu, 14 Oct 2010 21:53:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELrgRA039125; Thu, 14 Oct 2010 21:53:42 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELrgvN039123; Thu, 14 Oct 2010 21:53:42 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010142153.o9ELrgvN039123@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 14 Oct 2010 21:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213876 - head/sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:53:42 -0000 Author: hselasky Date: Thu Oct 14 21:53:42 2010 New Revision: 213876 URL: http://svn.freebsd.org/changeset/base/213876 Log: Add more USB device IDs to supported list of devices. Submitted by: Nick Hibma PR: usb/149900 Approved by: thompsa (mentor) Modified: head/sys/dev/usb/serial/uftdi.c Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Thu Oct 14 21:53:25 2010 (r213875) +++ head/sys/dev/usb/serial/uftdi.c Thu Oct 14 21:53:42 2010 (r213876) @@ -226,6 +226,7 @@ static struct usb_device_id uftdi_devs[] UFTDI_DEV(FTDI, CFA_633, 8U232AM), UFTDI_DEV(FTDI, CFA_634, 8U232AM), UFTDI_DEV(FTDI, CFA_635, 8U232AM), + UFTDI_DEV(FTDI, USB_UIRT, 8U232AM), UFTDI_DEV(FTDI, USBSERIAL, 8U232AM), UFTDI_DEV(FTDI, KBS, 8U232AM), UFTDI_DEV(FTDI, MX2_3, 8U232AM), @@ -247,6 +248,7 @@ static struct usb_device_id uftdi_devs[] UFTDI_DEV(INTREPIDCS, VALUECAN, 8U232AM), UFTDI_DEV(INTREPIDCS, NEOVI, 8U232AM), UFTDI_DEV(BBELECTRONICS, USOTL4, 8U232AM), + UFTDI_DEV(MATRIXORBITAL, MOUA, 8U232AM), UFTDI_DEV(MARVELL, SHEEVAPLUG, 8U232AM), UFTDI_DEV(MELCO, PCOPRS1, 8U232AM), UFTDI_DEV(RATOC, REXUSB60F, 8U232AM), From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 21:58:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2697F1065672; Thu, 14 Oct 2010 21:58:52 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 140EE8FC18; Thu, 14 Oct 2010 21:58:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ELwpMl039299; Thu, 14 Oct 2010 21:58:51 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ELwpaW039296; Thu, 14 Oct 2010 21:58:51 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201010142158.o9ELwpaW039296@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 14 Oct 2010 21:58: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: r213877 - in stable/8/usr.bin/calendar: . calendars X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 21:58:52 -0000 Author: edwin Date: Thu Oct 14 21:58:51 2010 New Revision: 213877 URL: http://svn.freebsd.org/changeset/base/213877 Log: MFC of r213875 Update manual with regarding to the status of calendars/calendar.judaic. Modified: stable/8/usr.bin/calendar/calendar.1 stable/8/usr.bin/calendar/calendars/calendar.judaic Directory Properties: stable/8/usr.bin/calendar/ (props changed) Modified: stable/8/usr.bin/calendar/calendar.1 ============================================================================== --- stable/8/usr.bin/calendar/calendar.1 Thu Oct 14 21:53:42 2010 (r213876) +++ stable/8/usr.bin/calendar/calendar.1 Thu Oct 14 21:58:51 2010 (r213877) @@ -257,8 +257,8 @@ Other holidays, including the not-well-k obscure. .It Pa calendar.judaic Jewish holidays. -This calendar should be updated yearly by the local system administrator -so that roving holidays are set correctly for the current year. +The entries for this calendar have been obtained from the port +deskutils/hebcal. .It Pa calendar.music Musical events, births, and deaths. Strongly oriented toward rock 'n' roll. Modified: stable/8/usr.bin/calendar/calendars/calendar.judaic ============================================================================== --- stable/8/usr.bin/calendar/calendars/calendar.judaic Thu Oct 14 21:53:42 2010 (r213876) +++ stable/8/usr.bin/calendar/calendars/calendar.judaic Thu Oct 14 21:58:51 2010 (r213877) @@ -13,9 +13,8 @@ #define _calendar_judaic_ /* - * The calendar below has gotten from the port deskutils/hebcal for - * the year of 2010 and for the city of New York. - * This should be updated every year! + * The calendar below has been obtained from the port deskutils/hebcal + * for the year of 2010 to 2015 and for the city of New York. */ 2010/Jan/16* Rosh Chodesh Sh'vat From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 22:01:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E01CA1065670; Thu, 14 Oct 2010 22:01:40 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD55A8FC1D; Thu, 14 Oct 2010 22:01:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EM1e67039433; Thu, 14 Oct 2010 22:01:40 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EM1eB8039428; Thu, 14 Oct 2010 22:01:40 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010142201.o9EM1eB8039428@svn.freebsd.org> From: Marius Strobl Date: Thu, 14 Oct 2010 22:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213878 - in head/sys: dev/mii modules/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 22:01:41 -0000 Author: marius Date: Thu Oct 14 22:01:40 2010 New Revision: 213878 URL: http://svn.freebsd.org/changeset/base/213878 Log: Add a NetBSD-compatible mii_attach(), which is intended to eventually replace mii_phy_probe() altogether. Compared to the latter the advantages of mii_attach() are: - intended to be called multiple times in order to attach PHYs in multiple passes (f.e. in order to only use sub-ranges of the 0 to MII_NPHY - 1 range) - being able to pass along the capability mask from the NIC to the PHY drivers - being able to specify at which address (phyloc) to probe for a PHY (instead of always probing at all addresses from 0 to MII_NPHY - 1) - being able to specify which PHY instance (offloc) to attach - being able to pass along MIIF_* flags from the NIC to the PHY drivers (f.e. as required to indicated to the PHY drivers that flow control is supported by the NIC driver, which actually is the motivation for this change). While at it, I used the opportunity to get rid of some hacks in mii(4) like miibus_probe() generally doing work besides sheer probing and the "EVIL HACK" (which will vanish entirely along with mii_phy_probe()) by passing the struct ifnet pointer via an argument of mii_attach() as well as to fix some resource leaks in mii(4) in case something fails. Commits which will update the PHY drivers to honor the MII flags passed down from the NIC drivers and take advantage of mii_attach() to get rid of certain types of hacks in NIC and PHY drivers as well as a conversion of the remaining uses of mii_phy_probe() will follow shortly. Reviewed by: jhb, yongari Obtained from: NetBSD (partially) Modified: head/sys/dev/mii/mii.c head/sys/dev/mii/mii.h head/sys/dev/mii/miivar.h head/sys/modules/mii/Makefile Modified: head/sys/dev/mii/mii.c ============================================================================== --- head/sys/dev/mii/mii.c Thu Oct 14 21:58:51 2010 (r213877) +++ head/sys/dev/mii/mii.c Thu Oct 14 22:01:40 2010 (r213878) @@ -58,6 +58,8 @@ MODULE_VERSION(miibus, 1); #include "miibus_if.h" static int miibus_print_child(device_t dev, device_t child); +static int miibus_read_ivar(device_t dev, device_t child, int which, + uintptr_t *result); static int miibus_child_location_str(device_t bus, device_t child, char *buf, size_t buflen); static int miibus_child_pnpinfo_str(device_t bus, device_t child, char *buf, @@ -77,6 +79,7 @@ static device_method_t miibus_methods[] /* bus interface */ DEVMETHOD(bus_print_child, miibus_print_child), + DEVMETHOD(bus_read_ivar, miibus_read_ivar), DEVMETHOD(bus_driver_added, bus_generic_driver_added), DEVMETHOD(bus_child_pnpinfo_str, miibus_child_pnpinfo_str), DEVMETHOD(bus_child_location_str, miibus_child_location_str), @@ -100,87 +103,52 @@ driver_t miibus_driver = { }; struct miibus_ivars { + struct ifnet *ifp; ifm_change_cb_t ifmedia_upd; ifm_stat_cb_t ifmedia_sts; + int mii_flags; }; -/* - * Helper function used by network interface drivers, attaches PHYs - * to the network interface driver parent. - */ int miibus_probe(device_t dev) { - struct mii_attach_args ma, *args; - struct mii_data *mii; - device_t child = NULL, parent; - int bmsr, capmask = 0xFFFFFFFF; - - mii = device_get_softc(dev); - parent = device_get_parent(dev); - LIST_INIT(&mii->mii_phys); - - for (ma.mii_phyno = 0; ma.mii_phyno < MII_NPHY; ma.mii_phyno++) { - /* - * Check to see if there is a PHY at this address. Note, - * many braindead PHYs report 0/0 in their ID registers, - * so we test for media in the BMSR. - */ - bmsr = MIIBUS_READREG(parent, ma.mii_phyno, MII_BMSR); - if (bmsr == 0 || bmsr == 0xffff || - (bmsr & (BMSR_EXTSTAT | BMSR_MEDIAMASK)) == 0) { - /* Assume no PHY at this address. */ - continue; - } - - /* - * Extract the IDs. Braindead PHYs will be handled by - * the `ukphy' driver, as we have no ID information to - * match on. - */ - ma.mii_id1 = MIIBUS_READREG(parent, ma.mii_phyno, - MII_PHYIDR1); - ma.mii_id2 = MIIBUS_READREG(parent, ma.mii_phyno, - MII_PHYIDR2); - - ma.mii_data = mii; - ma.mii_capmask = capmask; - - args = malloc(sizeof(struct mii_attach_args), - M_DEVBUF, M_NOWAIT); - bcopy((char *)&ma, (char *)args, sizeof(ma)); - child = device_add_child(dev, NULL, -1); - device_set_ivars(child, args); - } - - if (child == NULL) - return (ENXIO); device_set_desc(dev, "MII bus"); - return (0); + return (BUS_PROBE_SPECIFIC); } int miibus_attach(device_t dev) { struct miibus_ivars *ivars; + struct mii_attach_args *ma; struct mii_data *mii; + device_t *children; + int i, nchildren; mii = device_get_softc(dev); - /* - * Note that each NIC's softc must start with an ifnet pointer. - * XXX: EVIL HACK! - */ - mii->mii_ifp = *(struct ifnet**)device_get_softc(device_get_parent(dev)); - mii->mii_ifp->if_capabilities |= IFCAP_LINKSTATE; - mii->mii_ifp->if_capenable |= IFCAP_LINKSTATE; + nchildren = 0; + if (device_get_children(dev, &children, &nchildren) == 0) { + for (i = 0; i < nchildren; i++) { + ma = device_get_ivars(children[i]); + ma->mii_data = mii; + } + free(children, M_TEMP); + } + if (nchildren == 0) { + device_printf(dev, "cannot get children"); + return (ENXIO); + } ivars = device_get_ivars(dev); ifmedia_init(&mii->mii_media, IFM_IMASK, ivars->ifmedia_upd, ivars->ifmedia_sts); - bus_generic_attach(dev); + mii->mii_ifp = ivars->ifp; + mii->mii_ifp->if_capabilities |= IFCAP_LINKSTATE; + mii->mii_ifp->if_capenable |= IFCAP_LINKSTATE; + LIST_INIT(&mii->mii_phys); - return (0); + return (bus_generic_attach(dev)); } int @@ -211,7 +179,28 @@ miibus_print_child(device_t dev, device_ } static int -miibus_child_pnpinfo_str(device_t bus, device_t child, char *buf, +miibus_read_ivar(device_t dev, device_t child __unused, int which, + uintptr_t *result) +{ + struct miibus_ivars *ivars; + + /* + * NB: this uses the instance variables of the miibus rather than + * its PHY children. + */ + ivars = device_get_ivars(dev); + switch (which) { + case MIIBUS_IVAR_FLAGS: + *result = ivars->mii_flags; + break; + default: + return (ENOENT); + } + return (0); +} + +static int +miibus_child_pnpinfo_str(device_t bus __unused, device_t child, char *buf, size_t buflen) { struct mii_attach_args *ma; @@ -224,7 +213,7 @@ miibus_child_pnpinfo_str(device_t bus, d } static int -miibus_child_location_str(device_t bus, device_t child, char *buf, +miibus_child_location_str(device_t bus __unused, device_t child, char *buf, size_t buflen) { struct mii_attach_args *ma; @@ -307,40 +296,177 @@ miibus_mediainit(device_t dev) ifmedia_set(&mii->mii_media, media); } +/* + * Helper function used by network interface drivers, attaches the miibus and + * the PHYs to the network interface driver parent. + */ int -mii_phy_probe(device_t dev, device_t *child, ifm_change_cb_t ifmedia_upd, - ifm_stat_cb_t ifmedia_sts) -{ - struct miibus_ivars *ivars; - int bmsr, i; +mii_attach(device_t dev, device_t *miibus, struct ifnet *ifp, + ifm_change_cb_t ifmedia_upd, ifm_stat_cb_t ifmedia_sts, int capmask, + int phyloc, int offloc, int flags) +{ + struct miibus_ivars *ivars; + struct mii_attach_args ma, *args; + device_t *children, phy; + int bmsr, first, i, nchildren, offset, phymax, phymin, rv; + + if (phyloc != MII_PHY_ANY && offloc != MII_OFFSET_ANY) { + printf("%s: phyloc and offloc specified", __func__); + return (EINVAL); + } - ivars = malloc(sizeof(*ivars), M_DEVBUF, M_NOWAIT); - if (ivars == NULL) - return (ENOMEM); - ivars->ifmedia_upd = ifmedia_upd; - ivars->ifmedia_sts = ifmedia_sts; - *child = device_add_child(dev, "miibus", -1); - device_set_ivars(*child, ivars); - - for (i = 0; i < MII_NPHY; i++) { - bmsr = MIIBUS_READREG(dev, i, MII_BMSR); - if (bmsr == 0 || bmsr == 0xffff || - (bmsr & (BMSR_EXTSTAT | BMSR_MEDIAMASK)) == 0) { - /* Assume no PHY at this address. */ - continue; - } else - break; + if (offloc != MII_OFFSET_ANY && (offloc < 0 || offloc >= MII_NPHY)) { + printf("%s: ivalid offloc %d", __func__, offloc); + return (EINVAL); } - if (i == MII_NPHY) { - device_delete_child(dev, *child); - *child = NULL; - return (ENXIO); + if (phyloc == MII_PHY_ANY) { + phymin = 0; + phymax = MII_NPHY - 1; + } else { + if (phyloc < 0 || phyloc >= MII_NPHY) { + printf("%s: ivalid phyloc %d", __func__, phyloc); + return (EINVAL); + } + phymin = phymax = phyloc; } - bus_generic_attach(dev); + first = 0; + if (*miibus == NULL) { + first = 1; + ivars = malloc(sizeof(*ivars), M_DEVBUF, M_NOWAIT); + if (ivars == NULL) + return (ENOMEM); + ivars->ifp = ifp; + ivars->ifmedia_upd = ifmedia_upd; + ivars->ifmedia_sts = ifmedia_sts; + ivars->mii_flags = flags; + *miibus = device_add_child(dev, "miibus", -1); + if (*miibus == NULL) { + rv = ENXIO; + goto fail; + } + device_set_ivars(*miibus, ivars); + } else { + ivars = device_get_ivars(*miibus); + if (ivars->ifp != ifp || ivars->ifmedia_upd != ifmedia_upd || + ivars->ifmedia_sts != ifmedia_sts || + ivars->mii_flags != flags) { + printf("%s: non-matching invariant", __func__); + return (EINVAL); + } + /* + * Assignment of the attach arguments mii_data for the first + * pass is done in miibus_attach(), i.e. once the miibus softc + * has been allocated. + */ + ma.mii_data = device_get_softc(*miibus); + } + + ma.mii_capmask = capmask; + + phy = NULL; + offset = 0; + for (ma.mii_phyno = phymin; ma.mii_phyno <= phymax; ma.mii_phyno++) { + /* + * Make sure we haven't already configured a PHY at this + * address. This allows mii_attach() to be called + * multiple times. + */ + if (device_get_children(*miibus, &children, &nchildren) == 0) { + for (i = 0; i < nchildren; i++) { + args = device_get_ivars(children[i]); + if (args->mii_phyno == ma.mii_phyno) { + /* + * Yes, there is already something + * configured at this address. + */ + free(children, M_TEMP); + goto skip; + } + } + free(children, M_TEMP); + } + + /* + * Check to see if there is a PHY at this address. Note, + * many braindead PHYs report 0/0 in their ID registers, + * so we test for media in the BMSR. + */ + bmsr = MIIBUS_READREG(dev, ma.mii_phyno, MII_BMSR); + if (bmsr == 0 || bmsr == 0xffff || + (bmsr & (BMSR_EXTSTAT | BMSR_MEDIAMASK)) == 0) { + /* Assume no PHY at this address. */ + continue; + } + + /* + * There is a PHY at this address. If we were given an + * `offset' locator, skip this PHY if it doesn't match. + */ + if (offloc != MII_OFFSET_ANY && offloc != offset) + goto skip; + + /* + * Extract the IDs. Braindead PHYs will be handled by + * the `ukphy' driver, as we have no ID information to + * match on. + */ + ma.mii_id1 = MIIBUS_READREG(dev, ma.mii_phyno, MII_PHYIDR1); + ma.mii_id2 = MIIBUS_READREG(dev, ma.mii_phyno, MII_PHYIDR2); + + args = malloc(sizeof(struct mii_attach_args), M_DEVBUF, + M_NOWAIT); + if (args == NULL) + goto skip; + bcopy((char *)&ma, (char *)args, sizeof(ma)); + phy = device_add_child(*miibus, NULL, -1); + if (phy == NULL) { + free(args, M_DEVBUF); + goto skip; + } + device_set_ivars(phy, args); + skip: + offset++; + } + + if (first != 0) { + if (phy == NULL) { + rv = ENXIO; + goto fail; + } + rv = bus_generic_attach(dev); + if (rv != 0) + goto fail; + } + rv = bus_generic_attach(*miibus); + if (rv != 0) + goto fail; return (0); + + fail: + if (*miibus != NULL) + device_delete_child(dev, *miibus); + free(ivars, M_DEVBUF); + if (first != 0) + *miibus = NULL; + return (rv); +} + +int +mii_phy_probe(device_t dev, device_t *child, ifm_change_cb_t ifmedia_upd, + ifm_stat_cb_t ifmedia_sts) +{ + struct ifnet *ifp; + + /* + * Note that each NIC's softc must start with an ifnet pointer. + * XXX: EVIL HACK! + */ + ifp = *(struct ifnet **)device_get_softc(dev); + return (mii_attach(dev, child, ifp, ifmedia_upd, ifmedia_sts, + BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0)); } /* Modified: head/sys/dev/mii/mii.h ============================================================================== --- head/sys/dev/mii/mii.h Thu Oct 14 21:58:51 2010 (r213877) +++ head/sys/dev/mii/mii.h Thu Oct 14 22:01:40 2010 (r213878) @@ -1,5 +1,5 @@ /* $NetBSD: mii.h,v 1.9 2001/05/31 03:07:14 thorpej Exp $ */ - + /*- * Copyright (c) 1997 Manuel Bouyer. All rights reserved. * @@ -47,7 +47,7 @@ #define MII_COMMAND_WRITE 0x01 #define MII_COMMAND_ACK 0x02 -#define MII_BMCR 0x00 /* Basic mode control register (rw) */ +#define MII_BMCR 0x00 /* Basic mode control register (rw) */ #define BMCR_RESET 0x8000 /* reset */ #define BMCR_LOOP 0x4000 /* loopback */ #define BMCR_SPEED0 0x2000 /* speed selection (LSB) */ @@ -82,6 +82,8 @@ #define BMSR_JABBER 0x0002 /* Jabber detected */ #define BMSR_EXTCAP 0x0001 /* Extended capability */ +#define BMSR_DEFCAPMASK 0xffffffff + /* * Note that the EXTSTAT bit indicates that there is extended status * info available in register 15, but 802.3 section 22.2.4.3 also Modified: head/sys/dev/mii/miivar.h ============================================================================== --- head/sys/dev/mii/miivar.h Thu Oct 14 21:58:51 2010 (r213877) +++ head/sys/dev/mii/miivar.h Thu Oct 14 22:01:40 2010 (r213878) @@ -102,7 +102,7 @@ typedef int (*mii_downcall_t)(struct mii */ struct mii_softc { device_t mii_dev; /* generic device glue */ - + LIST_ENTRY(mii_softc) mii_list; /* entry on parent's PHY list */ int mii_phy; /* our MII address */ @@ -122,16 +122,22 @@ struct mii_softc { typedef struct mii_softc mii_softc_t; /* mii_flags */ -#define MIIF_INITDONE 0x0001 /* has been initialized (mii_data) */ -#define MIIF_NOISOLATE 0x0002 /* do not isolate the PHY */ -#define MIIF_NOLOOP 0x0004 /* no loopback capability */ -#define MIIF_AUTOTSLEEP 0x0010 /* use tsleep(), not callout() */ -#define MIIF_HAVEFIBER 0x0020 /* from parent: has fiber interface */ -#define MIIF_HAVE_GTCR 0x0040 /* has 100base-T2/1000base-T CR */ -#define MIIF_IS_1000X 0x0080 /* is a 1000BASE-X device */ -#define MIIF_DOPAUSE 0x0100 /* advertise PAUSE capability */ -#define MIIF_IS_HPNA 0x0200 /* is a HomePNA device */ -#define MIIF_FORCEANEG 0x0400 /* force auto-negotiation */ +#define MIIF_INITDONE 0x00000001 /* has been initialized (mii_data) */ +#define MIIF_NOISOLATE 0x00000002 /* do not isolate the PHY */ +#define MIIF_NOLOOP 0x00000004 /* no loopback capability */ +#define MIIF_AUTOTSLEEP 0x00000010 /* use tsleep(), not callout() */ +#define MIIF_HAVEFIBER 0x00000020 /* from parent: has fiber interface */ +#define MIIF_HAVE_GTCR 0x00000040 /* has 100base-T2/1000base-T CR */ +#define MIIF_IS_1000X 0x00000080 /* is a 1000BASE-X device */ +#define MIIF_DOPAUSE 0x00000100 /* advertise PAUSE capability */ +#define MIIF_IS_HPNA 0x00000200 /* is a HomePNA device */ +#define MIIF_FORCEANEG 0x00000400 /* force auto-negotiation */ +#define MIIF_MACPRIV0 0x01000000 /* private to the MAC driver */ +#define MIIF_MACPRIV1 0x02000000 /* private to the MAC driver */ +#define MIIF_MACPRIV2 0x04000000 /* private to the MAC driver */ +#define MIIF_PHYPRIV0 0x10000000 /* private to the PHY driver */ +#define MIIF_PHYPRIV1 0x20000000 /* private to the PHY driver */ +#define MIIF_PHYPRIV2 0x40000000 /* private to the PHY driver */ /* Default mii_anegticks values */ #define MII_ANEGTICKS 5 @@ -140,6 +146,14 @@ typedef struct mii_softc mii_softc_t; #define MIIF_INHERIT_MASK (MIIF_NOISOLATE|MIIF_NOLOOP|MIIF_AUTOTSLEEP) /* + * Special `locators' passed to mii_attach(). If one of these is not + * an `any' value, we look for *that* PHY and configure it. If both + * are not `any', that is an error, and mii_attach() will panic. + */ +#define MII_OFFSET_ANY -1 +#define MII_PHY_ANY -1 + +/* * Used to attach a PHY to a parent. */ struct mii_attach_args { @@ -192,6 +206,18 @@ struct mii_media { #define PHY_WRITE(p, r, v) \ MIIBUS_WRITEREG((p)->mii_dev, (p)->mii_phy, (r), (v)) +enum miibus_device_ivars { + MIIBUS_IVAR_FLAGS +}; + +/* + * Simplified accessors for miibus + */ +#define MIIBUS_ACCESSOR(var, ivar, type) \ + __BUS_ACCESSOR(miibus, var, MIIBUS, ivar, type) + +MIIBUS_ACCESSOR(flags, FLAGS, int) + extern devclass_t miibus_devclass; extern driver_t miibus_driver; @@ -199,6 +225,8 @@ int miibus_probe(device_t); int miibus_attach(device_t); int miibus_detach(device_t); +int mii_attach(device_t, device_t *, struct ifnet *, ifm_change_cb_t, + ifm_stat_cb_t, int, int, int, int); int mii_anar(int); void mii_down(struct mii_data *); int mii_mediachg(struct mii_data *); Modified: head/sys/modules/mii/Makefile ============================================================================== --- head/sys/modules/mii/Makefile Thu Oct 14 21:58:51 2010 (r213877) +++ head/sys/modules/mii/Makefile Thu Oct 14 22:01:40 2010 (r213878) @@ -12,7 +12,8 @@ SRCS+= rgephy.c rlphy.c ruephy.c tdkphy. SRCS+= ukphy_subr.c SRCS+= xmphy.c -EXPORT_SYMS= mii_mediachg \ +EXPORT_SYMS= mii_attach \ + mii_mediachg \ mii_phy_probe \ mii_phy_reset \ mii_pollstat \ From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 22:06:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D1D5106566B; Thu, 14 Oct 2010 22:06:52 +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 6B5858FC15; Thu, 14 Oct 2010 22:06:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EM6qUd039559; Thu, 14 Oct 2010 22:06:52 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EM6qVF039556; Thu, 14 Oct 2010 22:06:52 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010142206.o9EM6qVF039556@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 14 Oct 2010 22:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213879 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 22:06:52 -0000 Author: hselasky Date: Thu Oct 14 22:06:52 2010 New Revision: 213879 URL: http://svn.freebsd.org/changeset/base/213879 Log: - Add more USB devices to usbdevs and rename some previously unknown ones. - Add more USB mass storage quirks. Submitted by: Dmitry Luhtionov PR: usb/149934, usb/143045 Approved by: thompsa (mentor) Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Thu Oct 14 22:01:40 2010 (r213878) +++ head/sys/dev/usb/serial/u3g.c Thu Oct 14 22:06:52 2010 (r213879) @@ -285,10 +285,12 @@ static const struct usb_device_id u3g_de U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, MOBILE, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E1752, U3GINIT_HUAWEISCSI), + U3G_DEV(HUAWEI, K3765, U3GINIT_HUAWEI), U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), U3G_DEV(KYOCERA2, KPC680, 0), U3G_DEV(LONGCHEER, WM66, U3GINIT_HUAWEI), U3G_DEV(MERLIN, V620, 0), + U3G_DEV(NEOTEL, PRIME, 0), U3G_DEV(NOVATEL, E725, 0), U3G_DEV(NOVATEL, ES620, 0), U3G_DEV(NOVATEL, ES620_2, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Oct 14 22:01:40 2010 (r213878) +++ head/sys/dev/usb/usbdevs Thu Oct 14 22:06:52 2010 (r213879) @@ -2686,6 +2686,7 @@ product QUALCOMMINC E0076 0x0076 3G mode product QUALCOMMINC E0078 0x0078 3G modem product QUALCOMMINC E0082 0x0082 3G modem product QUALCOMMINC E0086 0x0086 3G modem +product QUALCOMMINC E2000 0x2000 3G modem product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 22:14:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71D761065672; Thu, 14 Oct 2010 22:14:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A8C88FC1F; Thu, 14 Oct 2010 22:14:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9EMEtfA039791; Thu, 14 Oct 2010 22:14:55 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9EMEtHm039789; Thu, 14 Oct 2010 22:14:55 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010142214.o9EMEtHm039789@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 14 Oct 2010 22:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213880 - head/sys/dev/usb/wlan X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 22:14:55 -0000 Author: hselasky Date: Thu Oct 14 22:14:55 2010 New Revision: 213880 URL: http://svn.freebsd.org/changeset/base/213880 Log: Add new USB device IDs to the list of supported devices. PR: usb/151043 Approved by: thompsa (mentor) Modified: head/sys/dev/usb/wlan/if_rum.c Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Thu Oct 14 22:06:52 2010 (r213879) +++ head/sys/dev/usb/wlan/if_rum.c Thu Oct 14 22:14:55 2010 (r213880) @@ -118,6 +118,8 @@ static const struct usb_device_id rum_de RUM_DEV(HUAWEI3COM, WUB320G), RUM_DEV(MELCO, G54HP), RUM_DEV(MELCO, SG54HP), + RUM_DEV(MELCO, WLRUCG), + RUM_DEV(MELCO, WLRUCGAOSS), RUM_DEV(MSI, RT2573_1), RUM_DEV(MSI, RT2573_2), RUM_DEV(MSI, RT2573_3), From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 22:15:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B35621065673; Thu, 14 Oct 2010 22:15:56 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.swip.net [212.247.154.65]) by mx1.freebsd.org (Postfix) with ESMTP id D21178FC18; Thu, 14 Oct 2010 22:15:55 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=iBCGAMPDYtSF9sDXX85uHY3wcnYctfVT8vFpe3qPflY= c=1 sm=1 a=qua-KKEKGTsA:10 a=N659UExz7-8A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=xwVoXoAqIALzZTF5hyoA:9 a=TQlu3KTi7wQLInfabWMzcuY9Qj8A:4 a=pILNOxqGKmIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe03.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 35452592; Fri, 15 Oct 2010 00:15:53 +0200 From: Hans Petter Selasky To: "src-committers@freebsd.org" Date: Fri, 15 Oct 2010 00:17:12 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.1-STABLE; KDE/4.4.5; amd64; ; ) References: <201010142206.o9EM6qVF039556@svn.freebsd.org> In-Reply-To: <201010142206.o9EM6qVF039556@svn.freebsd.org> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201010150017.12280.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" Subject: Re: svn commit: r213879 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 22:15:56 -0000 On Friday 15 October 2010 00:06:52 Hans Petter Selasky wrote: > r213879 Correct commit message: Add more USB device IDs to the supported list of devices. Fix U3G kernel build breakage since r213856 due to a missing usbdevs entry. Submitted by: Nick Hibma PR: usb/149764 Approved by: thompsa (mentor) Enough patching for today :-) --HPS From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 23:26:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D3D8106564A; Thu, 14 Oct 2010 23:26:09 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EFC0E8FC0C; Thu, 14 Oct 2010 23:26:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ENQ8BZ041505; Thu, 14 Oct 2010 23:26:08 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ENQ8bE041503; Thu, 14 Oct 2010 23:26:08 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201010142326.o9ENQ8bE041503@svn.freebsd.org> From: Matthew D Fleming Date: Thu, 14 Oct 2010 23:26:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213882 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 23:26:09 -0000 Author: mdf Date: Thu Oct 14 23:26:08 2010 New Revision: 213882 URL: http://svn.freebsd.org/changeset/base/213882 Log: Fixes to mps_user_command(): - fix the leak of command struct on error - simplify the cleanup logic - EINPROGRESS is not a fatal error - buggy comment and error message Reviewed by: ken Modified: head/sys/dev/mps/mps_user.c Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Thu Oct 14 22:45:14 2010 (r213881) +++ head/sys/dev/mps/mps_user.c Thu Oct 14 23:26:08 2010 (r213882) @@ -579,7 +579,7 @@ mps_user_command(struct mps_softc *sc, s MPI2_REQUEST_HEADER *hdr; MPI2_DEFAULT_REPLY *rpl; void *buf = NULL; - struct mps_command *cm; + struct mps_command *cm = NULL; int err = 0; int sz; @@ -631,11 +631,12 @@ mps_user_command(struct mps_softc *sc, s mps_lock(sc); err = mps_map_command(sc, cm); - if (err != 0) { - mps_printf(sc, "mps_user_command: request timed out\n"); + if (err != 0 && err != EINPROGRESS) { + mps_printf(sc, "%s: invalid request: error %d\n", + __func__, err); goto Ret; } - msleep(cm, &sc->mps_mtx, 0, "mpsuser", 0); /* 30 seconds */ + msleep(cm, &sc->mps_mtx, 0, "mpsuser", 0); rpl = (MPI2_DEFAULT_REPLY *)cm->cm_reply; sz = rpl->MsgLength * 4; @@ -652,22 +653,14 @@ mps_user_command(struct mps_softc *sc, s copyout(rpl, cmd->rpl, sz); if (buf != NULL) copyout(buf, cmd->buf, cmd->len); - mps_lock(sc); - mps_dprint(sc, MPS_INFO, "mps_user_command: reply size %d\n", sz ); - mps_free_command(sc, cm); -Ret: - mps_unlock(sc); - if (buf != NULL) - free(buf, M_MPSUSER); - return (err); - RetFreeUnlocked: mps_lock(sc); - mps_free_command(sc, cm); + if (cm != NULL) + mps_free_command(sc, cm); +Ret: mps_unlock(sc); - if (buf != NULL) free(buf, M_MPSUSER); return (err); From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 23:28:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFB5A106566B; Thu, 14 Oct 2010 23:28:31 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DA048FC19; Thu, 14 Oct 2010 23:28:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ENSVlH041588; Thu, 14 Oct 2010 23:28:31 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ENSVRX041585; Thu, 14 Oct 2010 23:28:31 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201010142328.o9ENSVRX041585@svn.freebsd.org> From: "David E. O'Brien" Date: Thu, 14 Oct 2010 23:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213883 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 23:28:31 -0000 Author: obrien Date: Thu Oct 14 23:28:31 2010 New Revision: 213883 URL: http://svn.freebsd.org/changeset/base/213883 Log: Embellish this testcase a little bit to be more clear what the output is and why. The first case is correct usage which has but one correct output. The 2nd and 3rd cases are incorrect usage in which the exact output is not standardized and various shells give various allowable output. Modified: head/tools/regression/bin/sh/builtins/getopts1.0 head/tools/regression/bin/sh/builtins/getopts1.0.stdout Modified: head/tools/regression/bin/sh/builtins/getopts1.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/getopts1.0 Thu Oct 14 23:26:08 2010 (r213882) +++ head/tools/regression/bin/sh/builtins/getopts1.0 Thu Oct 14 23:28:31 2010 (r213883) @@ -1,12 +1,25 @@ # $FreeBSD$ + +echo '-1-' set -- -abc getopts "ab:" OPTION echo ${OPTION} +# In this case 'getopts' should realize that we have not provided the +# required argument for "-b". +# Note that Solaris 10's (UNIX 03) /usr/xpg4/bin/sh, /bin/sh, and /bin/ksh; +# ksh93 20090505; pdksh 5.2.14p2; mksh R39c; bash 4.1 PL7; and zsh 4.3.10. +# all recognize that "b" is missing its argument on the *first* iteration +# of 'getopts' and do not produce the "a" in $OPTION. +echo '-2-' set -- -ab getopts "ab:" OPTION echo ${OPTION} +getopts "ab:" OPTION +echo ${OPTION} +# The 'shift' is aimed at causing an error. +echo '-3-' shift 1 getopts "ab:" OPTION echo ${OPTION} Modified: head/tools/regression/bin/sh/builtins/getopts1.0.stdout ============================================================================== --- head/tools/regression/bin/sh/builtins/getopts1.0.stdout Thu Oct 14 23:26:08 2010 (r213882) +++ head/tools/regression/bin/sh/builtins/getopts1.0.stdout Thu Oct 14 23:28:31 2010 (r213883) @@ -1,3 +1,8 @@ +-1- a +-2- a +No arg for -b option +? +-3- ? From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 23:31:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 698D01065674; Thu, 14 Oct 2010 23:31:16 +0000 (UTC) Date: Thu, 14 Oct 2010 23:31:16 +0000 From: Alexander Best To: Konstantin Belousov Message-ID: <20101014233116.GA45527@freebsd.org> References: <201010141930.o9EJUii3034416@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201010141930.o9EJUii3034416@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213846 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 23:31:16 -0000 On Thu Oct 14 10, Konstantin Belousov wrote: > Author: kib > Date: Thu Oct 14 19:30:44 2010 > New Revision: 213846 > URL: http://svn.freebsd.org/changeset/base/213846 > > Log: > Remove stale comment. thanks a lot. :) > > Submitted by: arundel > MFC after: 3 days > > Modified: > head/sys/compat/linux/linux_util.h > > Modified: head/sys/compat/linux/linux_util.h > ============================================================================== > --- head/sys/compat/linux/linux_util.h Thu Oct 14 19:19:19 2010 (r213845) > +++ head/sys/compat/linux/linux_util.h Thu Oct 14 19:30:44 2010 (r213846) > @@ -31,11 +31,6 @@ > * $FreeBSD$ > */ > > -/* > - * This file is pretty much the same as Christos' svr4_util.h > - * (for now). > - */ > - > #ifndef _LINUX_UTIL_H_ > #define _LINUX_UTIL_H_ > -- a13x From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 23:31:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06A521065672; Thu, 14 Oct 2010 23:31:59 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE6BF8FC16; Thu, 14 Oct 2010 23:31:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9ENVwxW041692; Thu, 14 Oct 2010 23:31:58 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9ENVw9h041689; Thu, 14 Oct 2010 23:31:58 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201010142331.o9ENVw9h041689@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 14 Oct 2010 23:31:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213884 - in head/sys: conf modules/acpi/acpi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 23:31:59 -0000 Author: jkim Date: Thu Oct 14 23:31:58 2010 New Revision: 213884 URL: http://svn.freebsd.org/changeset/base/213884 Log: Stop hard coding nm(1) and make it overridable. Modified: head/sys/conf/files.amd64 head/sys/modules/acpi/acpi/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Oct 14 23:28:31 2010 (r213883) +++ head/sys/conf/files.amd64 Thu Oct 14 23:31:58 2010 (r213884) @@ -87,7 +87,7 @@ acpi_wakecode.h optional acpi \ clean "acpi_wakecode.h" acpi_wakedata.h optional acpi \ dependency "acpi_wakecode.o" \ - compile-with 'nm -n --defined-only acpi_wakecode.o | while read offset dummy what; do echo "#define $${what} 0x$${offset}"; done > ${.TARGET}' \ + compile-with '${NM} -n --defined-only acpi_wakecode.o | while read offset dummy what; do echo "#define $${what} 0x$${offset}"; done > ${.TARGET}' \ no-obj no-implicit-rule before-depend \ clean "acpi_wakedata.h" # Modified: head/sys/modules/acpi/acpi/Makefile ============================================================================== --- head/sys/modules/acpi/acpi/Makefile Thu Oct 14 23:28:31 2010 (r213883) +++ head/sys/modules/acpi/acpi/Makefile Thu Oct 14 23:31:58 2010 (r213884) @@ -108,18 +108,22 @@ CFLAGS+=-DSMP SRCS+= acpi_switch.S acpi_wakedata.h CLEANFILES+= acpi_wakedata.h ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} +NORMAL_S= ${CC} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC} +NM?= nm acpi_switch.o: acpi_switch.S - ${CC} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC} + ${NORMAL_S} acpi_wakecode.o: acpi_wakecode.S assym.s - ${CC} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC} + ${NORMAL_S} acpi_wakecode.bin: acpi_wakecode.o objcopy -S -O binary acpi_wakecode.o ${.TARGET} acpi_wakecode.h: acpi_wakecode.bin file2c -sx 'static char wakecode[] = {' '};' < acpi_wakecode.bin > \ ${.TARGET} acpi_wakedata.h: acpi_wakecode.o - nm -n --defined-only ${.ALLSRC} | while read offset dummy what; do \ - echo "#define $${what} 0x$${offset}"; done > ${.TARGET} + ${NM} -n --defined-only acpi_wakecode.o | \ + while read offset dummy what; do \ + echo "#define $${what} 0x$${offset}"; \ + done > ${.TARGET} .else acpi_wakecode.h: acpi_wakecode.S assym.s ${MAKE} -f ${.CURDIR}/../../../${MACHINE_CPUARCH}/acpica/Makefile \ From owner-svn-src-all@FreeBSD.ORG Thu Oct 14 23:43:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BF8B106564A; Thu, 14 Oct 2010 23:43:32 +0000 (UTC) (envelope-from kaduk@mit.edu) Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU [18.7.68.35]) by mx1.freebsd.org (Postfix) with ESMTP id 9A3EC8FC0A; Thu, 14 Oct 2010 23:43:31 +0000 (UTC) X-AuditID: 12074423-b7bd0ae000000a00-3d-4cb7921783a6 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-6.mit.edu (Symantec Brightmail Gateway) with SMTP id 9D.D7.02560.71297BC4; Thu, 14 Oct 2010 19:28:23 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id o9ENSRVk001776; Thu, 14 Oct 2010 19:28:28 -0400 Received: from multics.mit.edu (MULTICS.MIT.EDU [18.187.1.73]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id o9ENSOeZ006044 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 14 Oct 2010 19:28:26 -0400 (EDT) Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id o9ENSNY7022483; Thu, 14 Oct 2010 19:28:23 -0400 (EDT) Date: Thu, 14 Oct 2010 19:28:23 -0400 (EDT) From: Benjamin Kaduk To: Erik Cederstrand In-Reply-To: <5D7F8DAF-E127-41C0-927B-1D72EFC8F4C4@cederstrand.dk> Message-ID: References: <201010090531.o995V8n3026865@svn.freebsd.org> <8C667EA1-3012-4499-BCCE-58263165663B@cederstrand.dk> <20101010083725.S3587@besplex.bde.org> <2A26ECE8-7713-49C4-8706-5AA5B232BE29@cederstrand.dk> <20101013143845.I1817@besplex.bde.org> <5D7F8DAF-E127-41C0-927B-1D72EFC8F4C4@cederstrand.dk> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Brightmail-Tracker: AAAAAA== Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Tim Kientzle , src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r213643 - head/usr.bin/ar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2010 23:43:32 -0000 On Thu, 14 Oct 2010, Erik Cederstrand wrote: > > Den 13/10/2010 kl. 05.55 skrev Bruce Evans: > > >> [Erik wrote, but the attribution was stripped] >>> I'm a real beginner here. As I read the manuals (GNU ar and BSD ar), >>> the only flags that really control archive contents on archive >>> creation is 'q' and 'r'. The 'l' is ignored, 'c' and 'v' control >>> verbosity, and 'u' and 's' are for performance purposes that are >>> largely irrelevant today (extracting every single *.a file and >>> recreating it wit ar -rD takes less than 10 secs on my slow machine). >>> Is there any negative impact at runtime from having all archives >>> created with either -rD or -qD (ignoring verbosity at build time for >>> now)? >> >> I don't really know. 's' is also useful for non-libraries. 'u' is related >> to clobbering times, but goes the wrong way by updating the archive if the >> file is newer. I think all FreeBSD libraries should be built with the same >> flags (probably ARFLAGS, with you putting -D in it if you don't want the >> timestamp update). However, the places that already use ARFLAGS but set it >> themselves may be a problem. Some Makefiles initentionally avoid using >> bsd.lib.mk because they are special and it does the wrong things for them. >> They probably don't really care about the exact archive flags, but need to >> be checked individually. > > I'd like to give it a try. This is where an easy-to-use regression suite > with reasonable coverage for FreeBSD would come in handy :-) I am certainly willing to help test, and maybe even help check the uses of ARFLAGS (though I seem to have a severe shortage of time). I still have my test environment where ar(1) bails without -D, which would probably be helpful. -Ben From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 00:12:47 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EAAA106564A; Fri, 15 Oct 2010 00:12:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id E5E508FC12; Fri, 15 Oct 2010 00:12:46 +0000 (UTC) Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au (c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o9F0Cfk3004435 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Oct 2010 11:12:43 +1100 Date: Fri, 15 Oct 2010 11:12:41 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim In-Reply-To: <201010141558.03154.jkim@FreeBSD.org> Message-ID: <20101015111106.P1144@besplex.bde.org> References: <201010131717.o9DHHobD094458@svn.freebsd.org> <201010131359.44590.jkim@FreeBSD.org> <20101014113203.N1092@besplex.bde.org> <201010141558.03154.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@FreeBSD.org, Rui Paulo , Roman Divacky , Bruce Evans , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r213793 - in head/sys/dev: ce cp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 00:12:47 -0000 On Thu, 14 Oct 2010, Jung-uk Kim wrote: > On Wednesday 13 October 2010 09:16 pm, Bruce Evans wrote: >> On Wed, 13 Oct 2010, Jung-uk Kim wrote: >>> ... >>> I think the attached patch should do. >> >> % Index: sys/dev/ce/if_ce.c >> % >> =================================================================== >> % --- sys/dev/ce/if_ce.c (revision 213782) >> % +++ sys/dev/ce/if_ce.c (working copy) >> % @@ -1313,9 +1313,11 @@ static int ce_ioctl (struct cdev *dev, >> u_long cmd, % IFP2SP(d->ifp)->pp_flags &= ~(PP_FR); >> % IFP2SP(d->ifp)->pp_flags |= PP_KEEPALIVE; >> % d->ifp->if_flags |= PP_CISCO; >> % - } else if (! strcmp ("fr", (char*)data) && PP_FR) { >> % +#if PP_FR > 0 >> % + } else if (! strcmp ("fr", (char*)data)) { >> % d->ifp->if_flags &= ~(PP_CISCO); >> % IFP2SP(d->ifp)->pp_flags |= PP_FR | PP_KEEPALIVE; >> % +#endif >> % } else if (! strcmp ("ppp", (char*)data)) { >> % IFP2SP(d->ifp)->pp_flags &= ~PP_FR; >> % IFP2SP(d->ifp)->pp_flags &= ~PP_KEEPALIVE; >> % ... >> >> This gives different behaviour if PP_FR is even or negative. Even >> values used to fail the match, but now the match succeeds for even >> values > 0 and then the bits of PP_FR are put in pp_flags. >> Negative values used to pass the match if they were odd, but now >> the match is not attempted for any negative value. It just might >> be useful for PP_FR to have multiple bits set, with the 1 bit used >> for enabling this and the other bits used for setting pp_flags. If >> not, then only values of 0 and 1 for PP_FR make sense, and the >> ifdef should be "#if PP_FR == 1". > > I don't understand your remarks about PP_FR being even/odd. Maybe you > are confused '&&' with '&'? ;-) Oops. > Is the attached patch okay for you, then? This seems to restore the original behaviour. [... Patch lost to attachment.] Bruce From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 00:42:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E4B2106564A; Fri, 15 Oct 2010 00:42:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id E36378FC13; Fri, 15 Oct 2010 00:42:28 +0000 (UTC) Received: from c122-106-146-165.carlnfd1.nsw.optusnet.com.au (c122-106-146-165.carlnfd1.nsw.optusnet.com.au [122.106.146.165]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o9F0gM7N006379 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Oct 2010 11:42:23 +1100 Date: Fri, 15 Oct 2010 11:42:22 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Erik Cederstrand In-Reply-To: <5D7F8DAF-E127-41C0-927B-1D72EFC8F4C4@cederstrand.dk> Message-ID: <20101015112704.I1144@besplex.bde.org> References: <201010090531.o995V8n3026865@svn.freebsd.org> <8C667EA1-3012-4499-BCCE-58263165663B@cederstrand.dk> <20101010083725.S3587@besplex.bde.org> <2A26ECE8-7713-49C4-8706-5AA5B232BE29@cederstrand.dk> <20101013143845.I1817@besplex.bde.org> <5D7F8DAF-E127-41C0-927B-1D72EFC8F4C4@cederstrand.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Ben Kaduk , Tim Kientzle , Bruce Evans , svn-src-head@freebsd.org Subject: Re: svn commit: r213643 - head/usr.bin/ar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 00:42:29 -0000 On Thu, 14 Oct 2010, Erik Cederstrand wrote: > Den 13/10/2010 kl. 05.55 skrev Bruce Evans: > >> I also don't like distributions that stamp every file with their release >> build time (or maybe a little later, with a single release time). How would >> do you prevent clobbering metadata outside of archives? What I do is install >> with -C -p (and also -v -v to report changes), and then compare installed >> copies or just look at the install -v -v output. > > What does install(1) do to determine if files are different, if not mtime, size or checksums? Metadata like OBJDIR, SRCDIR, timestamps and user email address might still differ, even though the binaries are functionally equivalent. Would strip(1) or objcopy(1) be able to remove or alter these? install(1) mainly compares bytes. Thus it can consider changed metadata in inodes (mainly timestamps) to be irrelevant. This cannot handle metadata (like timestamps) within the file. strip(1) and objcopy(1) will clobber external timestamps, at least if they change the contents. install -p is partly to recover from such clobbering (but install has special knowledge of strip, and IIRC it uses the timestamps of the unstripped file). Sometimes they will remove internal metadata and thus allow the modified files to compare equal. A usful example of this is stripping debug info. Just adding a comment in a new line in a C source file will change the line numbers in the debugging info for all subsequent lines (that generate code). Putting build dates in object files using __DATE_ and __TIME__ in C source files would be less annoying if they were put in a separate section that could be stripped, but this is not very easy to at the source level. Version control ids are already normally put in a special section, but I think it has other stuff in it that must not be stripped. Normally you shouldn't strip them, but they might affect the object files too much if they contain too much info about the checkout place or time. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 02:58:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F272A106564A; Fri, 15 Oct 2010 02:58:49 +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 E03798FC08; Fri, 15 Oct 2010 02:58:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9F2wnsB046343; Fri, 15 Oct 2010 02:58:49 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9F2wnpS046341; Fri, 15 Oct 2010 02:58:49 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201010150258.o9F2wnpS046341@svn.freebsd.org> From: Alan Cox Date: Fri, 15 Oct 2010 02:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213886 - stable/8/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 02:58:50 -0000 Author: alc Date: Fri Oct 15 02:58:49 2010 New Revision: 213886 URL: http://svn.freebsd.org/changeset/base/213886 Log: MFC r212873 Allow a POSIX shared memory object that is opened for read but not for write to nonetheless be mapped PROT_WRITE and MAP_PRIVATE, i.e., copy-on-write. PR: 150260 Modified: stable/8/sys/vm/vm_mmap.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/vm/vm_mmap.c ============================================================================== --- stable/8/sys/vm/vm_mmap.c Thu Oct 14 23:38:37 2010 (r213885) +++ stable/8/sys/vm/vm_mmap.c Fri Oct 15 02:58:49 2010 (r213886) @@ -1316,7 +1316,8 @@ vm_mmap_shm(struct thread *td, vm_size_t { int error; - if ((*maxprotp & VM_PROT_WRITE) == 0 && + if ((*flagsp & MAP_SHARED) != 0 && + (*maxprotp & VM_PROT_WRITE) == 0 && (prot & PROT_WRITE) != 0) return (EACCES); #ifdef MAC From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 03:23:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFE73106564A; Fri, 15 Oct 2010 03:23:53 +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 DD1968FC14; Fri, 15 Oct 2010 03:23:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9F3NrJG047292; Fri, 15 Oct 2010 03:23:53 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9F3Nrlf047288; Fri, 15 Oct 2010 03:23:53 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201010150323.o9F3Nrlf047288@svn.freebsd.org> From: Alan Cox Date: Fri, 15 Oct 2010 03:23: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: r213887 - in stable/8/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 03:23:54 -0000 Author: alc Date: Fri Oct 15 03:23:53 2010 New Revision: 213887 URL: http://svn.freebsd.org/changeset/base/213887 Log: MFC r209789 Correctly maintain the per-cpu field "curpmap" on amd64 just like we do on i386. The consequences of not doing so on amd64 became apparent with the introduction of the COUNT_IPIS and COUNT_XINVLTLB_HITS options. Specifically, single-threaded applications were generating unnecessary IPIs to shoot-down the TLB on other processors. MFC r209887 Reduce the number of global TLB shootdowns generated by pmap_qenter(). Specifically, teach pmap_qenter() to recognize the case when it is being asked to replace a mapping with the very same mapping and not generate a shootdown. Modified: stable/8/sys/amd64/amd64/cpu_switch.S stable/8/sys/amd64/amd64/pmap.c stable/8/sys/i386/i386/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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/cpu_switch.S ============================================================================== --- stable/8/sys/amd64/amd64/cpu_switch.S Fri Oct 15 02:58:49 2010 (r213886) +++ stable/8/sys/amd64/amd64/cpu_switch.S Fri Oct 15 03:23:53 2010 (r213887) @@ -69,16 +69,13 @@ * %rsi = newtd */ ENTRY(cpu_throw) + movl PCPU(CPUID),%eax testq %rdi,%rdi - jnz 1f - movq PCPU(IDLETHREAD),%rdi -1: - movq TD_PCB(%rdi),%r8 /* Old pcb */ - movl PCPU(CPUID), %eax + jz 1f /* release bit from old pm_active */ - movq TD_PROC(%rdi), %rdx /* oldtd->td_proc */ - movq P_VMSPACE(%rdx), %rdx /* proc->p_vmspace */ - LK btrl %eax, VM_PMAP+PM_ACTIVE(%rdx) /* clear old */ + movq PCPU(CURPMAP),%rdx + LK btrl %eax,PM_ACTIVE(%rdx) /* clear old */ +1: movq TD_PCB(%rsi),%r8 /* newtd->td_proc */ movq PCB_CR3(%r8),%rdx movq %rdx,%cr3 /* new address space */ @@ -140,15 +137,16 @@ swinact: movq %rcx,%cr3 /* new address space */ movl PCPU(CPUID), %eax /* Release bit from old pmap->pm_active */ - movq TD_PROC(%rdi), %rcx /* oldproc */ - movq P_VMSPACE(%rcx), %rcx - LK btrl %eax, VM_PMAP+PM_ACTIVE(%rcx) /* clear old */ + movq PCPU(CURPMAP),%rcx + LK btrl %eax,PM_ACTIVE(%rcx) /* clear old */ SETLK %rdx, TD_LOCK(%rdi) /* Release the old thread */ swact: /* Set bit in new pmap->pm_active */ movq TD_PROC(%rsi),%rdx /* newproc */ movq P_VMSPACE(%rdx), %rdx - LK btsl %eax, VM_PMAP+PM_ACTIVE(%rdx) /* set new */ + addq $VM_PMAP,%rdx + LK btsl %eax,PM_ACTIVE(%rdx) /* set new */ + movq %rdx,PCPU(CURPMAP) sw1: #if defined(SCHED_ULE) && defined(SMP) Modified: stable/8/sys/amd64/amd64/pmap.c ============================================================================== --- stable/8/sys/amd64/amd64/pmap.c Fri Oct 15 02:58:49 2010 (r213886) +++ stable/8/sys/amd64/amd64/pmap.c Fri Oct 15 03:23:53 2010 (r213887) @@ -1258,19 +1258,22 @@ pmap_map(vm_offset_t *virt, vm_paddr_t s void pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) { - pt_entry_t *endpte, oldpte, *pte; + pt_entry_t *endpte, oldpte, pa, *pte; + vm_page_t m; oldpte = 0; pte = vtopte(sva); endpte = pte + count; while (pte < endpte) { - oldpte |= *pte; - pte_store(pte, VM_PAGE_TO_PHYS(*ma) | PG_G | - pmap_cache_bits((*ma)->md.pat_mode, 0) | PG_RW | PG_V); + m = *ma++; + pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(m->md.pat_mode, 0); + if ((*pte & (PG_FRAME | PG_PTE_CACHE)) != pa) { + oldpte |= *pte; + pte_store(pte, pa | PG_G | PG_RW | PG_V); + } pte++; - ma++; } - if ((oldpte & PG_V) != 0) + if (__predict_false((oldpte & PG_V) != 0)) pmap_invalidate_range(kernel_pmap, sva, sva + count * PAGE_SIZE); } @@ -1500,6 +1503,7 @@ pmap_pinit0(pmap_t pmap) pmap->pm_pml4 = (pml4_entry_t *)PHYS_TO_DMAP(KPML4phys); pmap->pm_root = NULL; pmap->pm_active = 0; + PCPU_SET(curpmap, pmap); TAILQ_INIT(&pmap->pm_pvchunk); bzero(&pmap->pm_stats, sizeof pmap->pm_stats); } @@ -4873,6 +4877,7 @@ if (oldpmap) /* XXX FIXME */ cr3 = DMAP_TO_PHYS((vm_offset_t)pmap->pm_pml4); td->td_pcb->pcb_cr3 = cr3; load_cr3(cr3); + PCPU_SET(curpmap, pmap); critical_exit(); } Modified: stable/8/sys/i386/i386/pmap.c ============================================================================== --- stable/8/sys/i386/i386/pmap.c Fri Oct 15 02:58:49 2010 (r213886) +++ stable/8/sys/i386/i386/pmap.c Fri Oct 15 03:23:53 2010 (r213887) @@ -1440,19 +1440,22 @@ pmap_map(vm_offset_t *virt, vm_paddr_t s void pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) { - pt_entry_t *endpte, oldpte, *pte; + pt_entry_t *endpte, oldpte, pa, *pte; + vm_page_t m; oldpte = 0; pte = vtopte(sva); endpte = pte + count; while (pte < endpte) { - oldpte |= *pte; - pte_store(pte, VM_PAGE_TO_PHYS(*ma) | pgeflag | - pmap_cache_bits((*ma)->md.pat_mode, 0) | PG_RW | PG_V); + m = *ma++; + pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(m->md.pat_mode, 0); + if ((*pte & (PG_FRAME | PG_PTE_CACHE)) != pa) { + oldpte |= *pte; + pte_store(pte, pa | pgeflag | PG_RW | PG_V); + } pte++; - ma++; } - if ((oldpte & PG_V) != 0) + if (__predict_false((oldpte & PG_V) != 0)) pmap_invalidate_range(kernel_pmap, sva, sva + count * PAGE_SIZE); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 04:02:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B662E106566B; Fri, 15 Oct 2010 04:02:07 +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 89D548FC08; Fri, 15 Oct 2010 04:02:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9F427wr048235; Fri, 15 Oct 2010 04:02:07 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9F427vT048233; Fri, 15 Oct 2010 04:02:07 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201010150402.o9F427vT048233@svn.freebsd.org> From: Alan Cox Date: Fri, 15 Oct 2010 04:02:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213888 - stable/8/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 04:02:07 -0000 Author: alc Date: Fri Oct 15 04:02:07 2010 New Revision: 213888 URL: http://svn.freebsd.org/changeset/base/213888 Log: MFC r210124 Optimize pmap_remove()'s handling of PG_G mappings. Modified: stable/8/sys/amd64/amd64/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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/pmap.c ============================================================================== --- stable/8/sys/amd64/amd64/pmap.c Fri Oct 15 03:23:53 2010 (r213887) +++ stable/8/sys/amd64/amd64/pmap.c Fri Oct 15 04:02:07 2010 (r213888) @@ -2530,12 +2530,6 @@ pmap_remove_pte(pmap_t pmap, pt_entry_t oldpte = pte_load_clear(ptq); if (oldpte & PG_W) pmap->pm_stats.wired_count -= 1; - /* - * Machines that don't support invlpg, also don't support - * PG_G. - */ - if (oldpte & PG_G) - pmap_invalidate_page(kernel_pmap, va); pmap->pm_stats.resident_count -= 1; if (oldpte & PG_MANAGED) { m = PHYS_TO_VM_PAGE(oldpte & PG_FRAME); @@ -2575,7 +2569,7 @@ pmap_remove_page(pmap_t pmap, vm_offset_ void pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { - vm_offset_t va_next; + vm_offset_t va, va_next; pml4_entry_t *pml4e; pdp_entry_t *pdpe; pd_entry_t ptpaddr, *pde; @@ -2676,20 +2670,27 @@ pmap_remove(pmap_t pmap, vm_offset_t sva if (va_next > eva) va_next = eva; + va = va_next; for (pte = pmap_pde_to_pte(pde, sva); sva != va_next; pte++, sva += PAGE_SIZE) { - if (*pte == 0) + if (*pte == 0) { + if (va != va_next) { + pmap_invalidate_range(pmap, va, sva); + va = va_next; + } continue; - - /* - * The TLB entry for a PG_G mapping is invalidated - * by pmap_remove_pte(). - */ + } if ((*pte & PG_G) == 0) anyvalid = 1; - if (pmap_remove_pte(pmap, pte, sva, ptpaddr, &free)) + else if (va == va_next) + va = sva; + if (pmap_remove_pte(pmap, pte, sva, ptpaddr, &free)) { + sva += PAGE_SIZE; break; + } } + if (va != va_next) + pmap_invalidate_range(pmap, va, sva); } out: if (anyvalid) From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 04:02:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD60D106574E; Fri, 15 Oct 2010 04:02:23 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BAE538FC1D; Fri, 15 Oct 2010 04:02:23 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9F42LWJ085860; Fri, 15 Oct 2010 04:02:22 GMT (envelope-from davidxu@freebsd.org) Message-ID: <4CB842CE.4020501@freebsd.org> Date: Fri, 15 Oct 2010 12:02:22 +0000 From: David Xu User-Agent: Thunderbird 2.0.0.24 (X11/20100630) MIME-Version: 1.0 To: Peter Holm References: <201010120036.o9C0aueg032391@svn.freebsd.org> <20101014144423.GA23363@x2.osted.lan> In-Reply-To: <20101014144423.GA23363@x2.osted.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213714 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 04:02:23 -0000 Peter Holm wrote: > On Tue, Oct 12, 2010 at 12:36:56AM +0000, David Xu wrote: >> Author: davidxu >> Date: Tue Oct 12 00:36:56 2010 >> New Revision: 213714 >> URL: http://svn.freebsd.org/changeset/base/213714 >> >> Log: >> Add a flag TDF_TIDHASH to prevent a thread from being >> added to or removed from thread hash table multiple times. >> >> Modified: >> head/sys/kern/kern_thread.c >> head/sys/sys/proc.h >> >> Modified: head/sys/kern/kern_thread.c >> ============================================================================== >> --- head/sys/kern/kern_thread.c Mon Oct 11 23:24:57 2010 (r213713) > > Is this the same problem? > > panic: Bad link elm 0xc767e870 next->prev != elm > on r213828. > > http://people.freebsd.org/~pho/stress/log/leopard3.002.txt > > - Peter > Thanks for testing, can you try this patch ? http://people.freebsd.org/~davidxu/tidhash/tidhash4.diff From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 05:17:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7988E1065670; Fri, 15 Oct 2010 05:17:48 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65A3B8FC08; Fri, 15 Oct 2010 05:17:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9F5HmKO049979; Fri, 15 Oct 2010 05:17:48 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9F5Hmo4049975; Fri, 15 Oct 2010 05:17:48 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201010150517.o9F5Hmo4049975@svn.freebsd.org> From: Edwin Groothuis Date: Fri, 15 Oct 2010 05:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213889 - stable/8/usr.bin/ncal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 05:17:48 -0000 Author: edwin Date: Fri Oct 15 05:17:48 2010 New Revision: 213889 URL: http://svn.freebsd.org/changeset/base/213889 Log: MFC of r204697 r204706 r204849 r204908 r205071 r205427 r212032 r212032: Use basename(3) to determine the name of the program. Submitted by: Alexander Best r205427: Replace -b with -C and -B (as proposed by Alexander). Add -3, -A and -B to the usage. Update regression test for the new parameters. r205071: - With the introduction of -A, -B and -3, not all combinations of arguments makes sense anymore. For example, what would a combination of -3 (show three months) and -y (show the whole year) do? We will abort on these cases. - Move the debug option -d to -H (from highlight), while -d is now used for setting the day of "today" so that -y and friends can be tested. r204908: - Fix the highlighting for non-terminals when the last week is not 7 days long. - "-m " now prints only the month, not the whole year. r204849: - document the -3, -A and -B properly in Synopsis. - add highlight of current date for non-terminals. - fix -J option. - code cleanup. r204706: Remove no-op of WARNS?= Submitted by: Ulrich Sp??rlein r204697: - Implement -3 option (show previous, this and next month) option. - Add -A option (months after this month). - Add -B option (months before this month). - Fix highlighting of today in year overview. - Fix aligning of "foreign" characters. Modified: stable/8/usr.bin/ncal/Makefile stable/8/usr.bin/ncal/ncal.1 stable/8/usr.bin/ncal/ncal.c Directory Properties: stable/8/usr.bin/ncal/ (props changed) Modified: stable/8/usr.bin/ncal/Makefile ============================================================================== --- stable/8/usr.bin/ncal/Makefile Fri Oct 15 04:02:07 2010 (r213888) +++ stable/8/usr.bin/ncal/Makefile Fri Oct 15 05:17:48 2010 (r213889) @@ -4,7 +4,6 @@ PROG= ncal DPADD= ${LIBCALENDAR} ${LIBTERMCAP} LDADD= -lcalendar -ltermcap -WARNS?= 1 LINKS= ${BINDIR}/ncal ${BINDIR}/cal MLINKS= ncal.1 cal.1 Modified: stable/8/usr.bin/ncal/ncal.1 ============================================================================== --- stable/8/usr.bin/ncal/ncal.1 Fri Oct 15 04:02:07 2010 (r213888) +++ stable/8/usr.bin/ncal/ncal.1 Fri Oct 15 05:17:48 2010 (r213889) @@ -33,25 +33,37 @@ .Nd displays a calendar and the date of Easter .Sh SYNOPSIS .Nm -.Op Fl hjy +.Op Fl 3hjy +.Op Fl A Ar number +.Op Fl B Ar number .Oo .Op Ar month .Ar year .Oc .Nm -.Op Fl hj +.Op Fl 3hj +.Op Fl A Ar number +.Op Fl B Ar number .Fl m Ar month .Op Ar year .Nm ncal -.Op Fl hjJpwy +.Op Fl 3hjJpwy +.Op Fl A Ar number +.Op Fl B Ar number .Op Fl s Ar country_code .Oo .Op Ar month .Ar year .Oc .Nm ncal -.Op Fl hJeo +.Op Fl 3hJeo +.Op Fl A Ar number +.Op Fl B Ar number .Op Ar year +.Nm ncal +.Op Fl CN +.Op Fl H Ar yyyy-mm-dd +.Op Fl d Ar yyyy-mm .Sh DESCRIPTION The .Nm @@ -109,6 +121,32 @@ Britain and her colonies switched to the Print the number of the week below each week column. .It Fl y Display a calendar for the specified year. +.It Fl 3 +Display the previous, current and next month surrounding today. +.It Fl A Ar number +Display the +.Ar number +of months after the current month. +.It Fl B Ar number +Display the +.Ar number +of months before the current month. +.It Fl C +Switch to +.Nm cal +mode. +.It Fl N +Switch to +.Nm ncal +mode. +.It Fl d Ar yyyy-mm +Use +.Ar yyyy-mm +as the current date (for debugging of date selection). +.It Fl H Ar yyyy-mm-dd +Use +.Ar yyyy-mm-dd +as the current date (for debugging of highlighting). .El .Pp A single parameter specifies the year (1\(en9999) to be displayed; @@ -116,12 +154,21 @@ note the year must be fully specified: .Dq Li cal 89 will .Em not -display a calendar for 1989. -Two parameters denote the month and year; the month is either a number between -1 and 12, or a full or abbreviated name as specified by the current locale. -Month and year default to those of the current system clock and time zone (so +display a calendar for 1989. Two parameters denote the month and +year; the month is either a number between 1 and 12, or a full or +abbreviated name as specified by the current locale. Month and +year default to those of the current system clock and time zone (so .Dq Li cal -m 8 -will display a calendar for the month of August in the current year). +will display a calendar for the month of August in the current +year). +.Pp +Not all options can be used together. For example +.Dq Li -3 -A 2 -B 3 -y -m 7 +would mean: +show me the three months around the seventh month, three before +that, two after that and the whole year. +.Nm ncal +will warn about these combinations. .Pp A year starts on January 1. .Sh SEE ALSO @@ -142,5 +189,8 @@ The command and manual were written by .An Wolfgang Helbig Aq helbig@FreeBSD.org . .Sh BUGS -The assignment of Julian\(enGregorian switching dates to -country codes is historically naive for many countries. +The assignment of Julian\(enGregorian switching dates to country +codes is historically naive for many countries. +.Pp +Not all options are compatible and using them in different orders +will give varying results. Modified: stable/8/usr.bin/ncal/ncal.c ============================================================================== --- stable/8/usr.bin/ncal/ncal.c Fri Oct 15 04:02:07 2010 (r213888) +++ stable/8/usr.bin/ncal/ncal.c Fri Oct 15 05:17:48 2010 (r213889) @@ -33,6 +33,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -45,12 +46,12 @@ static const char rcsid[] = #include #undef lines /* term.h defines this */ -/* Width of one month with backward compatibility */ +/* Width of one month with backward compatibility and in regular mode*/ #define MONTH_WIDTH_B_J 27 #define MONTH_WIDTH_B 20 -#define MONTH_WIDTH_J 24 -#define MONTH_WIDTH 18 +#define MONTH_WIDTH_R_J 24 +#define MONTH_WIDTH_R 18 #define MAX_WIDTH 64 @@ -60,6 +61,7 @@ struct monthlines { wchar_t name[MAX_WIDTH + 1]; char lines[7][MAX_WIDTH + 1]; char weeks[MAX_WIDTH + 1]; + unsigned int extralen[7]; }; struct weekdays { @@ -158,31 +160,29 @@ char jdaystr[] = " 1 2 3 4 " 350 351 352 353 354 355 356 357 358 359" " 360 361 362 363 364 365 366"; +int flag_nohighlight; /* user doesn't want a highlighted today */ int flag_weeks; /* user wants number of week */ int nswitch; /* user defined switch date */ int nswitchb; /* switch date for backward compatibility */ -const char *term_so, *term_se; -int today; +int highlightdate; -char *center(char *s, char *t, int w); +char *center(char *s, char *t, int w); wchar_t *wcenter(wchar_t *s, wchar_t *t, int w); -void mkmonth(int year, int month, int jd_flag, struct monthlines * monthl); -void mkmonthb(int year, int month, int jd_flag, struct monthlines * monthl); -void mkweekdays(struct weekdays * wds); -int parsemonth(const char *s, int *m, int *y); -void printcc(void); -void printeaster(int year, int julian, int orthodox); -void printmonth(int year, int month, int jd_flag); -void printmonthb(int year, int month, int jd_flag); -void printyear(int year, int jd_flag); -void printyearb(int year, int jd_flag); int firstday(int y, int m); -date *sdate(int ndays, struct date * d); -date *sdateb(int ndays, struct date * d); -int sndays(struct date * d); -int sndaysb(struct date * d); -static void usage(void); -int weekdayb(int nd); +void highlight(char *dst, char *src, int len, int *extraletters); +void mkmonthr(int year, int month, int jd_flag, struct monthlines * monthl); +void mkmonthb(int year, int month, int jd_flag, struct monthlines * monthl); +void mkweekdays(struct weekdays * wds); +void monthranger(int year, int m, int jd_flag, int before, int after); +void monthrangeb(int year, int m, int jd_flag, int before, int after); +int parsemonth(const char *s, int *m, int *y); +void printcc(void); +void printeaster(int year, int julian, int orthodox); +date *sdater(int ndays, struct date * d); +date *sdateb(int ndays, struct date * d); +int sndaysr(struct date * d); +int sndaysb(struct date * d); +static void usage(void); int main(int argc, char *argv[]) @@ -190,39 +190,31 @@ main(int argc, char *argv[]) struct djswitch *p, *q; /* to search user defined switch date */ date never = {10000, 1, 1}; /* outside valid range of dates */ date ukswitch = {1752, 9, 2};/* switch date for Great Britain */ + date dt; int ch; /* holds the option character */ int m = 0; /* month */ int y = 0; /* year */ int flag_backward = 0; /* user called cal--backward compat. */ - int flag_hole_year = 0; /* user wants the whole year */ + int flag_wholeyear = 0; /* user wants the whole year */ int flag_julian_cal = 0; /* user wants Julian Calendar */ - int flag_julian_day = 0; /* user wants the Julian day - * numbers */ - int flag_orthodox = 0; /* use wants Orthodox easter */ - int flag_easter = 0; /* use wants easter date */ + int flag_julian_day = 0; /* user wants the Julian day numbers */ + int flag_orthodox = 0; /* user wants Orthodox easter */ + int flag_easter = 0; /* user wants easter date */ + int flag_3months = 0; /* user wants 3 month display (-3) */ + int flag_after = 0; /* user wants to see months after */ + int flag_before = 0; /* user wants to see months before */ + int flag_specifiedmonth = 0;/* user wants to see this month (-m) */ + int flag_givenmonth = 0; /* user has specified month [n] */ + int flag_givenyear = 0; /* user has specified year [n] */ char *cp; /* character pointer */ + char *flag_today = NULL; /* debug: use date as being today */ char *flag_month = NULL; /* requested month as string */ + char *flag_highlightdate = NULL; /* debug: date to highlight */ + int before, after; const char *locale; /* locale to get country code */ - char tbuf[1024], cbuf[512], *b; - time_t t; - struct tm *tm1; - - term_se = term_so = NULL; - today = 0; - if (isatty(STDOUT_FILENO) && tgetent(tbuf, NULL) == 1) { - date dt; /* handy date */ - - b = cbuf; - term_so = tgetstr("so", &b); - term_se = tgetstr("se", &b); - t = time(NULL); - tm1 = localtime(&t); - dt.y = tm1->tm_year + 1900; - dt.m = tm1->tm_mon + 1; - dt.d = tm1->tm_mday; - today = sndaysb(&dt); - } + flag_nohighlight = 0; + flag_weeks = 0; /* * Use locale to determine the country code, @@ -254,25 +246,56 @@ main(int argc, char *argv[]) * Get the filename portion of argv[0] and set flag_backward if * this program is called "cal". */ - cp = strrchr(argv[0], '/'); - cp = (cp == NULL) ? argv[0] : cp + 1; - if (strcmp("cal", cp) == 0) + if (strncmp(basename(argv[0]), "cal", strlen("cal")) == 0) flag_backward = 1; /* Set the switch date to United Kingdom if backwards compatible */ if (flag_backward) nswitchb = ndaysj(&ukswitch); - while ((ch = getopt(argc, argv, "Jehjm:ops:wy")) != -1) + before = after = -1; + + while ((ch = getopt(argc, argv, "3A:B:Cd:eH:hjJm:Nops:wy")) != -1) switch (ch) { + case '3': + flag_3months = 1; + break; + case 'A': + if (flag_after > 0) + errx(EX_USAGE, "Double -A specified"); + flag_after = strtol(optarg, NULL, 10); + if (flag_after <= 0) + errx(EX_USAGE, + "Argument to -A must be positive"); + break; + case 'B': + if (flag_before > 0) + errx(EX_USAGE, "Double -A specified"); + flag_before = strtol(optarg, NULL, 10); + if (flag_before <= 0) + errx(EX_USAGE, + "Argument to -B must be positive"); + break; case 'J': if (flag_backward) usage(); nswitch = ndaysj(&never); flag_julian_cal = 1; break; + case 'C': + flag_backward = 1; + break; + case 'N': + flag_backward = 0; + break; + case 'd': + flag_today = optarg; + break; + case 'H': + flag_highlightdate = optarg; + break; case 'h': - term_so = term_se = NULL; + flag_nohighlight = 1; break; case 'e': if (flag_backward) @@ -283,7 +306,10 @@ main(int argc, char *argv[]) flag_julian_day = 1; break; case 'm': + if (flag_specifiedmonth) + errx(EX_USAGE, "Double -m specified"); flag_month = optarg; + flag_specifiedmonth = 1; break; case 'o': if (flag_backward) @@ -316,7 +342,7 @@ main(int argc, char *argv[]) flag_weeks = 1; break; case 'y': - flag_hole_year = 1; + flag_wholeyear = 1; break; default: usage(); @@ -330,14 +356,21 @@ main(int argc, char *argv[]) if (flag_easter) usage(); flag_month = *argv++; + flag_givenmonth = 1; + m = strtol(flag_month, NULL, 10); /* FALLTHROUGH */ case 1: - y = atoi(*argv++); + y = atoi(*argv); if (y < 1 || y > 9999) - errx(EX_USAGE, "year %d not in range 1..9999", y); + errx(EX_USAGE, "year `%s' not in range 1..9999", *argv); + argv++; + flag_givenyear = 1; break; case 0: - { + if (flag_today != NULL) { + y = strtol(flag_today, NULL, 10); + m = strtol(flag_today + 5, NULL, 10); + } else { time_t t; struct tm *tm; @@ -359,21 +392,108 @@ main(int argc, char *argv[]) } } + /* + * What is not supported: + * -3 with -A or -B + * -3 displays 3 months, -A and -B change that behaviour. + * -3 with -y + * -3 displays 3 months, -y says display a whole year. + * -3 with a given year but no given month or without -m + * -3 displays 3 months, no month specified doesn't make clear + * which three months. + * -m with a given month + * conflicting arguments, both specify the same field. + * -y with -m + * -y displays the whole year, -m displays a single month. + * -y with a given month + * -y displays the whole year, the given month displays a single + * month. + * -y with -A or -B + * -y displays the whole year, -A and -B display extra months. + */ + + /* -3 together with -A or -B. */ + if (flag_3months && (flag_after || flag_before)) + errx(EX_USAGE, "-3 together with -A and -B is not supported."); + /* -3 together with -y. */ + if (flag_3months && flag_wholeyear) + errx(EX_USAGE, "-3 together with -y is not supported."); + /* -3 together with givenyear but no givenmonth. */ + if (flag_3months && flag_givenyear && + !(flag_givenmonth || flag_specifiedmonth)) + errx(EX_USAGE, + "-3 together with a given year but no given month is " + "not supported."); + /* -m together with xx xxxx. */ + if (flag_specifiedmonth && flag_givenmonth) + errx(EX_USAGE, + "-m together with a given month is not supported."); + /* -y together with -m. */ + if (flag_wholeyear && flag_specifiedmonth) + errx(EX_USAGE, "-y together with -m is not supported."); + /* -y together with xx xxxx. */ + if (flag_wholeyear && flag_givenmonth) + errx(EX_USAGE, "-y together a given month is not supported."); + /* -y together with -A or -B. */ + if (flag_wholeyear && (flag_before > 0 || flag_after > 0)) + errx(EX_USAGE, "-y together a -A or -B is not supported."); + /* The rest should be fine. */ + + /* Select the period to display, in order of increasing priority .*/ + if (flag_wholeyear || + (flag_givenyear && !(flag_givenmonth || flag_specifiedmonth))) { + m = 1; + before = 0; + after = 11; + } + if (flag_givenyear && flag_givenmonth) { + before = 0; + after = 0; + } + if (flag_specifiedmonth) { + before = 0; + after = 0; + } + if (flag_before) { + before = flag_before; + } + if (flag_after) { + after = flag_after; + } + if (flag_3months) { + before = 1; + after = 1; + } + if (after == -1) + after = 0; + if (before == -1) + before = 0; + + /* Highlight a specified day or today .*/ + if (flag_highlightdate != NULL) { + dt.y = strtol(flag_highlightdate, NULL, 10); + dt.m = strtol(flag_highlightdate + 5, NULL, 10); + dt.d = strtol(flag_highlightdate + 8, NULL, 10); + } else { + time_t t; + struct tm *tm1; + + t = time(NULL); + tm1 = localtime(&t); + dt.y = tm1->tm_year + 1900; + dt.m = tm1->tm_mon + 1; + dt.d = tm1->tm_mday; + } + highlightdate = sndaysb(&dt); + + /* And now we finally start to calculate and output calendars. */ if (flag_easter) printeaster(y, flag_julian_cal, flag_orthodox); - else if (argc == 1 || flag_hole_year) { - /* disable the highlight for now */ - today = 0; - if (flag_backward) - printyearb(y, flag_julian_day); - else - printyear(y, flag_julian_day); - } else + else if (flag_backward) - printmonthb(y, m, flag_julian_day); + monthrangeb(y, m, flag_julian_day, before, after); else - printmonth(y, m, flag_julian_day); - + monthranger(y, m, flag_julian_day, before, after); return (0); } @@ -382,14 +502,17 @@ usage(void) { fputs( - "usage: cal [-hjy] [[month] year]\n" - " cal [-hj] [-m month] [year]\n" - " ncal [-hJjpwy] [-s country_code] [[month] year]\n" - " ncal [-hJeo] [year]\n", stderr); +"Usage: cal [general options] [-hjy] [[month] year]\n" +" cal [general options] [-hj] [-m month] [year]\n" +" ncal [general options] [-hJjpwy] [-s country_code] [[month] year]\n" +" ncal [general options] [-hJeo] [year]\n" +"General options: [-NC3] [-A months] [-B months]\n" +"For debug the highlighting: [-H yyyy-mm-dd] [-d yyyy-mm]\n", + stderr); exit(EX_USAGE); } -/* print the assumed switches for all countries */ +/* Print the assumed switches for all countries. */ void printcc(void) { @@ -410,13 +533,13 @@ printcc(void) printf(FSTR"\n", FSTRARG(p)); } -/* print the date of easter sunday */ +/* Print the date of easter sunday. */ void printeaster(int y, int julian, int orthodox) { date dt; struct tm tm; - char buf[80]; + char buf[MAX_WIDTH]; static int d_first = -1; if (d_first < 0) @@ -441,183 +564,201 @@ printeaster(int y, int julian, int ortho printf("%s\n", buf); } -void -printmonth(int y, int m, int jd_flag) -{ - struct monthlines month; - struct weekdays wds; - int i, len; - - mkmonth(y, m - 1, jd_flag, &month); - mkweekdays(&wds); - printf(" %ls %d\n", month.name, y); - for (i = 0; i != 7; i++) { - len = wcslen(wds.names[i]); - if (wcswidth(wds.names[i], len) == len) - wprintf(L"%.2ls%s\n", wds.names[i], month.lines[i]); - else - wprintf(L"%.1ls%s\n", wds.names[i], month.lines[i]); - } - if (flag_weeks) - printf(" %s\n", month.weeks); -} +#define MW(mw, me) ((mw) + me) +#define DECREASEMONTH(m, y) \ + if (--m == 0) { \ + m = 12; \ + y--; \ + } +#define INCREASEMONTH(m, y) \ + if (++(m) == 13) { \ + (m) = 1; \ + (y)++; \ + } +#define M2Y(m) ((m) / 12) +#define M2M(m) (1 + (m) % 12) +/* Print all months for the period in the range [ before .. y-m .. after ]. */ void -printmonthb(int y, int m, int jd_flag) +monthrangeb(int y, int m, int jd_flag, int before, int after) { - struct monthlines month; + struct monthlines year[12]; struct weekdays wds; - wchar_t s[MAX_WIDTH], t[MAX_WIDTH]; - int i; - int mw; - - mkmonthb(y, m - 1, jd_flag, &month); - mkweekdays(&wds); + char s[MAX_WIDTH], t[MAX_WIDTH]; + wchar_t ws[MAX_WIDTH], ws1[MAX_WIDTH]; + const char *wdss; + int i, j; + int mpl; + int mw; + int m1, m2; + int printyearheader; + int prevyear = -1; + mpl = jd_flag ? 2 : 3; mw = jd_flag ? MONTH_WIDTH_B_J : MONTH_WIDTH_B; + wdss = (mpl == 2) ? " " : ""; - swprintf(s, MAX_WIDTH, L"%ls %d", month.name, y); - wprintf(L"%ls\n", wcenter(t, s, mw)); + while (before != 0) { + DECREASEMONTH(m, y); + before--; + after++; + } + m1 = y * 12 + m - 1; + m2 = m1 + after; - if (jd_flag) - wprintf(L" %ls %ls %ls %ls %ls %ls %.2ls\n", - wds.names[6], wds.names[0], - wds.names[1], wds.names[2], wds.names[3], - wds.names[4], wds.names[5]); - else - wprintf(L"%ls%ls%ls%ls%ls%ls%.2ls\n", wds.names[6], - wds.names[0], wds.names[1], wds.names[2], wds.names[3], - wds.names[4], wds.names[5]); + mkweekdays(&wds); - for (i = 0; i != 6; i++) - printf("%s\n", month.lines[i]+1); -} + /* + * The year header is printed when there are more than 'mpl' months + * and if the first month is a multitude of 'mpl'. + * If not, it will print the year behind every month. + */ + printyearheader = (after >= mpl - 1) && (M2M(m1) - 1) % mpl == 0; -void -printyear(int y, int jd_flag) -{ - struct monthlines year[12]; - struct weekdays wds; - char s[80], t[80]; - int i, j; - int mpl; - int mw; + m = m1; + while (m <= m2) { + int count = 0; + for (i = 0; i != mpl && m + i <= m2; i++) { + mkmonthb(M2Y(m + i), M2M(m + i) - 1, jd_flag, year + i); + count++; + } - for (i = 0; i != 12; i++) - mkmonth(y, i, jd_flag, year + i); - mkweekdays(&wds); - mpl = jd_flag ? 3 : 4; - mw = jd_flag ? MONTH_WIDTH_J : MONTH_WIDTH; + /* Empty line between two rows of months */ + if (m != m1) + printf("\n"); + + /* Year at the top. */ + if (printyearheader && M2Y(m) != prevyear) { + sprintf(s, "%d", M2Y(m)); + printf("%s\n", center(t, s, mpl * mw)); + prevyear = M2Y(m); + } - sprintf(s, "%d", y); - printf("%s\n", center(t, s, mpl * mw)); + /* Month names. */ + for (i = 0; i < count; i++) + if (printyearheader) + wprintf(L"%-*ls ", + mw, wcenter(ws, year[i].name, mw)); + else { + swprintf(ws, sizeof(ws), L"%-ls %d", + year[i].name, M2Y(m + i)); + wprintf(L"%-*ls ", mw, wcenter(ws1, ws, mw)); + } + printf("\n"); - for (j = 0; j != 12; j += mpl) { - wprintf(L" %-*ls%-*ls", - mw, year[j].name, - mw, year[j + 1].name); - if (mpl == 3) - printf("%ls\n", year[j + 2].name); - else - wprintf(L"%-*ls%ls\n", - mw, year[j + 2].name, - year[j + 3].name); - for (i = 0; i != 7; i++) { - wprintf(L"%.2ls%-*s%-*s", - wds.names[i], - mw, year[j].lines[i], - mw, year[j + 1].lines[i]); - if (mpl == 3) - printf("%s\n", year[j + 2].lines[i]); - else - printf("%-*s%s\n", - mw, year[j + 2].lines[i], - year[j + 3].lines[i]); + /* Day of the week names. */ + for (i = 0; i < count; i++) { + wprintf(L"%s%ls%s%ls%s%ls%s%ls%s%ls%s%ls%s%ls ", + wdss, wds.names[6], wdss, wds.names[0], + wdss, wds.names[1], wdss, wds.names[2], + wdss, wds.names[3], wdss, wds.names[4], + wdss, wds.names[5]); } - if (flag_weeks) { - if (mpl == 3) - printf(" %-*s%-*s%-s\n", - mw, year[j].weeks, - mw, year[j + 1].weeks, - year[j + 2].weeks); - else - printf(" %-*s%-*s%-*s%-s\n", - mw, year[j].weeks, - mw, year[j + 1].weeks, - mw, year[j + 2].weeks, - year[j + 3].weeks); + printf("\n"); + + /* And the days of the month. */ + for (i = 0; i != 6; i++) { + for (j = 0; j < count; j++) + printf("%-*s ", + MW(mw, year[j].extralen[i]), + year[j].lines[i]+1); + printf("\n"); } + + m += mpl; } } void -printyearb(int y, int jd_flag) +monthranger(int y, int m, int jd_flag, int before, int after) { struct monthlines year[12]; struct weekdays wds; - char s[80], t[80]; - wchar_t ws[80], wt[80]; + char s[MAX_WIDTH], t[MAX_WIDTH]; int i, j; int mpl; int mw; + int m1, m2; + int prevyear = -1; + int printyearheader; + + mpl = jd_flag ? 3 : 4; + mw = jd_flag ? MONTH_WIDTH_R_J : MONTH_WIDTH_R; + + while (before != 0) { + DECREASEMONTH(m, y); + before--; + after++; + } + m1 = y * 12 + m - 1; + m2 = m1 + after; - for (i = 0; i != 12; i++) - mkmonthb(y, i, jd_flag, year + i); mkweekdays(&wds); - mpl = jd_flag ? 2 : 3; - mw = jd_flag ? MONTH_WIDTH_B_J : MONTH_WIDTH_B; - sprintf(s, "%d", y); - printf("%s\n\n", center(t, s, mw * mpl + mpl)); + /* + * The year header is printed when there are more than 'mpl' months + * and if the first month is a multitude of 'mpl'. + * If not, it will print the year behind every month. + */ + printyearheader = (after >= mpl - 1) && (M2M(m1) - 1) % mpl == 0; - for (j = 0; j != 12; j += mpl) { - wprintf(L"%-*ls ", mw, wcenter(ws, year[j].name, mw)); - if (mpl == 2) - printf("%ls\n", wcenter(ws, year[j + 1].name, mw)); - else - wprintf(L"%-*ls %ls\n", mw, - wcenter(ws, year[j + 1].name, mw), - wcenter(wt, year[j + 2].name, mw)); - - if (mpl == 2) - wprintf(L" %ls %ls %ls %ls %ls %ls %ls " - " %ls %ls %ls %ls %ls %ls %.2ls\n", - wds.names[6], wds.names[0], wds.names[1], - wds.names[2], wds.names[3], wds.names[4], - wds.names[5], - wds.names[6], wds.names[0], wds.names[1], - wds.names[2], wds.names[3], wds.names[4], - wds.names[5]); - else - wprintf(L"%ls%ls%ls%ls%ls%ls%ls " - "%ls%ls%ls%ls%ls%ls%ls " - "%ls%ls%ls%ls%ls%ls%.2ls\n", - wds.names[6], wds.names[0], wds.names[1], - wds.names[2], wds.names[3], wds.names[4], - wds.names[5], - wds.names[6], wds.names[0], wds.names[1], - wds.names[2], wds.names[3], wds.names[4], - wds.names[5], - wds.names[6], wds.names[0], wds.names[1], - wds.names[2], wds.names[3], wds.names[4], - wds.names[5]); - for (i = 0; i != 6; i++) { - if (mpl == 2) - printf("%-*s %s\n", - mw, year[j].lines[i]+1, - year[j + 1].lines[i]+1); + m = m1; + while (m <= m2) { + int count = 0; + for (i = 0; i != mpl && m + i <= m2; i++) { + mkmonthr(M2Y(m + i), M2M(m + i) - 1, jd_flag, year + i); + count++; + } + + /* Empty line between two rows of months. */ + if (m != m1) + printf("\n"); + + /* Year at the top. */ + if (printyearheader && M2Y(m) != prevyear) { + sprintf(s, "%d", M2Y(m)); + printf("%s\n", center(t, s, mpl * mw)); + prevyear = M2Y(m); + } + + /* Month names. */ + wprintf(L" "); + for (i = 0; i < count; i++) + if (printyearheader) + wprintf(L"%-*ls", mw, year[i].name); else - printf("%-*s %-*s %s\n", - mw, year[j].lines[i]+1, - mw, year[j + 1].lines[i]+1, - year[j + 2].lines[i]+1); + wprintf(L"%-ls %-*d", year[i].name, + mw - wcslen(year[i].name) - 1, M2Y(m + i)); + printf("\n"); + + /* And the days of the month. */ + for (i = 0; i != 7; i++) { + /* Week day */ + wprintf(L"%.2ls", wds.names[i]); + + /* Full months */ + for (j = 0; j < count; j++) + printf("%-*s", + MW(mw, year[j].extralen[i]), + year[j].lines[i]); + printf("\n"); + } + /* Week numbers. */ + if (flag_weeks) { + printf(" "); + for (i = 0; i < count; i++) + printf("%-*s", mw, year[i].weeks); + printf("\n"); } + + m += mpl; } + return; } void -mkmonth(int y, int m, int jd_flag, struct monthlines *mlines) +mkmonthr(int y, int m, int jd_flag, struct monthlines *mlines) { struct tm tm; /* for strftime printing local names of @@ -659,7 +800,7 @@ mkmonth(int y, int m, int jd_flag, struc */ firstm = first - weekday(first); - /* Set ds (daystring) and dw (daywidth) according to the jd_flag */ + /* Set ds (daystring) and dw (daywidth) according to the jd_flag. */ if (jd_flag) { ds = jdaystr; dw = 4; @@ -676,40 +817,25 @@ mkmonth(int y, int m, int jd_flag, struc for (i = 0; i != 7; i++) { l = 0; for (j = firstm + i, k = 0; j < last; j += 7, k += dw) { - if (j == today && (term_so != NULL && term_se != NULL)) { - l = strlen(term_so); - if (jd_flag) - dt.d = j - jan1 + 1; - else - sdateb(j, &dt); - /* separator */ - mlines->lines[i][k] = ' '; - /* the actual text */ - memcpy(mlines->lines[i] + k + l, - ds + dt.d * dw, dw); - /* highlight on */ - memcpy(mlines->lines[i] + k + 1, term_so, l); - /* highlight off */ - memcpy(mlines->lines[i] + k + l + dw, term_se, - strlen(term_se)); - l = strlen(term_se) + strlen(term_so); - continue; - } if (j >= first) { if (jd_flag) dt.d = j - jan1 + 1; else - sdate(j, &dt); - memcpy(mlines->lines[i] + k + l, - ds + dt.d * dw, dw); + sdater(j, &dt); + if (j == highlightdate && !flag_nohighlight) + highlight(mlines->lines[i] + k, + ds + dt.d * dw, dw, &l); + else + memcpy(mlines->lines[i] + k + l, + ds + dt.d * dw, dw); } else memcpy(mlines->lines[i] + k + l, " ", dw); } mlines->lines[i][k + l] = '\0'; - + mlines->extralen[i] = l; } - /* fill the weeknumbers */ + /* fill the weeknumbers. */ if (flag_weeks) { for (j = firstm, k = 0; j < last; k += dw, j += 7) if (j <= nswitch) @@ -746,7 +872,7 @@ mkmonthb(int y, int m, int jd_flag, stru dw = 3; } - /* Set name of month centered */ + /* Set name of month centered. */ memset(&tm, 0, sizeof(tm)); tm.tm_mon = m; wcsftime(mlines->name, sizeof(mlines->name) / sizeof(mlines->name[0]), @@ -795,32 +921,17 @@ mkmonthb(int y, int m, int jd_flag, stru l = 0; for (j = firsts + 7 * i, k = 0; j < last && k != dw * 7; j++, k += dw) { - if (j == today && (term_so != NULL && term_se != NULL)) { - l = strlen(term_so); - if (jd_flag) - dt.d = j - jan1 + 1; - else - sdateb(j, &dt); - /* separator */ - mlines->lines[i][k] = ' '; - /* the actual text */ - memcpy(mlines->lines[i] + k + l, - ds + dt.d * dw, dw); - /* highlight on */ - memcpy(mlines->lines[i] + k + 1, term_so, l); - /* highlight off */ - memcpy(mlines->lines[i] + k + l + dw, term_se, - strlen(term_se)); - l = strlen(term_se) + strlen(term_so); - continue; - } if (j >= first) { if (jd_flag) dt.d = j - jan1 + 1; else sdateb(j, &dt); - memcpy(mlines->lines[i] + k + l, - ds + dt.d * dw, dw); + if (j == highlightdate && !flag_nohighlight) + highlight(mlines->lines[i] + k, + ds + dt.d * dw, dw, &l); + else + memcpy(mlines->lines[i] + k + l, + ds + dt.d * dw, dw); } else memcpy(mlines->lines[i] + k + l, " ", dw); } @@ -828,10 +939,11 @@ mkmonthb(int y, int m, int jd_flag, stru mlines->lines[i][1] = '\0'; else mlines->lines[i][k + l] = '\0'; + mlines->extralen[i] = l; } } -/* Put the local names of weekdays into the wds */ +/* Put the local names of weekdays into the wds. */ void mkweekdays(struct weekdays *wds) { @@ -857,9 +969,8 @@ mkweekdays(struct weekdays *wds) } /* - * Compute the day number of the first - * existing date after the first day in month. - * (the first day in month and even the month might not exist!) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 05:42:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 330A8106564A; Fri, 15 Oct 2010 05:42:36 +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 2075C8FC19; Fri, 15 Oct 2010 05:42:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9F5gaNH050687; Fri, 15 Oct 2010 05:42:36 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9F5gZe1050685; Fri, 15 Oct 2010 05:42:35 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201010150542.o9F5gZe1050685@svn.freebsd.org> From: Alan Cox Date: Fri, 15 Oct 2010 05:42: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: r213890 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 05:42:36 -0000 Author: alc Date: Fri Oct 15 05:42:35 2010 New Revision: 213890 URL: http://svn.freebsd.org/changeset/base/213890 Log: MFC r209605 Improve bufdone_finish()'s handling of the bogus page. Specifically, if one or more mappings to the bogus page must be replaced, call pmap_qenter() just once. Previously, pmap_qenter() was called for each mapping to the bogus page. MFC r209902 Change the implementation of vm_hold_free_pages() so that it performs at most one call to pmap_qremove(), and thus one TLB shootdown, instead of one call and TLB shootdown per page. Simplify the interface to vm_hold_free_pages(). Modified: stable/8/sys/kern/vfs_bio.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/vfs_bio.c ============================================================================== --- stable/8/sys/kern/vfs_bio.c Fri Oct 15 05:17:48 2010 (r213889) +++ stable/8/sys/kern/vfs_bio.c Fri Oct 15 05:42:35 2010 (r213890) @@ -95,8 +95,7 @@ struct buf *buf; /* buffer header pool static struct proc *bufdaemonproc; static int inmem(struct vnode *vp, daddr_t blkno); -static void vm_hold_free_pages(struct buf *bp, vm_offset_t from, - vm_offset_t to); +static void vm_hold_free_pages(struct buf *bp, int newbsize); static void vm_hold_load_pages(struct buf *bp, vm_offset_t from, vm_offset_t to); static void vfs_page_set_valid(struct buf *bp, vm_ooffset_t off, vm_page_t m); @@ -2919,10 +2918,7 @@ allocbuf(struct buf *bp, int size) } return 1; } - vm_hold_free_pages( - bp, - (vm_offset_t) bp->b_data + newbsize, - (vm_offset_t) bp->b_data + bp->b_bufsize); + vm_hold_free_pages(bp, newbsize); } else if (newbsize > bp->b_bufsize) { /* * We only use malloced memory on the first allocation. @@ -3358,7 +3354,7 @@ bufdone_finish(struct buf *bp) vm_ooffset_t foff; vm_page_t m; vm_object_t obj; - int iosize; + int bogus, iosize; struct vnode *vp = bp->b_vp; obj = bp->b_bufobj->bo_object; @@ -3396,6 +3392,7 @@ bufdone_finish(struct buf *bp) !(bp->b_ioflags & BIO_ERROR)) { bp->b_flags |= B_CACHE; } + bogus = 0; for (i = 0; i < bp->b_npages; i++) { int bogusflag = 0; int resid; @@ -3409,13 +3406,11 @@ bufdone_finish(struct buf *bp) */ m = bp->b_pages[i]; if (m == bogus_page) { - bogusflag = 1; + bogus = bogusflag = 1; m = vm_page_lookup(obj, OFF_TO_IDX(foff)); if (m == NULL) panic("biodone: page disappeared!"); bp->b_pages[i] = m; - pmap_qenter(trunc_page((vm_offset_t)bp->b_data), - bp->b_pages, bp->b_npages); } #if defined(VFS_BIO_DEBUG) if (OFF_TO_IDX(foff) != m->pindex) { @@ -3469,6 +3464,9 @@ bufdone_finish(struct buf *bp) } vm_object_pip_wakeupn(obj, 0); VM_OBJECT_UNLOCK(obj); + if (bogus) + pmap_qenter(trunc_page((vm_offset_t)bp->b_data), + bp->b_pages, bp->b_npages); } /* @@ -3831,31 +3829,25 @@ tryagain: /* Return pages associated with this buf to the vm system */ static void -vm_hold_free_pages(struct buf *bp, vm_offset_t from, vm_offset_t to) +vm_hold_free_pages(struct buf *bp, int newbsize) { - vm_offset_t pg; + vm_offset_t from; vm_page_t p; int index, newnpages; - from = round_page(from); - to = round_page(to); - newnpages = index = (from - trunc_page((vm_offset_t)bp->b_data)) >> PAGE_SHIFT; - - for (pg = from; pg < to; pg += PAGE_SIZE, index++) { + from = round_page((vm_offset_t)bp->b_data + newbsize); + newnpages = (from - trunc_page((vm_offset_t)bp->b_data)) >> PAGE_SHIFT; + if (bp->b_npages > newnpages) + pmap_qremove(from, bp->b_npages - newnpages); + for (index = newnpages; index < bp->b_npages; index++) { p = bp->b_pages[index]; - if (p && (index < bp->b_npages)) { - if (p->busy) { - printf( - "vm_hold_free_pages: blkno: %jd, lblkno: %jd\n", - (intmax_t)bp->b_blkno, - (intmax_t)bp->b_lblkno); - } - bp->b_pages[index] = NULL; - pmap_qremove(pg, 1); - p->wire_count--; - vm_page_free(p); - atomic_subtract_int(&cnt.v_wire_count, 1); - } + bp->b_pages[index] = NULL; + if (p->busy != 0) + printf("vm_hold_free_pages: blkno: %jd, lblkno: %jd\n", + (intmax_t)bp->b_blkno, (intmax_t)bp->b_lblkno); + p->wire_count--; + vm_page_free(p); + atomic_subtract_int(&cnt.v_wire_count, 1); } bp->b_npages = newnpages; } From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 07:36:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BFC2106566C; Fri, 15 Oct 2010 07:36:19 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp3.one.com (csmtp3.one.com [91.198.169.23]) by mx1.freebsd.org (Postfix) with ESMTP id 1FCB88FC0A; Fri, 15 Oct 2010 07:36:18 +0000 (UTC) Received: from [192.168.0.22] (0x573fa596.cpe.ge-1-1-0-1109.ronqu1.customer.tele.dk [87.63.165.150]) by csmtp3.one.com (Postfix) with ESMTP id 239BE240642F; Fri, 15 Oct 2010 07:36:17 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: multipart/signed; boundary=Apple-Mail-57--416668630; protocol="application/pkcs7-signature"; micalg=sha1 From: Erik Cederstrand In-Reply-To: <20101015112704.I1144@besplex.bde.org> Date: Fri, 15 Oct 2010 09:36:16 +0200 Message-Id: References: <201010090531.o995V8n3026865@svn.freebsd.org> <8C667EA1-3012-4499-BCCE-58263165663B@cederstrand.dk> <20101010083725.S3587@besplex.bde.org> <2A26ECE8-7713-49C4-8706-5AA5B232BE29@cederstrand.dk> <20101013143845.I1817@besplex.bde.org> <5D7F8DAF-E127-41C0-927B-1D72EFC8F4C4@cederstrand.dk> <20101015112704.I1144@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1081) X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Tim Kientzle , src-committers@freebsd.org, Ben Kaduk Subject: Re: svn commit: r213643 - head/usr.bin/ar X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 07:36:19 -0000 --Apple-Mail-57--416668630 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Den 15/10/2010 kl. 02.42 skrev Bruce Evans: >=20 > install(1) mainly compares bytes. Thus it can consider changed = metadata > in inodes (mainly timestamps) to be irrelevant. This cannot handle = metadata > (like timestamps) within the file. strip(1) and objcopy(1) will = clobber > external timestamps, at least if they change the contents. install -p = is > partly to recover from such clobbering (but install has special = knowledge > of strip, and IIRC it uses the timestamps of the unstripped file). > Sometimes they will remove internal metadata and thus allow the = modified > files to compare equal. A useful example of this is stripping debug = info. Just > adding a comment in a new line in a C source file will change the > line numbers in the debugging info for all subsequent lines (that = generate > code). Yes, I found out that "strip --strip-debug file.a" makes some of the = files comparable. At least some of the debugging info is there because the relevant = Makefile overrides DEBUG_FLAGS (e.g. bthidd). I could revert these. = Also, kernel modules will probably be comparable when I comment out = "makeoptions DEBUG=3D-g" from the kernel config file. Unless it makes sense to change all debugging info to store relative = paths, the distribution will have to be built without debugging info. I = have no idea if relative paths make sense in relation to gdb, though. > Putting build dates in object files using __DATE_ and __TIME__ in > C source files would be less annoying if they were put in a separate > section that could be stripped, but this is not very easy to at the > source level. This should be OK. It doesn't look like __DATE__ and __TIME__ are = actually used in the source. They show up in LLVM and GCC, but only to = document or implement support for them. named and ficl use them, but = guarded by build options. > Version control ids are already normally put in a special > section, but I think it has other stuff in it that must not be = stripped. > Normally you shouldn't strip them, but they might affect the object = files > too much if they contain too much info about the checkout place or = time. This would normally be OK to record in the binary, unless the revision = doesn't change functional behavior (e.g. comment changes or variable = renaming). There may also be an issue of local timezones of the revision = dates. Regarding freebsd.cf, freebsd.submit.cf, sendmail.cf and submit.cf, it = looks like I can edit contrib/sendmail/cf/sh/makeinfo.sh to produce a = generic message instead of the build date. I'll give it a new go when I have access to my fast build machine again = next week. Thanks, Erik= --Apple-Mail-57--416668630-- From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 13:08:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D06F4106564A; Fri, 15 Oct 2010 13:08:36 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A1A7D8FC0C; Fri, 15 Oct 2010 13:08:36 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 5B86E46C0D; Fri, 15 Oct 2010 09:08:36 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 406D68A009; Fri, 15 Oct 2010 09:08:35 -0400 (EDT) From: John Baldwin To: Dimitry Andric Date: Fri, 15 Oct 2010 08:45:22 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201010141919.o9EJJJIc034032@svn.freebsd.org> <201010141539.23573.jhb@freebsd.org> <4CB771A6.1070103@FreeBSD.org> In-Reply-To: <4CB771A6.1070103@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201010150845.22576.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Fri, 15 Oct 2010 09:08:35 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo Subject: Re: svn commit: r213845 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 13:08:36 -0000 On Thursday, October 14, 2010 5:09:58 pm Dimitry Andric wrote: > On 2010-10-14 21:39, John Baldwin wrote: > > On Thursday, October 14, 2010 3:19:19 pm Rui Paulo wrote: > ... > >> Revert r213765. This is required because our build infrastructure uses > >> the host lex instead of the lex built during buildworld. I will MFC the > >> lex changes soon and in a few weeks this I'll commit again r213765. > > Can't you make 'lex' a build-tool to workaround this? > > That will not help for "cd conf/CONF && make kernel", apparently. It > will always use the host lex. Well, yes, but that is always true. build-tools are only used for buildkernel. However, if an 8.x lex cannot build a 9.x kernel, then having lex be a build-tool (or cross-tool, ru@ knows which category better than I) will let a 'make kernel-toolchain' followed by 'make buildkernel' of a 9.x source tree work on an 8.x host. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 14:33:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E875106566C; Fri, 15 Oct 2010 14:33:47 +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 0CBA68FC08; Fri, 15 Oct 2010 14:33:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FEXkdC063849; Fri, 15 Oct 2010 14:33:46 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FEXkg2063847; Fri, 15 Oct 2010 14:33:46 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201010151433.o9FEXkg2063847@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 15 Oct 2010 14:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213891 - stable/7/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 14:33:47 -0000 Author: bz Date: Fri Oct 15 14:33:46 2010 New Revision: 213891 URL: http://svn.freebsd.org/changeset/base/213891 Log: MFC r185963 (by csjp in 2008): Consider processes attaching/detaching from tun(4) devices as being link state changes. This change modifies tunopen and tunclose to call the if_link_state_change() function. Among other things, this will result in devd(8) receiving events from devctl(4) for linkup/link down. This allows us to do several useful things, including initializing tunnel parameters and adding routes. Discussed on: freebsd-net Modified: stable/7/sys/net/if_tun.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net/if_tun.c ============================================================================== --- stable/7/sys/net/if_tun.c Fri Oct 15 05:42:35 2010 (r213890) +++ stable/7/sys/net/if_tun.c Fri Oct 15 14:33:46 2010 (r213891) @@ -413,6 +413,7 @@ tunopen(struct cdev *dev, int flag, int tp->tun_flags |= TUN_OPEN; ifp = TUN2IFP(tp); + if_link_state_change(ifp, LINK_STATE_UP); TUNDEBUG(ifp, "open\n"); mtx_unlock(&tp->tun_mtx); @@ -465,6 +466,7 @@ tunclose(struct cdev *dev, int foo, int if_purgeaddrs(ifp); mtx_lock(&tp->tun_mtx); } + if_link_state_change(ifp, LINK_STATE_DOWN); funsetown(&tp->tun_sigio); selwakeuppri(&tp->tun_rsel, PZERO + 1); From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 14:34:34 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A951A1065693; Fri, 15 Oct 2010 14:34:34 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9812D8FC1E; Fri, 15 Oct 2010 14:34:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FEYYAo063907; Fri, 15 Oct 2010 14:34:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FEYYa7063905; Fri, 15 Oct 2010 14:34:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201010151434.o9FEYYa7063905@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 15 Oct 2010 14:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213892 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 14:34:34 -0000 Author: nwhitehorn Date: Fri Oct 15 14:34:34 2010 New Revision: 213892 URL: http://svn.freebsd.org/changeset/base/213892 Log: Prevent the ofwdump manpage from being deleted by make delete-old on PowerPC. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Oct 15 14:33:46 2010 (r213891) +++ head/ObsoleteFiles.inc Fri Oct 15 14:34:34 2010 (r213892) @@ -4971,7 +4971,7 @@ OLD_FILES+=usr/share/man/man5/usbd.conf. .if ${TARGET_ARCH} != "i386" && ${TARGET_ARCH} != "amd64" OLD_FILES+=usr/share/man/man8/boot_i386.8.gz .endif -.if ${TARGET_ARCH} != "powerpc" && ${TARGET_ARCH} != "sparc64" +.if ${TARGET_ARCH} != "powerpc" && ${TARGET_ARCH} != "powerpc64" && ${TARGET_ARCH} != "sparc64" OLD_FILES+=usr/share/man/man8/ofwdump.8.gz .endif OLD_FILES+=usr/share/man/man8/mount_reiserfs.8.gz From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 14:52:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4635F10656C0; Fri, 15 Oct 2010 14:52:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 304C28FC17; Fri, 15 Oct 2010 14:52:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FEqClO064677; Fri, 15 Oct 2010 14:52:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FEqBi3064646; Fri, 15 Oct 2010 14:52:11 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010151452.o9FEqBi3064646@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Oct 2010 14:52:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213893 - in head/sys: arm/econa arm/xscale/ixp425 dev/ae dev/age dev/alc dev/ale dev/bfe dev/bge dev/bm dev/cas dev/dc dev/fxp dev/gem dev/hme dev/jme dev/mge dev/mii dev/msk dev/pcn d... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 14:52:12 -0000 Author: marius Date: Fri Oct 15 14:52:11 2010 New Revision: 213893 URL: http://svn.freebsd.org/changeset/base/213893 Log: Convert the PHY drivers to honor the mii_flags passed down and convert the NIC drivers as well as the PHY drivers to take advantage of the mii_attach() introduced in r213878 to get rid of certain hacks. For the most part these were: - Artificially limiting miibus_{read,write}reg methods to certain PHY addresses; we now let mii_attach() only probe the PHY at the desired address(es) instead. - PHY drivers setting MIIF_* flags based on the NIC driver they hang off from, partly even based on grabbing and using the softc of the parent; we now pass these flags down from the NIC to the PHY drivers via mii_attach(). This got us rid of all such hacks except those of brgphy() in combination with bce(4) and bge(4), which is way beyond what can be expressed with simple flags. While at it, I took the opportunity to change the NIC drivers to pass up the error returned by mii_attach() (previously by mii_phy_probe()) and unify the error message used in this case where and as appropriate as mii_attach() actually can fail for a number of reasons, not just because of no PHY(s) being present at the expected address(es). Reviewed by: jhb, yongari Modified: head/sys/arm/econa/if_ece.c head/sys/arm/xscale/ixp425/if_npe.c head/sys/dev/ae/if_ae.c head/sys/dev/ae/if_aevar.h head/sys/dev/age/if_age.c head/sys/dev/alc/if_alc.c head/sys/dev/ale/if_ale.c head/sys/dev/bfe/if_bfe.c head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h head/sys/dev/bm/if_bm.c head/sys/dev/cas/if_cas.c head/sys/dev/cas/if_casvar.h head/sys/dev/dc/if_dc.c head/sys/dev/dc/pnphy.c head/sys/dev/fxp/if_fxp.c head/sys/dev/gem/if_gem.c head/sys/dev/gem/if_gemvar.h head/sys/dev/hme/if_hme.c head/sys/dev/jme/if_jme.c head/sys/dev/mge/if_mge.c head/sys/dev/mge/if_mgevar.h head/sys/dev/mii/acphy.c head/sys/dev/mii/amphy.c head/sys/dev/mii/atphy.c head/sys/dev/mii/axphy.c head/sys/dev/mii/bmtphy.c head/sys/dev/mii/brgphy.c head/sys/dev/mii/ciphy.c head/sys/dev/mii/e1000phy.c head/sys/dev/mii/exphy.c head/sys/dev/mii/gentbi.c head/sys/dev/mii/icsphy.c head/sys/dev/mii/inphy.c head/sys/dev/mii/ip1000phy.c head/sys/dev/mii/jmphy.c head/sys/dev/mii/lxtphy.c head/sys/dev/mii/mlphy.c head/sys/dev/mii/nsgphy.c head/sys/dev/mii/nsphy.c head/sys/dev/mii/nsphyter.c head/sys/dev/mii/pnaphy.c head/sys/dev/mii/qsphy.c head/sys/dev/mii/rgephy.c head/sys/dev/mii/rlphy.c head/sys/dev/mii/rlswitch.c head/sys/dev/mii/ruephy.c head/sys/dev/mii/smcphy.c head/sys/dev/mii/tdkphy.c head/sys/dev/mii/tlphy.c head/sys/dev/mii/truephy.c head/sys/dev/mii/ukphy.c head/sys/dev/mii/xmphy.c head/sys/dev/msk/if_msk.c head/sys/dev/pcn/if_pcn.c head/sys/dev/re/if_re.c head/sys/dev/sk/if_sk.c head/sys/dev/ste/if_ste.c head/sys/dev/stge/if_stge.c head/sys/dev/tsec/if_tsec.c head/sys/dev/vge/if_vge.c head/sys/dev/vr/if_vr.c head/sys/dev/vr/if_vrreg.h head/sys/dev/xl/if_xl.c head/sys/mips/cavium/octe/octe.c head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/pci/if_rl.c Modified: head/sys/arm/econa/if_ece.c ============================================================================== --- head/sys/arm/econa/if_ece.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/arm/econa/if_ece.c Fri Oct 15 14:52:11 2010 (r213893) @@ -353,10 +353,11 @@ ece_attach(device_t dev) } ece_set_mac(sc, eaddr); sc->ifp = ifp = if_alloc(IFT_ETHER); - if (mii_phy_probe(dev, &sc->miibus, ece_ifmedia_upd, - ece_ifmedia_sts)) { - device_printf(dev, "Cannot find my PHY.\n"); - err = ENXIO; + /* Only one PHY at address 0 in this device. */ + err = mii_attach(dev, &sc->miibus, ifp, ece_ifmedia_upd, + ece_ifmedia_sts, BMSR_DEFCAPMASK, 0, MII_OFFSET_ANY, 0); + if (err != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto out; } ifp->if_softc = sc; @@ -1904,9 +1905,6 @@ static int ece_miibus_readreg(device_t dev, int phy, int reg) { struct ece_softc *sc; - /* Only one phy in this device. */ - if (phy>0) - return (0); sc = device_get_softc(dev); return (phy_read(sc, phy, reg)); } Modified: head/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/if_npe.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/arm/xscale/ixp425/if_npe.c Fri Oct 15 14:52:11 2010 (r213893) @@ -137,7 +137,6 @@ struct npe_softc { int rx_freeqid; /* rx free buffers qid */ int tx_qid; /* tx qid */ int tx_doneqid; /* tx completed qid */ - int sc_phy; /* PHY id */ struct ifmib_iso_8802_3 mibdata; bus_dma_tag_t sc_stats_tag; /* bus dma tag for stats block */ struct npestats *sc_stats; @@ -668,7 +667,7 @@ static int npe_activate(device_t dev) { struct npe_softc *sc = device_get_softc(dev); - int error, i, macbase, miibase; + int error, i, macbase, miibase, phy; /* * Setup NEP ID, MAC, and MII bindings. We allow override @@ -693,8 +692,8 @@ npe_activate(device_t dev) } /* PHY */ - if (!override_unit(dev, "phy", &sc->sc_phy, 0, MII_NPHY-1)) - sc->sc_phy = npeconfig[sc->sc_npeid].phy; + if (!override_unit(dev, "phy", &phy, 0, MII_NPHY - 1)) + phy = npeconfig[sc->sc_npeid].phy; if (!override_addr(dev, "mii", &miibase)) miibase = npeconfig[sc->sc_npeid].miibase; device_printf(sc->sc_dev, "MII at 0x%x\n", miibase); @@ -721,10 +720,12 @@ npe_activate(device_t dev) return error; } - /* probe for PHY */ - if (mii_phy_probe(dev, &sc->sc_mii, npe_ifmedia_update, npe_ifmedia_status)) { - device_printf(dev, "cannot find PHY %d.\n", sc->sc_phy); - return ENXIO; + /* attach PHY */ + error = mii_attach(dev, &sc->sc_mii, sc->sc_ifp, npe_ifmedia_update, + npe_ifmedia_status, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); + return error; } error = npe_dma_setup(sc, &sc->txdma, "tx", npe_txbuf, NPE_MAXSEG); @@ -1700,8 +1701,6 @@ npe_miibus_readreg(device_t dev, int phy struct npe_softc *sc = device_get_softc(dev); uint32_t v; - if (phy != sc->sc_phy) /* XXX no auto-detect */ - return 0xffff; v = (phy << NPE_MII_ADDR_SHL) | (reg << NPE_MII_REG_SHL) | NPE_MII_GO; npe_mii_mdio_write(sc, NPE_MAC_MDIO_CMD, v); if (npe_mii_mdio_wait(sc)) @@ -1717,8 +1716,6 @@ npe_miibus_writereg(device_t dev, int ph struct npe_softc *sc = device_get_softc(dev); uint32_t v; - if (phy != sc->sc_phy) /* XXX */ - return (0); v = (phy << NPE_MII_ADDR_SHL) | (reg << NPE_MII_REG_SHL) | data | NPE_MII_WRITE | NPE_MII_GO; Modified: head/sys/dev/ae/if_ae.c ============================================================================== --- head/sys/dev/ae/if_ae.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/ae/if_ae.c Fri Oct 15 14:52:11 2010 (r213893) @@ -360,9 +360,6 @@ ae_attach(device_t dev) if (error != 0) goto fail; - /* Set default PHY address. */ - sc->phyaddr = AE_PHYADDR_DEFAULT; - ifp = sc->ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(dev, "could not allocate ifnet structure.\n"); @@ -390,10 +387,11 @@ ae_attach(device_t dev) /* * Configure and attach MII bus. */ - error = mii_phy_probe(dev, &sc->miibus, ae_mediachange, - ae_mediastatus); + error = mii_attach(dev, &sc->miibus, ifp, ae_mediachange, + ae_mediastatus, BMSR_DEFCAPMASK, AE_PHYADDR_DEFAULT, + MII_OFFSET_ANY, 0); if (error != 0) { - device_printf(dev, "no PHY found.\n"); + device_printf(dev, "attaching PHYs failed\n"); goto fail; } @@ -813,9 +811,6 @@ ae_miibus_readreg(device_t dev, int phy, * Locking is done in upper layers. */ - if (phy != sc->phyaddr) - return (0); - val = ((reg << AE_MDIO_REGADDR_SHIFT) & AE_MDIO_REGADDR_MASK) | AE_MDIO_START | AE_MDIO_READ | AE_MDIO_SUP_PREAMBLE | ((AE_MDIO_CLK_25_4 << AE_MDIO_CLK_SHIFT) & AE_MDIO_CLK_MASK); @@ -851,9 +846,6 @@ ae_miibus_writereg(device_t dev, int phy * Locking is done in upper layers. */ - if (phy != sc->phyaddr) - return (0); - aereg = ((reg << AE_MDIO_REGADDR_SHIFT) & AE_MDIO_REGADDR_MASK) | AE_MDIO_START | AE_MDIO_SUP_PREAMBLE | ((AE_MDIO_CLK_25_4 << AE_MDIO_CLK_SHIFT) & AE_MDIO_CLK_MASK) | Modified: head/sys/dev/ae/if_aevar.h ============================================================================== --- head/sys/dev/ae/if_aevar.h Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/ae/if_aevar.h Fri Oct 15 14:52:11 2010 (r213893) @@ -111,7 +111,6 @@ typedef struct ae_softc { struct mtx mtx; - int phyaddr; uint8_t eaddr[ETHER_ADDR_LEN]; uint8_t flags; int if_flags; Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/age/if_age.c Fri Oct 15 14:52:11 2010 (r213893) @@ -210,8 +210,6 @@ age_miibus_readreg(device_t dev, int phy int i; sc = device_get_softc(dev); - if (phy != sc->age_phyaddr) - return (0); CSR_WRITE_4(sc, AGE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_READ | MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); @@ -241,8 +239,6 @@ age_miibus_writereg(device_t dev, int ph int i; sc = device_get_softc(dev); - if (phy != sc->age_phyaddr) - return (0); CSR_WRITE_4(sc, AGE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_WRITE | (val & MDIO_DATA_MASK) << MDIO_DATA_SHIFT | @@ -621,9 +617,11 @@ age_attach(device_t dev) ifp->if_capenable = ifp->if_capabilities; /* Set up MII bus. */ - if ((error = mii_phy_probe(dev, &sc->age_miibus, age_mediachange, - age_mediastatus)) != 0) { - device_printf(dev, "no PHY found!\n"); + error = mii_attach(dev, &sc->age_miibus, ifp, age_mediachange, + age_mediastatus, BMSR_DEFCAPMASK, sc->age_phyaddr, MII_OFFSET_ANY, + 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/alc/if_alc.c Fri Oct 15 14:52:11 2010 (r213893) @@ -235,9 +235,6 @@ alc_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - if (phy != sc->alc_phyaddr) - return (0); - /* * For AR8132 fast ethernet controller, do not report 1000baseT * capability to mii(4). Even though AR8132 uses the same @@ -274,9 +271,6 @@ alc_miibus_writereg(device_t dev, int ph sc = device_get_softc(dev); - if (phy != sc->alc_phyaddr) - return (0); - CSR_WRITE_4(sc, ALC_MDIO, MDIO_OP_EXECUTE | MDIO_OP_WRITE | (val & MDIO_DATA_MASK) << MDIO_DATA_SHIFT | MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); @@ -978,9 +972,11 @@ alc_attach(device_t dev) ifp->if_capenable = ifp->if_capabilities; /* Set up MII bus. */ - if ((error = mii_phy_probe(dev, &sc->alc_miibus, alc_mediachange, - alc_mediastatus)) != 0) { - device_printf(dev, "no PHY found!\n"); + error = mii_attach(dev, &sc->alc_miibus, ifp, alc_mediachange, + alc_mediastatus, BMSR_DEFCAPMASK, sc->alc_phyaddr, MII_OFFSET_ANY, + 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: head/sys/dev/ale/if_ale.c ============================================================================== --- head/sys/dev/ale/if_ale.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/ale/if_ale.c Fri Oct 15 14:52:11 2010 (r213893) @@ -208,9 +208,6 @@ ale_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - if (phy != sc->ale_phyaddr) - return (0); - CSR_WRITE_4(sc, ALE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_READ | MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); for (i = ALE_PHY_TIMEOUT; i > 0; i--) { @@ -237,9 +234,6 @@ ale_miibus_writereg(device_t dev, int ph sc = device_get_softc(dev); - if (phy != sc->ale_phyaddr) - return (0); - CSR_WRITE_4(sc, ALE_MDIO, MDIO_OP_EXECUTE | MDIO_OP_WRITE | (val & MDIO_DATA_MASK) << MDIO_DATA_SHIFT | MDIO_SUP_PREAMBLE | MDIO_CLK_25_4 | MDIO_REG_ADDR(reg)); @@ -605,9 +599,11 @@ ale_attach(device_t dev) ifp->if_capenable = ifp->if_capabilities; /* Set up MII bus. */ - if ((error = mii_phy_probe(dev, &sc->ale_miibus, ale_mediachange, - ale_mediastatus)) != 0) { - device_printf(dev, "no PHY found!\n"); + error = mii_attach(dev, &sc->ale_miibus, ifp, ale_mediachange, + ale_mediastatus, BMSR_DEFCAPMASK, sc->ale_phyaddr, MII_OFFSET_ANY, + 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: head/sys/dev/bfe/if_bfe.c ============================================================================== --- head/sys/dev/bfe/if_bfe.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/bfe/if_bfe.c Fri Oct 15 14:52:11 2010 (r213893) @@ -505,10 +505,11 @@ bfe_attach(device_t dev) bfe_chip_reset(sc); BFE_UNLOCK(sc); - if (mii_phy_probe(dev, &sc->bfe_miibus, - bfe_ifmedia_upd, bfe_ifmedia_sts)) { - device_printf(dev, "MII without any PHY!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->bfe_miibus, ifp, bfe_ifmedia_upd, + bfe_ifmedia_sts, BMSR_DEFCAPMASK, sc->bfe_phyaddr, MII_OFFSET_ANY, + 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } @@ -631,8 +632,6 @@ bfe_miibus_readreg(device_t dev, int phy u_int32_t ret; sc = device_get_softc(dev); - if (phy != sc->bfe_phyaddr) - return (0); bfe_readphy(sc, reg, &ret); return (ret); @@ -644,8 +643,6 @@ bfe_miibus_writereg(device_t dev, int ph struct bfe_softc *sc; sc = device_get_softc(dev); - if (phy != sc->bfe_phyaddr) - return (0); bfe_writephy(sc, reg, val); return (0); Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/bge/if_bge.c Fri Oct 15 14:52:11 2010 (r213893) @@ -781,10 +781,6 @@ bge_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - /* Prevent the probe from finding incorrect devices. */ - if (phy != sc->bge_phy_addr) - return (0); - /* Clear the autopoll bit if set, otherwise may trigger PCI errors. */ if ((sc->bge_mi_mode & BGE_MIMODE_AUTOPOLL) != 0) { CSR_WRITE_4(sc, BGE_MI_MODE, @@ -2563,7 +2559,7 @@ bge_attach(device_t dev) struct bge_softc *sc; uint32_t hwcfg = 0, misccfg; u_char eaddr[ETHER_ADDR_LEN]; - int error, msicount, reg, rid, trys; + int error, msicount, phy_addr, reg, rid, trys; sc = device_get_softc(dev); sc->bge_dev = dev; @@ -2596,7 +2592,7 @@ bge_attach(device_t dev) sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid); /* Set default PHY address. */ - sc->bge_phy_addr = 1; + phy_addr = 1; /* * Don't enable Ethernet@WireSpeed for the 5700, 5906, or the @@ -2961,17 +2957,17 @@ bge_attach(device_t dev) again: bge_asf_driver_up(sc); - if (mii_phy_probe(dev, &sc->bge_miibus, - bge_ifmedia_upd, bge_ifmedia_sts)) { + error = (mii_attach(dev, &sc->bge_miibus, ifp, + bge_ifmedia_upd, bge_ifmedia_sts, BMSR_DEFCAPMASK, + phy_addr, MII_OFFSET_ANY, 0)); + if (error != 0) { if (trys++ < 4) { device_printf(sc->bge_dev, "Try again\n"); bge_miibus_writereg(sc->bge_dev, 1, MII_BMCR, BMCR_RESET); goto again; } - - device_printf(sc->bge_dev, "MII without any PHY!\n"); - error = ENXIO; + device_printf(sc->bge_dev, "attaching PHYs failed\n"); goto fail; } Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/bge/if_bgereg.h Fri Oct 15 14:52:11 2010 (r213893) @@ -2757,7 +2757,6 @@ struct bge_softc { uint32_t bge_tx_max_coal_bds; uint32_t bge_mi_mode; int bge_if_flags; - int bge_phy_addr; int bge_txcnt; int bge_link; /* link state */ int bge_link_evt; /* pending link event */ Modified: head/sys/dev/bm/if_bm.c ============================================================================== --- head/sys/dev/bm/if_bm.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/bm/if_bm.c Fri Oct 15 14:52:11 2010 (r213893) @@ -594,11 +594,19 @@ bm_attach(device_t dev) /* reset the adapter */ bm_chip_setup(sc); - /* setup MII */ - error = mii_phy_probe(dev, &sc->sc_miibus, bm_ifmedia_upd, - bm_ifmedia_sts); - if (error != 0) - device_printf(dev,"PHY probe failed: %d\n", error); + /* + * Setup MII + * On Apple BMAC controllers, we end up in a weird state of + * partially-completed autonegotiation on boot. So we force + * autonegotation to try again. + */ + error = mii_attach(dev, &sc->sc_miibus, ifp, bm_ifmedia_upd, + bm_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, + MIIF_FORCEANEG); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); + return (error); + } sc->sc_mii = device_get_softc(sc->sc_miibus); Modified: head/sys/dev/cas/if_cas.c ============================================================================== --- head/sys/dev/cas/if_cas.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/cas/if_cas.c Fri Oct 15 14:52:11 2010 (r213893) @@ -344,13 +344,9 @@ cas_attach(struct cas_softc *sc) BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); } - switch (sc->sc_variant) { - default: - sc->sc_phyad = -1; - break; - } - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - cas_mediachange, cas_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, + MII_PHY_ANY, MII_OFFSET_ANY, 0); } /* * Fall back on an internal PHY if no external PHY was found. @@ -368,13 +364,9 @@ cas_attach(struct cas_softc *sc) BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); } - switch (sc->sc_variant) { - default: - sc->sc_phyad = -1; - break; - } - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - cas_mediachange, cas_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, + MII_PHY_ANY, MII_OFFSET_ANY, 0); } } else { /* @@ -394,12 +386,12 @@ cas_attach(struct cas_softc *sc) CAS_WRITE_4(sc, CAS_PCS_CONF, CAS_PCS_CONF_EN); CAS_BARRIER(sc, CAS_PCS_CONF, 4, BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); - sc->sc_phyad = CAS_PHYAD_EXTERNAL; - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - cas_mediachange, cas_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, + CAS_PHYAD_EXTERNAL, MII_OFFSET_ANY, 0); } if (error != 0) { - device_printf(sc->sc_dev, "PHY probe failed: %d\n", error); + device_printf(sc->sc_dev, "attaching PHYs failed\n"); goto fail_rxmap; } sc->sc_mii = device_get_softc(sc->sc_miibus); @@ -2172,9 +2164,6 @@ cas_mii_readreg(device_t dev, int phy, i #endif sc = device_get_softc(dev); - if (sc->sc_phyad != -1 && phy != sc->sc_phyad) - return (0); - if ((sc->sc_flags & CAS_SERDES) != 0) { switch (reg) { case MII_BMCR: @@ -2233,9 +2222,6 @@ cas_mii_writereg(device_t dev, int phy, #endif sc = device_get_softc(dev); - if (sc->sc_phyad != -1 && phy != sc->sc_phyad) - return (0); - if ((sc->sc_flags & CAS_SERDES) != 0) { switch (reg) { case MII_BMSR: @@ -2318,8 +2304,7 @@ cas_mii_statchg(device_t dev) #ifdef CAS_DEBUG if ((ifp->if_flags & IFF_DEBUG) != 0) - device_printf(sc->sc_dev, "%s: status change: PHY = %d\n", - __func__, sc->sc_phyad); + device_printf(sc->sc_dev, "%s: status changen", __func__); #endif if ((sc->sc_mii->mii_media_status & IFM_ACTIVE) != 0 && Modified: head/sys/dev/cas/if_casvar.h ============================================================================== --- head/sys/dev/cas/if_casvar.h Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/cas/if_casvar.h Fri Oct 15 14:52:11 2010 (r213893) @@ -154,8 +154,6 @@ struct cas_softc { bus_dma_tag_t sc_cdmatag; /* control data bus DMA tag */ bus_dmamap_t sc_dmamap; /* bus DMA handle */ - u_int sc_phyad; /* PHY to use or -1 for any */ - u_int sc_variant; #define CAS_UNKNOWN 0 /* don't know */ #define CAS_CAS 1 /* Sun Cassini */ Modified: head/sys/dev/dc/if_dc.c ============================================================================== --- head/sys/dev/dc/if_dc.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/dc/if_dc.c Fri Oct 15 14:52:11 2010 (r213893) @@ -779,26 +779,6 @@ dc_miibus_readreg(device_t dev, int phy, sc = device_get_softc(dev); bzero(&frame, sizeof(frame)); - /* - * Note: both the AL981 and AN983 have internal PHYs, - * however the AL981 provides direct access to the PHY - * registers while the AN983 uses a serial MII interface. - * The AN983's MII interface is also buggy in that you - * can read from any MII address (0 to 31), but only address 1 - * behaves normally. To deal with both cases, we pretend - * that the PHY is at MII address 1. - */ - if (DC_IS_ADMTEK(sc) && phy != DC_ADMTEK_PHYADDR) - return (0); - - /* - * Note: the ukphy probes of the RS7112 report a PHY at - * MII address 0 (possibly HomePNA?) and 1 (ethernet) - * so we only respond to correct one. - */ - if (DC_IS_CONEXANT(sc) && phy != DC_CONEXANT_PHYADDR) - return (0); - if (sc->dc_pmode != DC_PMODE_MII) { if (phy == (MII_NPHY - 1)) { switch (reg) { @@ -901,12 +881,6 @@ dc_miibus_writereg(device_t dev, int phy sc = device_get_softc(dev); bzero(&frame, sizeof(frame)); - if (DC_IS_ADMTEK(sc) && phy != DC_ADMTEK_PHYADDR) - return (0); - - if (DC_IS_CONEXANT(sc) && phy != DC_CONEXANT_PHYADDR) - return (0); - if (DC_IS_PNIC(sc)) { CSR_WRITE_4(sc, DC_PN_MII, DC_PN_MIIOPCODE_WRITE | (phy << 23) | (reg << 10) | data); @@ -1815,14 +1789,12 @@ dc_dma_map_addr(void *arg, bus_dma_segme static int dc_attach(device_t dev) { - int tmp = 0; uint32_t eaddr[(ETHER_ADDR_LEN+3)/4]; u_int32_t command; struct dc_softc *sc; struct ifnet *ifp; u_int32_t reg, revision; - int error = 0, rid, mac_offset; - int i; + int error, i, mac_offset, phy, rid, tmp; u_int8_t *mac; sc = device_get_softc(dev); @@ -2217,6 +2189,7 @@ dc_attach(device_t dev) * old selection (SIA only or SIA/SYM) and attach the dcphy * driver instead. */ + tmp = 0; if (DC_IS_INTEL(sc)) { dc_apply_fixup(sc, IFM_AUTO); tmp = sc->dc_pmode; @@ -2225,7 +2198,7 @@ dc_attach(device_t dev) /* * Setup General Purpose port mode and data so the tulip can talk - * to the MII. This needs to be done before mii_phy_probe so that + * to the MII. This needs to be done before mii_attach so that * we can actually see them. */ if (DC_IS_XIRCOM(sc)) { @@ -2237,16 +2210,37 @@ dc_attach(device_t dev) DELAY(10); } - error = mii_phy_probe(dev, &sc->dc_miibus, - dc_ifmedia_upd, dc_ifmedia_sts); + phy = MII_PHY_ANY; + /* + * Note: both the AL981 and AN983 have internal PHYs, however the + * AL981 provides direct access to the PHY registers while the AN983 + * uses a serial MII interface. The AN983's MII interface is also + * buggy in that you can read from any MII address (0 to 31), but + * only address 1 behaves normally. To deal with both cases, we + * pretend that the PHY is at MII address 1. + */ + if (DC_IS_ADMTEK(sc)) + phy = DC_ADMTEK_PHYADDR; + + /* + * Note: the ukphy probes of the RS7112 report a PHY at MII address + * 0 (possibly HomePNA?) and 1 (ethernet) so we only respond to the + * correct one. + */ + if (DC_IS_CONEXANT(sc)) + phy = DC_CONEXANT_PHYADDR; + + error = mii_attach(dev, &sc->dc_miibus, ifp, dc_ifmedia_upd, + dc_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); if (error && DC_IS_INTEL(sc)) { sc->dc_pmode = tmp; if (sc->dc_pmode != DC_PMODE_SIA) sc->dc_pmode = DC_PMODE_SYM; sc->dc_flags |= DC_21143_NWAY; - mii_phy_probe(dev, &sc->dc_miibus, - dc_ifmedia_upd, dc_ifmedia_sts); + mii_attach(dev, &sc->dc_miibus, ifp, dc_ifmedia_upd, + dc_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, + MII_OFFSET_ANY, 0); /* * For non-MII cards, we need to have the 21143 * drive the LEDs. Except there are some systems @@ -2261,7 +2255,7 @@ dc_attach(device_t dev) } if (error) { - device_printf(dev, "MII without any PHY!\n"); + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: head/sys/dev/dc/pnphy.c ============================================================================== --- head/sys/dev/dc/pnphy.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/dc/pnphy.c Fri Oct 15 14:52:11 2010 (r213893) @@ -132,6 +132,7 @@ pnphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = pnphy_service; @@ -169,8 +170,6 @@ pnphy_service(struct mii_softc *sc, stru if ((mii->mii_ifp->if_flags & IFF_UP) == 0) break; - sc->mii_flags = 0; - switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_AUTO: /* NWAY is busted on this chip */ Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/fxp/if_fxp.c Fri Oct 15 14:52:11 2010 (r213893) @@ -804,10 +804,14 @@ fxp_attach(device_t dev) ifmedia_add(&sc->sc_media, IFM_ETHER|IFM_MANUAL, 0, NULL); ifmedia_set(&sc->sc_media, IFM_ETHER|IFM_MANUAL); } else { - if (mii_phy_probe(dev, &sc->miibus, fxp_ifmedia_upd, - fxp_ifmedia_sts)) { - device_printf(dev, "MII without any PHY!\n"); - error = ENXIO; + /* + * i82557 wedge when isolating all of their PHYs. + */ + error = mii_attach(dev, &sc->miibus, ifp, fxp_ifmedia_upd, + fxp_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, + MII_OFFSET_ANY, MIIF_NOISOLATE); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } } Modified: head/sys/dev/gem/if_gem.c ============================================================================== --- head/sys/dev/gem/if_gem.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/gem/if_gem.c Fri Oct 15 14:52:11 2010 (r213893) @@ -149,7 +149,7 @@ gem_attach(struct gem_softc *sc) { struct gem_txsoft *txs; struct ifnet *ifp; - int error, i; + int error, i, phy; uint32_t v; if (bootverbose) @@ -294,14 +294,15 @@ gem_attach(struct gem_softc *sc) BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); switch (sc->sc_variant) { case GEM_SUN_ERI: - sc->sc_phyad = GEM_PHYAD_EXTERNAL; + phy = GEM_PHYAD_EXTERNAL; break; default: - sc->sc_phyad = -1; + phy = MII_PHY_ANY; break; } - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - gem_mediachange, gem_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + gem_mediachange, gem_mediastatus, BMSR_DEFCAPMASK, phy, + MII_OFFSET_ANY, 0); } /* @@ -318,17 +319,18 @@ gem_attach(struct gem_softc *sc) switch (sc->sc_variant) { case GEM_SUN_ERI: case GEM_APPLE_K2_GMAC: - sc->sc_phyad = GEM_PHYAD_INTERNAL; + phy = GEM_PHYAD_INTERNAL; break; case GEM_APPLE_GMAC: - sc->sc_phyad = GEM_PHYAD_EXTERNAL; + phy = GEM_PHYAD_EXTERNAL; break; default: - sc->sc_phyad = -1; + phy = MII_PHY_ANY; break; } - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - gem_mediachange, gem_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + gem_mediachange, gem_mediastatus, BMSR_DEFCAPMASK, phy, + MII_OFFSET_ANY, 0); } /* @@ -348,12 +350,12 @@ gem_attach(struct gem_softc *sc) GEM_BANK1_BARRIER(sc, GEM_MII_CONFIG, 4, BUS_SPACE_BARRIER_WRITE); sc->sc_flags |= GEM_SERDES; - sc->sc_phyad = GEM_PHYAD_EXTERNAL; - error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, - gem_mediachange, gem_mediastatus); + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, + gem_mediachange, gem_mediastatus, BMSR_DEFCAPMASK, + GEM_PHYAD_EXTERNAL, MII_OFFSET_ANY, 0); } if (error != 0) { - device_printf(sc->sc_dev, "PHY probe failed: %d\n", error); + device_printf(sc->sc_dev, "attaching PHYs failed\n"); goto fail_rxd; } sc->sc_mii = device_get_softc(sc->sc_miibus); @@ -1848,9 +1850,6 @@ gem_mii_readreg(device_t dev, int phy, i #endif sc = device_get_softc(dev); - if (sc->sc_phyad != -1 && phy != sc->sc_phyad) - return (0); - if ((sc->sc_flags & GEM_SERDES) != 0) { switch (reg) { case MII_BMCR: @@ -1909,9 +1908,6 @@ gem_mii_writereg(device_t dev, int phy, #endif sc = device_get_softc(dev); - if (sc->sc_phyad != -1 && phy != sc->sc_phyad) - return (0); - if ((sc->sc_flags & GEM_SERDES) != 0) { switch (reg) { case MII_BMSR: @@ -1992,8 +1988,7 @@ gem_mii_statchg(device_t dev) #ifdef GEM_DEBUG if ((sc->sc_ifp->if_flags & IFF_DEBUG) != 0) - device_printf(sc->sc_dev, "%s: status change: PHY = %d\n", - __func__, sc->sc_phyad); + device_printf(sc->sc_dev, "%s: status change\n", __func__); #endif if ((sc->sc_mii->mii_media_status & IFM_ACTIVE) != 0 && Modified: head/sys/dev/gem/if_gemvar.h ============================================================================== --- head/sys/dev/gem/if_gemvar.h Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/gem/if_gemvar.h Fri Oct 15 14:52:11 2010 (r213893) @@ -126,8 +126,6 @@ struct gem_softc { bus_dma_tag_t sc_cdmatag; /* control data bus DMA tag */ bus_dmamap_t sc_dmamap; /* bus DMA handle */ - int sc_phyad; /* PHY to use or -1 for any */ - u_int sc_variant; #define GEM_UNKNOWN 0 /* don't know */ #define GEM_SUN_GEM 1 /* Sun GEM */ Modified: head/sys/dev/hme/if_hme.c ============================================================================== --- head/sys/dev/hme/if_hme.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/hme/if_hme.c Fri Oct 15 14:52:11 2010 (r213893) @@ -315,9 +315,20 @@ hme_config(struct hme_softc *sc) hme_mifinit(sc); - if ((error = mii_phy_probe(sc->sc_dev, &sc->sc_miibus, hme_mediachange, - hme_mediastatus)) != 0) { - device_printf(sc->sc_dev, "phy probe failed: %d\n", error); + /* + * DP83840A used with HME chips don't advertise their media + * capabilities themselves properly so force writing the ANAR + * according to the BMSR in mii_phy_setmedia(). + */ + error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, hme_mediachange, + hme_mediastatus, BMSR_DEFCAPMASK, HME_PHYAD_EXTERNAL, + MII_OFFSET_ANY, MIIF_FORCEANEG); + i = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, hme_mediachange, + hme_mediastatus, BMSR_DEFCAPMASK, HME_PHYAD_INTERNAL, + MII_OFFSET_ANY, MIIF_FORCEANEG); + if (error != 0 && i != 0) { + error = ENXIO; + device_printf(sc->sc_dev, "attaching PHYs failed\n"); goto fail_rxdesc; } sc->sc_mii = device_get_softc(sc->sc_miibus); @@ -1404,10 +1415,6 @@ hme_mii_readreg(device_t dev, int phy, i int n; u_int32_t v; - /* We can at most have two PHYs. */ - if (phy != HME_PHYAD_EXTERNAL && phy != HME_PHYAD_INTERNAL) - return (0); - sc = device_get_softc(dev); /* Select the desired PHY in the MIF configuration register */ v = HME_MIF_READ_4(sc, HME_MIFI_CFG); @@ -1445,10 +1452,6 @@ hme_mii_writereg(device_t dev, int phy, int n; u_int32_t v; - /* We can at most have two PHYs. */ - if (phy != HME_PHYAD_EXTERNAL && phy != HME_PHYAD_INTERNAL) - return (0); - sc = device_get_softc(dev); /* Select the desired PHY in the MIF configuration register */ v = HME_MIF_READ_4(sc, HME_MIFI_CFG); Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/jme/if_jme.c Fri Oct 15 14:52:11 2010 (r213893) @@ -224,13 +224,8 @@ jme_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); /* For FPGA version, PHY address 0 should be ignored. */ - if ((sc->jme_flags & JME_FLAG_FPGA) != 0) { - if (phy == 0) - return (0); - } else { - if (sc->jme_phyaddr != phy) - return (0); - } + if ((sc->jme_flags & JME_FLAG_FPGA) != 0 && phy == 0) + return (0); CSR_WRITE_4(sc, JME_SMI, SMI_OP_READ | SMI_OP_EXECUTE | SMI_PHY_ADDR(phy) | SMI_REG_ADDR(reg)); @@ -260,13 +255,8 @@ jme_miibus_writereg(device_t dev, int ph sc = device_get_softc(dev); /* For FPGA version, PHY address 0 should be ignored. */ - if ((sc->jme_flags & JME_FLAG_FPGA) != 0) { - if (phy == 0) - return (0); - } else { - if (sc->jme_phyaddr != phy) - return (0); - } + if ((sc->jme_flags & JME_FLAG_FPGA) != 0 && phy == 0) + return (0); CSR_WRITE_4(sc, JME_SMI, SMI_OP_WRITE | SMI_OP_EXECUTE | ((val << SMI_DATA_SHIFT) & SMI_DATA_MASK) | @@ -743,9 +733,11 @@ jme_attach(device_t dev) ifp->if_capenable = ifp->if_capabilities; /* Set up MII bus. */ - if ((error = mii_phy_probe(dev, &sc->jme_miibus, jme_mediachange, - jme_mediastatus)) != 0) { - device_printf(dev, "no PHY found!\n"); + error = mii_attach(dev, &sc->jme_miibus, ifp, jme_mediachange, + jme_mediastatus, BMSR_DEFCAPMASK, sc->jme_phyaddr, MII_OFFSET_ANY, + 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: head/sys/dev/mge/if_mge.c ============================================================================== --- head/sys/dev/mge/if_mge.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/mge/if_mge.c Fri Oct 15 14:52:11 2010 (r213893) @@ -629,7 +629,7 @@ mge_attach(device_t dev) struct mii_softc *miisc; struct ifnet *ifp; uint8_t hwaddr[ETHER_ADDR_LEN]; - int i, error ; + int i, error, phy; sc = device_get_softc(dev); sc->dev = dev; @@ -642,7 +642,7 @@ mge_attach(device_t dev) mge_ver_params(sc); /* Get phy address from fdt */ - if (fdt_get_phyaddr(sc->node, &sc->phyaddr) != 0) + if (fdt_get_phyaddr(sc->node, &phy) != 0) return (ENXIO); /* Initialize mutexes */ @@ -706,10 +706,11 @@ mge_attach(device_t dev) ether_ifattach(ifp, hwaddr); callout_init(&sc->wd_callout, 0); - /* Probe PHY(s) */ - error = mii_phy_probe(dev, &sc->miibus, mge_ifmedia_upd, mge_ifmedia_sts); + /* Attach PHY(s) */ + error = mii_attach(dev, &sc->miibus, ifp, mge_ifmedia_upd, + mge_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); if (error) { - device_printf(dev, "MII failed to find PHY\n"); + device_printf(dev, "attaching PHYs failed\n"); mge_detach(dev); return (error); } @@ -1293,9 +1294,6 @@ mge_miibus_readreg(device_t dev, int phy sc = device_get_softc(dev); - if (sc->phyaddr != phy) - return (0); - MGE_WRITE(sc_mge0, MGE_REG_SMI, 0x1fffffff & (MGE_SMI_READ | (reg << 21) | (phy << 16))); @@ -1317,9 +1315,6 @@ mge_miibus_writereg(device_t dev, int ph sc = device_get_softc(dev); - if (sc->phyaddr != phy) - return (0); - MGE_WRITE(sc_mge0, MGE_REG_SMI, 0x1fffffff & (MGE_SMI_WRITE | (reg << 21) | (phy << 16) | (value & 0xffff))); Modified: head/sys/dev/mge/if_mgevar.h ============================================================================== --- head/sys/dev/mge/if_mgevar.h Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/mge/if_mgevar.h Fri Oct 15 14:52:11 2010 (r213893) @@ -103,8 +103,6 @@ struct mge_softc { uint32_t mge_tx_tok_cnt; uint16_t mge_mtu; int mge_ver; - - int phyaddr; }; Modified: head/sys/dev/mii/acphy.c ============================================================================== --- head/sys/dev/mii/acphy.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/mii/acphy.c Fri Oct 15 14:52:11 2010 (r213893) @@ -132,6 +132,7 @@ acphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = acphy_service; Modified: head/sys/dev/mii/amphy.c ============================================================================== --- head/sys/dev/mii/amphy.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/mii/amphy.c Fri Oct 15 14:52:11 2010 (r213893) @@ -109,6 +109,7 @@ amphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = amphy_service; Modified: head/sys/dev/mii/atphy.c ============================================================================== --- head/sys/dev/mii/atphy.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/mii/atphy.c Fri Oct 15 14:52:11 2010 (r213893) @@ -113,6 +113,7 @@ atphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = atphy_service; Modified: head/sys/dev/mii/axphy.c ============================================================================== --- head/sys/dev/mii/axphy.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/mii/axphy.c Fri Oct 15 14:52:11 2010 (r213893) @@ -97,6 +97,7 @@ axphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = axphy_service; Modified: head/sys/dev/mii/bmtphy.c ============================================================================== --- head/sys/dev/mii/bmtphy.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/mii/bmtphy.c Fri Oct 15 14:52:11 2010 (r213893) @@ -147,6 +147,7 @@ bmtphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = bmtphy_service; Modified: head/sys/dev/mii/brgphy.c ============================================================================== --- head/sys/dev/mii/brgphy.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/mii/brgphy.c Fri Oct 15 14:52:11 2010 (r213893) @@ -191,6 +191,7 @@ brgphy_attach(device_t dev) LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); /* Initialize mii_softc structure */ + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = brgphy_service; Modified: head/sys/dev/mii/ciphy.c ============================================================================== --- head/sys/dev/mii/ciphy.c Fri Oct 15 14:34:34 2010 (r213892) +++ head/sys/dev/mii/ciphy.c Fri Oct 15 14:52:11 2010 (r213893) @@ -57,9 +57,7 @@ __FBSDID("$FreeBSD$"); #include "miibus_if.h" #include -/* -#include -*/ + static int ciphy_probe(device_t); static int ciphy_attach(device_t); @@ -118,6 +116,7 @@ ciphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 15:00:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18005106566C; Fri, 15 Oct 2010 15:00:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02B3F8FC13; Fri, 15 Oct 2010 15:00:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FF0VnN065008; Fri, 15 Oct 2010 15:00:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FF0Uet064988; Fri, 15 Oct 2010 15:00:30 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010151500.o9FF0Uet064988@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Oct 2010 15:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213894 - in head/sys: arm/at91 dev/bce dev/ed dev/et dev/lge dev/nfe dev/nge dev/nve dev/sf dev/sge dev/sis dev/smc dev/tl dev/tx dev/usb/net dev/wb mips/atheros mips/idt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 15:00:31 -0000 Author: marius Date: Fri Oct 15 15:00:30 2010 New Revision: 213894 URL: http://svn.freebsd.org/changeset/base/213894 Log: Converted the remainder of the NIC drivers to use the mii_attach() introduced in r213878 instead of mii_phy_probe(). Unlike r213893 these are only straight forward conversions though. Reviewed by: yongari Modified: head/sys/arm/at91/if_ate.c head/sys/arm/at91/if_macb.c head/sys/dev/bce/if_bce.c head/sys/dev/ed/if_ed_pccard.c head/sys/dev/et/if_et.c head/sys/dev/lge/if_lge.c head/sys/dev/nfe/if_nfe.c head/sys/dev/nge/if_nge.c head/sys/dev/nve/if_nve.c head/sys/dev/sf/if_sf.c head/sys/dev/sge/if_sge.c head/sys/dev/sis/if_sis.c head/sys/dev/smc/if_smc.c head/sys/dev/tl/if_tl.c head/sys/dev/tx/if_tx.c head/sys/dev/usb/net/usb_ethernet.c head/sys/dev/wb/if_wb.c head/sys/mips/atheros/if_arge.c head/sys/mips/idt/if_kr.c Modified: head/sys/arm/at91/if_ate.c ============================================================================== --- head/sys/arm/at91/if_ate.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/arm/at91/if_ate.c Fri Oct 15 15:00:30 2010 (r213894) @@ -318,9 +318,11 @@ ate_attach(device_t dev) } sc->ifp = ifp = if_alloc(IFT_ETHER); - if (mii_phy_probe(dev, &sc->miibus, ate_ifmedia_upd, ate_ifmedia_sts)) { + err = mii_attach(dev, &sc->miibus, ifp, ate_ifmedia_upd, + ate_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); device_printf(dev, "Cannot find my PHY.\n"); - err = ENXIO; + if (err != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto out; } /* Modified: head/sys/arm/at91/if_macb.c ============================================================================== --- head/sys/arm/at91/if_macb.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/arm/at91/if_macb.c Fri Oct 15 15:00:30 2010 (r213894) @@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -1365,9 +1364,10 @@ macb_attach(device_t dev) write_4(sc, EMAC_NCR, MPE_ENABLE); //enable MPE sc->ifp = ifp = if_alloc(IFT_ETHER); - if (mii_phy_probe(dev, &sc->miibus, macb_ifmedia_upd, macb_ifmedia_sts)) { - device_printf(dev, "Cannot find my PHY.\n"); - err = ENXIO; + err = mii_attach(dev, &sc->miibus, ifp, macb_ifmedia_upd, + macb_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (err != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto out; } Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/dev/bce/if_bce.c Fri Oct 15 15:00:30 2010 (r213894) @@ -1140,12 +1140,13 @@ bce_attach(device_t dev) /* Handle any special PHY initialization for SerDes PHYs. */ bce_init_media(sc); - /* MII child bus by probing the PHY. */ - if (mii_phy_probe(dev, &sc->bce_miibus, bce_ifmedia_upd, - bce_ifmedia_sts)) { - BCE_PRINTF("%s(%d): No PHY found on child MII bus!\n", - __FILE__, __LINE__); - rc = ENXIO; + /* MII child bus by attaching the PHY. */ + rc = mii_attach(dev, &sc->bce_miibus, ifp, bce_ifmedia_upd, + bce_ifmedia_sts, BMSR_DEFCAPMASK, sc->bce_phy_addr, + MII_OFFSET_ANY, 0); + if (rc != 0) { + BCE_PRINTF("%s(%d): attaching PHYs failed\n", __FILE__, + __LINE__); goto bce_attach_fail; } Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/dev/ed/if_ed_pccard.c Fri Oct 15 15:00:30 2010 (r213894) @@ -578,25 +578,21 @@ ed_pccard_attach(device_t dev) goto bad; if (sc->chip_type == ED_CHIP_TYPE_DL10019 || sc->chip_type == ED_CHIP_TYPE_DL10022) { - /* Probe for an MII bus, but ignore errors. */ + /* Try to attach an MII bus, but ignore errors. */ ed_pccard_dl100xx_mii_reset(sc); - (void)mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd, - ed_ifmedia_sts); + (void)mii_attach(dev, &sc->miibus, sc->ifp, ed_ifmedia_upd, + ed_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, + MII_OFFSET_ANY, 0); } else if (sc->chip_type == ED_CHIP_TYPE_AX88190 || - sc->chip_type == ED_CHIP_TYPE_AX88790) { - if ((error = mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd, - ed_ifmedia_sts)) != 0) { - device_printf(dev, "Missing mii %d!\n", error); + sc->chip_type == ED_CHIP_TYPE_AX88790 || + sc->chip_type == ED_CHIP_TYPE_TC5299J) { + error = mii_attach(dev, &sc->miibus, sc->ifp, ed_ifmedia_upd, + ed_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, + MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto bad; } - - } else if (sc->chip_type == ED_CHIP_TYPE_TC5299J) { - if ((error = mii_phy_probe(dev, &sc->miibus, ed_ifmedia_upd, - ed_ifmedia_sts)) != 0) { - device_printf(dev, "Missing mii!\n"); - goto bad; - } - } if (sc->miibus != NULL) { sc->sc_tick = ed_pccard_tick; Modified: head/sys/dev/et/if_et.c ============================================================================== --- head/sys/dev/et/if_et.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/dev/et/if_et.c Fri Oct 15 15:00:30 2010 (r213894) @@ -63,8 +63,8 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include #include #include @@ -343,10 +343,10 @@ et_attach(device_t dev) et_chip_attach(sc); - error = mii_phy_probe(dev, &sc->sc_miibus, - et_ifmedia_upd, et_ifmedia_sts); + error = mii_attach(dev, &sc->sc_miibus, ifp, et_ifmedia_upd, + et_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); if (error) { - device_printf(dev, "can't probe any PHY\n"); + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: head/sys/dev/lge/if_lge.c ============================================================================== --- head/sys/dev/lge/if_lge.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/dev/lge/if_lge.c Fri Oct 15 15:00:30 2010 (r213894) @@ -557,10 +557,10 @@ lge_attach(dev) /* * Do MII setup. */ - if (mii_phy_probe(dev, &sc->lge_miibus, - lge_ifmedia_upd, lge_ifmedia_sts)) { - device_printf(dev, "MII without any PHY!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->lge_miibus, ifp, lge_ifmedia_upd, + lge_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/dev/nfe/if_nfe.c Fri Oct 15 15:00:30 2010 (r213894) @@ -600,10 +600,10 @@ nfe_attach(device_t dev) #endif /* Do MII setup */ - if (mii_phy_probe(dev, &sc->nfe_miibus, nfe_ifmedia_upd, - nfe_ifmedia_sts)) { - device_printf(dev, "MII without any phy!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->nfe_miibus, ifp, nfe_ifmedia_upd, + nfe_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } ether_ifattach(ifp, sc->eaddr); Modified: head/sys/dev/nge/if_nge.c ============================================================================== --- head/sys/dev/nge/if_nge.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/dev/nge/if_nge.c Fri Oct 15 15:00:30 2010 (r213894) @@ -1079,10 +1079,10 @@ nge_attach(device_t dev) /* * Do MII setup. */ - error = mii_phy_probe(dev, &sc->nge_miibus, nge_mediachange, - nge_mediastatus); + error = mii_attach(dev, &sc->nge_miibus, ifp, nge_mediachange, + nge_mediastatus, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); if (error != 0) { - device_printf(dev, "no PHY found!\n"); + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: head/sys/dev/nve/if_nve.c ============================================================================== --- head/sys/dev/nve/if_nve.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/dev/nve/if_nve.c Fri Oct 15 15:00:30 2010 (r213894) @@ -541,11 +541,12 @@ nve_attach(device_t dev) ifp->if_capabilities |= IFCAP_VLAN_MTU; ifp->if_capenable |= IFCAP_VLAN_MTU; - /* Probe device for MII interface to PHY */ - DEBUGOUT(NVE_DEBUG_INIT, "nve: do mii_phy_probe\n"); - if (mii_phy_probe(dev, &sc->miibus, nve_ifmedia_upd, nve_ifmedia_sts)) { - device_printf(dev, "MII without any phy!\n"); - error = ENXIO; + /* Attach device for MII interface to PHY */ + DEBUGOUT(NVE_DEBUG_INIT, "nve: do mii_attach\n"); + error = mii_attach(dev, &sc->miibus, ifp, nve_ifmedia_upd, + nve_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } @@ -553,10 +554,10 @@ nve_attach(device_t dev) ether_ifattach(ifp, eaddr); /* Activate our interrupt handler. - attach last to avoid lock */ - error = bus_setup_intr(sc->dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, + error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET | INTR_MPSAFE, NULL, nve_intr, sc, &sc->sc_ih); if (error) { - device_printf(sc->dev, "couldn't set up interrupt handler\n"); + device_printf(dev, "couldn't set up interrupt handler\n"); goto fail; } DEBUGOUT(NVE_DEBUG_INIT, "nve: nve_attach - exit\n"); Modified: head/sys/dev/sf/if_sf.c ============================================================================== --- head/sys/dev/sf/if_sf.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/dev/sf/if_sf.c Fri Oct 15 15:00:30 2010 (r213894) @@ -866,10 +866,10 @@ sf_attach(device_t dev) } /* Do MII setup. */ - if (mii_phy_probe(dev, &sc->sf_miibus, sf_ifmedia_upd, - sf_ifmedia_sts)) { - device_printf(dev, "MII without any phy!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->sf_miibus, ifp, sf_ifmedia_upd, + sf_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: head/sys/dev/sge/if_sge.c ============================================================================== --- head/sys/dev/sge/if_sge.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/dev/sge/if_sge.c Fri Oct 15 15:00:30 2010 (r213894) @@ -627,10 +627,10 @@ sge_attach(device_t dev) /* * Do MII setup. */ - if (mii_phy_probe(dev, &sc->sge_miibus, sge_ifmedia_upd, - sge_ifmedia_sts)) { - device_printf(dev, "no PHY found!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->sge_miibus, ifp, sge_ifmedia_upd, + sge_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: head/sys/dev/sis/if_sis.c ============================================================================== --- head/sys/dev/sis/if_sis.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/dev/sis/if_sis.c Fri Oct 15 15:00:30 2010 (r213894) @@ -1164,10 +1164,10 @@ sis_attach(device_t dev) /* * Do MII setup. */ - if (mii_phy_probe(dev, &sc->sis_miibus, - sis_ifmedia_upd, sis_ifmedia_sts)) { - device_printf(dev, "MII without any PHY!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->sis_miibus, ifp, sis_ifmedia_upd, + sis_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: head/sys/dev/smc/if_smc.c ============================================================================== --- head/sys/dev/smc/if_smc.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/dev/smc/if_smc.c Fri Oct 15 15:00:30 2010 (r213894) @@ -324,8 +324,9 @@ smc_attach(device_t dev) callout_init_mtx(&sc->smc_mii_tick_ch, &sc->smc_mtx, CALLOUT_RETURNUNLOCKED); if (sc->smc_chip >= REV_CHIP_91110FD) { - mii_phy_probe(dev, &sc->smc_miibus, smc_mii_ifmedia_upd, - smc_mii_ifmedia_sts); + (void)mii_attach(dev, &sc->smc_miibus, ifp, + smc_mii_ifmedia_upd, smc_mii_ifmedia_sts, BMSR_DEFCAPMASK, + MII_PHY_ANY, MII_OFFSET_ANY, 0); if (sc->smc_miibus != NULL) { sc->smc_mii_tick = smc_mii_tick; sc->smc_mii_mediachg = smc_mii_mediachg; Modified: head/sys/dev/tl/if_tl.c ============================================================================== --- head/sys/dev/tl/if_tl.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/dev/tl/if_tl.c Fri Oct 15 15:00:30 2010 (r213894) @@ -1276,9 +1276,11 @@ tl_attach(dev) * Do MII setup. If no PHYs are found, then this is a * bitrate ThunderLAN chip that only supports 10baseT * and AUI/BNC. + * XXX mii_attach() can fail for reason different than + * no PHYs found! */ - if (mii_phy_probe(dev, &sc->tl_miibus, - tl_ifmedia_upd, tl_ifmedia_sts)) { + if (mii_attach(dev, &sc->tl_miibus, ifp, tl_ifmedia_upd, + tl_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0)) { struct ifmedia *ifm; sc->tl_bitrate = 1; ifmedia_init(&sc->ifmedia, 0, tl_ifmedia_upd, tl_ifmedia_sts); Modified: head/sys/dev/tx/if_tx.c ============================================================================== --- head/sys/dev/tx/if_tx.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/dev/tx/if_tx.c Fri Oct 15 15:00:30 2010 (r213894) @@ -379,10 +379,10 @@ epic_attach(device_t dev) device_printf(dev, "unknown card vendor %04xh\n", sc->cardvend); /* Do ifmedia setup. */ - if (mii_phy_probe(dev, &sc->miibus, - epic_ifmedia_upd, epic_ifmedia_sts)) { - device_printf(dev, "ERROR! MII without any PHY!?\n"); - error = ENXIO; + error = mii_attach(dev, &sc->miibus, ifp, epic_ifmedia_upd, + epic_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: head/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- head/sys/dev/usb/net/usb_ethernet.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/dev/usb/net/usb_ethernet.c Fri Oct 15 15:00:30 2010 (r213894) @@ -222,11 +222,12 @@ ue_attach_post_task(struct usb_proc_msg if (ue->ue_methods->ue_mii_upd != NULL && ue->ue_methods->ue_mii_sts != NULL) { mtx_lock(&Giant); /* device_xxx() depends on this */ - error = mii_phy_probe(ue->ue_dev, &ue->ue_miibus, - ue_ifmedia_upd, ue->ue_methods->ue_mii_sts); + error = mii_attach(ue->ue_dev, &ue->ue_miibus, ifp, + ue_ifmedia_upd, ue->ue_methods->ue_mii_sts, + BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); mtx_unlock(&Giant); if (error) { - device_printf(ue->ue_dev, "MII without any PHY\n"); + device_printf(ue->ue_dev, "attaching PHYs failed\n"); goto error; } } Modified: head/sys/dev/wb/if_wb.c ============================================================================== --- head/sys/dev/wb/if_wb.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/dev/wb/if_wb.c Fri Oct 15 15:00:30 2010 (r213894) @@ -855,9 +855,10 @@ wb_attach(dev) /* * Do MII setup. */ - if (mii_phy_probe(dev, &sc->wb_miibus, - wb_ifmedia_upd, wb_ifmedia_sts)) { - error = ENXIO; + error = mii_attach(dev, &sc->wb_miibus, ifp, wb_ifmedia_upd, + wb_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/mips/atheros/if_arge.c Fri Oct 15 15:00:30 2010 (r213894) @@ -424,10 +424,11 @@ arge_attach(device_t dev) if (phys_total == 1) { /* Do MII setup. */ - if (mii_phy_probe(dev, &sc->arge_miibus, - arge_ifmedia_upd, arge_ifmedia_sts)) { - device_printf(dev, "MII without any phy!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->arge_miibus, ifp, + arge_ifmedia_upd, arge_ifmedia_sts, BMSR_DEFCAPMASK, + MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } } Modified: head/sys/mips/idt/if_kr.c ============================================================================== --- head/sys/mips/idt/if_kr.c Fri Oct 15 14:52:11 2010 (r213893) +++ head/sys/mips/idt/if_kr.c Fri Oct 15 15:00:30 2010 (r213894) @@ -265,10 +265,10 @@ kr_attach(device_t dev) CSR_WRITE_4(sc, KR_MIIMCFG, 0); /* Do MII setup. */ - if (mii_phy_probe(dev, &sc->kr_miibus, - kr_ifmedia_upd, kr_ifmedia_sts)) { - device_printf(dev, "MII without any phy!\n"); - error = ENXIO; + error = mii_attach(dev, &sc->kr_miibus, ifp, kr_ifmedia_upd, + kr_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); goto fail; } From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 15:06:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62B23106564A; Fri, 15 Oct 2010 15:06:32 +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 50CC78FC13; Fri, 15 Oct 2010 15:06:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FF6WOI065165; Fri, 15 Oct 2010 15:06:32 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FF6WxG065163; Fri, 15 Oct 2010 15:06:32 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201010151506.o9FF6WxG065163@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Fri, 15 Oct 2010 15:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213895 - stable/7/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 15:06:32 -0000 Author: bz Date: Fri Oct 15 15:06:32 2010 New Revision: 213895 URL: http://svn.freebsd.org/changeset/base/213895 Log: MFC r186391,186483,186497 (qingli, kmacy 21 months ago): r186391: Provide a condition variable to delay the cloned interface destroy operation until the referenced clone device has been closed by the process properly. The behavior is now consistently with the previous release. r186483: - Close a race during which the open flag could be cleared but the tun_softc would still be referenced by adding a separate TUN_CLOSED flag that is set after tunclose is done referencing it. - drop the tun_mtx after the flag check to avoid holding it across if_detach which can recurse in to if_tun.c r186497: The "tun?" dev need not be opened at all. One is allowed to perform the following operations, e.g.: 1) ifconfig tun0 create 2) ifconfig tun0 10.1.1.1 10.1.1.2 3) route add -net 192.103.54.0/24 -iface tun0 4) ifconfig tun0 destroy If cv wait on the TUN_CLOSED flag, then the last operation (4) will block forever. Revert the previous changes and fix the mtx_unlock() leak. PR: kern/116837 Submitted by: Mikolaj Golub (to.my.trociny gmail.com) (Not used the patch, just did the MFC) Modified: stable/7/sys/net/if_tun.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/net/if_tun.c ============================================================================== --- stable/7/sys/net/if_tun.c Fri Oct 15 15:00:30 2010 (r213894) +++ stable/7/sys/net/if_tun.c Fri Oct 15 15:06:32 2010 (r213895) @@ -56,6 +56,7 @@ #include #include +#include #include @@ -92,6 +93,7 @@ struct tun_softc { struct sigio *tun_sigio; /* information for async I/O */ struct selinfo tun_rsel; /* read select */ struct mtx tun_mtx; /* protect mutable softc fields */ + struct cv tun_cv; /* protect against ref'd dev destroy */ }; #define TUN2IFP(sc) ((sc)->tun_ifp) @@ -242,8 +244,11 @@ tun_destroy(struct tun_softc *tp) struct cdev *dev; /* Unlocked read. */ - KASSERT((tp->tun_flags & TUN_OPEN) == 0, - ("tununits is out of sync - unit %d", TUN2IFP(tp)->if_dunit)); + mtx_lock(&tp->tun_mtx); + if ((tp->tun_flags & TUN_OPEN) != 0) + cv_wait_unlock(&tp->tun_cv, &tp->tun_mtx); + else + mtx_unlock(&tp->tun_mtx); dev = tp->tun_dev; bpfdetach(TUN2IFP(tp)); @@ -252,6 +257,7 @@ tun_destroy(struct tun_softc *tp) destroy_dev(dev); knlist_destroy(&tp->tun_rsel.si_note); mtx_destroy(&tp->tun_mtx); + cv_destroy(&tp->tun_cv); free(tp, M_TUN); } @@ -353,6 +359,7 @@ tuncreate(const char *name, struct cdev MALLOC(sc, struct tun_softc *, sizeof(*sc), M_TUN, M_WAITOK | M_ZERO); mtx_init(&sc->tun_mtx, "tun_mtx", NULL, MTX_DEF); + cv_init(&sc->tun_cv, "tun_condvar"); sc->tun_flags = TUN_INITED; sc->tun_dev = dev; mtx_lock(&tunmtx); @@ -472,6 +479,8 @@ tunclose(struct cdev *dev, int foo, int selwakeuppri(&tp->tun_rsel, PZERO + 1); KNOTE_LOCKED(&tp->tun_rsel.si_note, 0); TUNDEBUG (ifp, "closed\n"); + + cv_broadcast(&tp->tun_cv); mtx_unlock(&tp->tun_mtx); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 15:16:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4010E106564A; Fri, 15 Oct 2010 15:16:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EE418FC16; Fri, 15 Oct 2010 15:16:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FFGbv9065403; Fri, 15 Oct 2010 15:16:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FFGb42065401; Fri, 15 Oct 2010 15:16:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010151516.o9FFGb42065401@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Oct 2010 15:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213896 - head/sys/arm/at91 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 15:16:37 -0000 Author: marius Date: Fri Oct 15 15:16:36 2010 New Revision: 213896 URL: http://svn.freebsd.org/changeset/base/213896 Log: Remove a device_printf() accidentally left in r213894. Submitted by: jhb Modified: head/sys/arm/at91/if_ate.c Modified: head/sys/arm/at91/if_ate.c ============================================================================== --- head/sys/arm/at91/if_ate.c Fri Oct 15 15:06:32 2010 (r213895) +++ head/sys/arm/at91/if_ate.c Fri Oct 15 15:16:36 2010 (r213896) @@ -320,7 +320,6 @@ ate_attach(device_t dev) sc->ifp = ifp = if_alloc(IFT_ETHER); err = mii_attach(dev, &sc->miibus, ifp, ate_ifmedia_upd, ate_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); - device_printf(dev, "Cannot find my PHY.\n"); if (err != 0) { device_printf(dev, "attaching PHYs failed\n"); goto out; From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 15:23:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11E29106564A; Fri, 15 Oct 2010 15:23:35 +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 010198FC23; Fri, 15 Oct 2010 15:23:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FFNYd0065622; Fri, 15 Oct 2010 15:23:34 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FFNYsU065620; Fri, 15 Oct 2010 15:23:34 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201010151523.o9FFNYsU065620@svn.freebsd.org> From: Alan Cox Date: Fri, 15 Oct 2010 15:23:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213897 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 15:23:35 -0000 Author: alc Date: Fri Oct 15 15:23:34 2010 New Revision: 213897 URL: http://svn.freebsd.org/changeset/base/213897 Log: Update pmap_extract() to handle 1GB page mappings. Some device drivers use pmap_extract() rather than pmap_kextract() on direct map addresses. Thus, pmap_extract() needs to be able to deal with 1GB page mappings if we are to use 1GB page mappings for the direct map. (See r197580.) Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Oct 15 15:16:36 2010 (r213896) +++ head/sys/amd64/amd64/pmap.c Fri Oct 15 15:23:34 2010 (r213897) @@ -1163,26 +1163,33 @@ pmap_is_current(pmap_t pmap) vm_paddr_t pmap_extract(pmap_t pmap, vm_offset_t va) { - vm_paddr_t rtval; + pdp_entry_t *pdpe; + pd_entry_t *pde; pt_entry_t *pte; - pd_entry_t pde, *pdep; + vm_paddr_t pa; - rtval = 0; + pa = 0; PMAP_LOCK(pmap); - pdep = pmap_pde(pmap, va); - if (pdep != NULL) { - pde = *pdep; - if (pde) { - if ((pde & PG_PS) != 0) - rtval = (pde & PG_PS_FRAME) | (va & PDRMASK); - else { - pte = pmap_pde_to_pte(pdep, va); - rtval = (*pte & PG_FRAME) | (va & PAGE_MASK); + pdpe = pmap_pdpe(pmap, va); + if (pdpe != NULL && (*pdpe & PG_V) != 0) { + if ((*pdpe & PG_PS) != 0) + pa = (*pdpe & PG_PS_FRAME) | (va & PDPMASK); + else { + pde = pmap_pdpe_to_pde(pdpe, va); + if ((*pde & PG_V) != 0) { + if ((*pde & PG_PS) != 0) { + pa = (*pde & PG_PS_FRAME) | + (va & PDRMASK); + } else { + pte = pmap_pde_to_pte(pde, va); + pa = (*pte & PG_FRAME) | + (va & PAGE_MASK); + } } } } PMAP_UNLOCK(pmap); - return (rtval); + return (pa); } /* From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 15:24:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 807B1106564A; Fri, 15 Oct 2010 15:24:59 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F3F38FC13; Fri, 15 Oct 2010 15:24:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FFOxrW065705; Fri, 15 Oct 2010 15:24:59 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FFOxLl065702; Fri, 15 Oct 2010 15:24:59 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201010151524.o9FFOxLl065702@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 15 Oct 2010 15:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213898 - in head/sys: dev/mps modules/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 15:24:59 -0000 Author: mdf Date: Fri Oct 15 15:24:59 2010 New Revision: 213898 URL: http://svn.freebsd.org/changeset/base/213898 Log: Currently only opt_compat.h is included by the mps(4) driver. Also enable /dev/mps0, which was missing from my previous patches enabling f/w upload and download. opt_compat.h issue noticed by scottl. Modified: head/sys/dev/mps/mps.c head/sys/modules/mps/Makefile Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Fri Oct 15 15:23:34 2010 (r213897) +++ head/sys/dev/mps/mps.c Fri Oct 15 15:24:59 2010 (r213898) @@ -924,7 +924,10 @@ mps_attach(struct mps_softc *sc) /* Attach the subsystems so they can prepare their event masks. */ /* XXX Should be dynamic so that IM/IR and user modules can attach */ if (((error = mps_attach_log(sc)) != 0) || - ((error = mps_attach_sas(sc)) != 0)) { + ((error = mps_attach_sas(sc)) != 0) || + ((error = mps_attach_user(sc)) != 0)) { + mps_printf(sc, "%s failed to attach all subsystems: error %d\n", + __func__, error); mps_free(sc); return (error); } Modified: head/sys/modules/mps/Makefile ============================================================================== --- head/sys/modules/mps/Makefile Fri Oct 15 15:23:34 2010 (r213897) +++ head/sys/modules/mps/Makefile Fri Oct 15 15:24:59 2010 (r213898) @@ -4,7 +4,7 @@ KMOD= mps SRCS= mps_pci.c mps.c mps_sas.c mps_table.c mps_user.c -SRCS+= opt_mps.h opt_cam.h +SRCS+= opt_compat.h SRCS+= device_if.h bus_if.h pci_if.h #CFLAGS += -DMPS_DEBUG From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 15:37:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25F10106566B; Fri, 15 Oct 2010 15:37:17 +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 095298FC0C; Fri, 15 Oct 2010 15:37:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FFbGi9066073; Fri, 15 Oct 2010 15:37:16 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FFbG0u066069; Fri, 15 Oct 2010 15:37:16 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201010151537.o9FFbG0u066069@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 15 Oct 2010 15:37: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: r213899 - in stable/8: tools/regression/usr.bin/tr usr.bin/tr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 15:37:17 -0000 Author: jilles Date: Fri Oct 15 15:37:16 2010 New Revision: 213899 URL: http://svn.freebsd.org/changeset/base/213899 Log: MFC r213284: tr: Fix '[=]=]' equivalence class. A closing bracket immediately after '[=' should not be treated as special. Different from the submitted patch, a string ending with '[=' does not cause access beyond the terminating '\0'. PR: bin/150384 Submitted by: Richard Lowe Added: stable/8/tools/regression/usr.bin/tr/regress.0c.out - copied unchanged from r213284, head/tools/regression/usr.bin/tr/regress.0c.out stable/8/tools/regression/usr.bin/tr/regress.0d.out - copied unchanged from r213284, head/tools/regression/usr.bin/tr/regress.0d.out Modified: stable/8/tools/regression/usr.bin/tr/regress.sh stable/8/usr.bin/tr/str.c Directory Properties: stable/8/tools/regression/usr.bin/tr/ (props changed) stable/8/usr.bin/tr/ (props changed) Copied: stable/8/tools/regression/usr.bin/tr/regress.0c.out (from r213284, head/tools/regression/usr.bin/tr/regress.0c.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/usr.bin/tr/regress.0c.out Fri Oct 15 15:37:16 2010 (r213899, copy of r213284, head/tools/regression/usr.bin/tr/regress.0c.out) @@ -0,0 +1 @@ +[[[[ Copied: stable/8/tools/regression/usr.bin/tr/regress.0d.out (from r213284, head/tools/regression/usr.bin/tr/regress.0d.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/usr.bin/tr/regress.0d.out Fri Oct 15 15:37:16 2010 (r213899, copy of r213284, head/tools/regression/usr.bin/tr/regress.0d.out) @@ -0,0 +1 @@ + Modified: stable/8/tools/regression/usr.bin/tr/regress.sh ============================================================================== --- stable/8/tools/regression/usr.bin/tr/regress.sh Fri Oct 15 15:24:59 2010 (r213898) +++ stable/8/tools/regression/usr.bin/tr/regress.sh Fri Oct 15 15:37:16 2010 (r213899) @@ -1,6 +1,6 @@ # $FreeBSD$ -echo 1..12 +echo 1..14 REGRESSION_START($1) @@ -16,5 +16,7 @@ REGRESSION_TEST(`08', `tr "[[:upper:]]" REGRESSION_TEST(`09', `printf "\\f\\r\\n" | tr "\\014\\r" "?#"') REGRESSION_TEST(`0a', `printf "0xdeadbeef\\n" | tr "x[[:xdigit:]]" "?\$"') REGRESSION_TEST(`0b', `(tr -cd "[[:xdigit:]]" < regress2.in ; echo)') +REGRESSION_TEST(`0c', `echo "[[[[]]]]" | tr -d "[=]=]"') +REGRESSION_TEST(`0d', `echo "]=[" | tr -d "[=]"') REGRESSION_END() Modified: stable/8/usr.bin/tr/str.c ============================================================================== --- stable/8/usr.bin/tr/str.c Fri Oct 15 15:24:59 2010 (r213898) +++ stable/8/usr.bin/tr/str.c Fri Oct 15 15:37:16 2010 (r213899) @@ -156,7 +156,7 @@ bracket(s) s->str = p + 1; return (1); case '=': /* "[=equiv=]" */ - if ((p = strchr(s->str + 2, ']')) == NULL) + if (s->str[2] == '\0' || (p = strchr(s->str + 3, ']')) == NULL) return (0); if (*(p - 1) != '=' || p - s->str < 4) goto repeat; From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 15:46:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 091AB10656C0; Fri, 15 Oct 2010 15:46:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D37638FC15; Fri, 15 Oct 2010 15:46:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FFkw8Z066336; Fri, 15 Oct 2010 15:46:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FFkwA7066332; Fri, 15 Oct 2010 15:46:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010151546.o9FFkwA7066332@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Oct 2010 15:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213900 - in head/sys: dev/mii modules/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 15:46:59 -0000 Author: marius Date: Fri Oct 15 15:46:58 2010 New Revision: 213900 URL: http://svn.freebsd.org/changeset/base/213900 Log: Now that all previous users of mii_phy_probe() have been converted in r213893 and r213894 to use mii_attach() instead remove the former and along with it the "EVIL HACK". MFC after: never Modified: head/sys/dev/mii/mii.c head/sys/dev/mii/miivar.h head/sys/modules/mii/Makefile Modified: head/sys/dev/mii/mii.c ============================================================================== --- head/sys/dev/mii/mii.c Fri Oct 15 15:37:16 2010 (r213899) +++ head/sys/dev/mii/mii.c Fri Oct 15 15:46:58 2010 (r213900) @@ -454,21 +454,6 @@ mii_attach(device_t dev, device_t *miibu return (rv); } -int -mii_phy_probe(device_t dev, device_t *child, ifm_change_cb_t ifmedia_upd, - ifm_stat_cb_t ifmedia_sts) -{ - struct ifnet *ifp; - - /* - * Note that each NIC's softc must start with an ifnet pointer. - * XXX: EVIL HACK! - */ - ifp = *(struct ifnet **)device_get_softc(dev); - return (mii_attach(dev, child, ifp, ifmedia_upd, ifmedia_sts, - BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0)); -} - /* * Media changed; notify all PHYs. */ Modified: head/sys/dev/mii/miivar.h ============================================================================== --- head/sys/dev/mii/miivar.h Fri Oct 15 15:37:16 2010 (r213899) +++ head/sys/dev/mii/miivar.h Fri Oct 15 15:46:58 2010 (r213900) @@ -232,7 +232,6 @@ void mii_down(struct mii_data *); int mii_mediachg(struct mii_data *); void mii_tick(struct mii_data *); void mii_pollstat(struct mii_data *); -int mii_phy_probe(device_t, device_t *, ifm_change_cb_t, ifm_stat_cb_t); void mii_add_media(struct mii_softc *); void mii_phy_add_media(struct mii_softc *); Modified: head/sys/modules/mii/Makefile ============================================================================== --- head/sys/modules/mii/Makefile Fri Oct 15 15:37:16 2010 (r213899) +++ head/sys/modules/mii/Makefile Fri Oct 15 15:46:58 2010 (r213900) @@ -14,7 +14,6 @@ SRCS+= xmphy.c EXPORT_SYMS= mii_attach \ mii_mediachg \ - mii_phy_probe \ mii_phy_reset \ mii_pollstat \ mii_tick From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 17:56:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6ADE1065706; Fri, 15 Oct 2010 17:56:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B3E5C8FC1A; Fri, 15 Oct 2010 17:56:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FHupCv069855; Fri, 15 Oct 2010 17:56:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FHupdQ069850; Fri, 15 Oct 2010 17:56:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010151756.o9FHupdQ069850@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 15 Oct 2010 17:56: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: r213901 - in stable/8/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 17:56:52 -0000 Author: kib Date: Fri Oct 15 17:56:51 2010 New Revision: 213901 URL: http://svn.freebsd.org/changeset/base/213901 Log: MFC r209862: For both i386 and amd64 pmap, - change the type of pm_active to cpumask_t, which it is; - in pmap_remove_pages(), compare with PCPU(curpmap), instead of dereferencing the long chain of pointers [1]. For amd64 pmap, remove the unneeded checks for validity of curpmap in pmap_activate(), since curpmap should be always valid after r209789. Modified: stable/8/sys/amd64/amd64/pmap.c stable/8/sys/amd64/include/pmap.h stable/8/sys/i386/i386/pmap.c stable/8/sys/i386/include/pmap.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/amd64/pmap.c ============================================================================== --- stable/8/sys/amd64/amd64/pmap.c Fri Oct 15 15:46:58 2010 (r213900) +++ stable/8/sys/amd64/amd64/pmap.c Fri Oct 15 17:56:51 2010 (r213901) @@ -3948,7 +3948,7 @@ pmap_remove_pages(pmap_t pmap) uint64_t inuse, bitmask; int allfree; - if (pmap != vmspace_pmap(curthread->td_proc->p_vmspace)) { + if (pmap != PCPU_GET(curpmap)) { printf("warning: pmap_remove_pages called with non-current pmap\n"); return; } @@ -4867,11 +4867,9 @@ pmap_activate(struct thread *td) pmap = vmspace_pmap(td->td_proc->p_vmspace); oldpmap = PCPU_GET(curpmap); #ifdef SMP -if (oldpmap) /* XXX FIXME */ atomic_clear_int(&oldpmap->pm_active, PCPU_GET(cpumask)); atomic_set_int(&pmap->pm_active, PCPU_GET(cpumask)); #else -if (oldpmap) /* XXX FIXME */ oldpmap->pm_active &= ~PCPU_GET(cpumask); pmap->pm_active |= PCPU_GET(cpumask); #endif Modified: stable/8/sys/amd64/include/pmap.h ============================================================================== --- stable/8/sys/amd64/include/pmap.h Fri Oct 15 15:46:58 2010 (r213900) +++ stable/8/sys/amd64/include/pmap.h Fri Oct 15 17:56:51 2010 (r213901) @@ -244,7 +244,7 @@ struct pmap { struct mtx pm_mtx; pml4_entry_t *pm_pml4; /* KVA of level 4 page table */ TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ - u_int pm_active; /* active on cpus */ + cpumask_t pm_active; /* active on cpus */ /* spare u_int here due to padding */ struct pmap_statistics pm_stats; /* pmap statistics */ vm_page_t pm_root; /* spare page table pages */ Modified: stable/8/sys/i386/i386/pmap.c ============================================================================== --- stable/8/sys/i386/i386/pmap.c Fri Oct 15 15:46:58 2010 (r213900) +++ stable/8/sys/i386/i386/pmap.c Fri Oct 15 17:56:51 2010 (r213901) @@ -4169,7 +4169,7 @@ pmap_remove_pages(pmap_t pmap) uint32_t inuse, bitmask; int allfree; - if (pmap != vmspace_pmap(curthread->td_proc->p_vmspace)) { + if (pmap != PCPU_GET(curpmap)) { printf("warning: pmap_remove_pages called with non-current pmap\n"); return; } Modified: stable/8/sys/i386/include/pmap.h ============================================================================== --- stable/8/sys/i386/include/pmap.h Fri Oct 15 15:46:58 2010 (r213900) +++ stable/8/sys/i386/include/pmap.h Fri Oct 15 17:56:51 2010 (r213901) @@ -417,7 +417,7 @@ struct pmap { struct mtx pm_mtx; pd_entry_t *pm_pdir; /* KVA of page directory */ TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ - u_int pm_active; /* active on cpus */ + cpumask_t pm_active; /* active on cpus */ struct pmap_statistics pm_stats; /* pmap statistics */ LIST_ENTRY(pmap) pm_list; /* List of all pmaps */ #ifdef PAE From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 18:07:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76830106567A; Fri, 15 Oct 2010 18:07:45 +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 57DDD8FC27; Fri, 15 Oct 2010 18:07:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FI7jHZ070351; Fri, 15 Oct 2010 18:07:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FI7jO3070349; Fri, 15 Oct 2010 18:07:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010151807.o9FI7jO3070349@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 15 Oct 2010 18:07: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: r213902 - stable/8/sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 18:07:45 -0000 Author: kib Date: Fri Oct 15 18:07:45 2010 New Revision: 213902 URL: http://svn.freebsd.org/changeset/base/213902 Log: MFC r209866: Fix spacing. Modified: stable/8/sys/i386/include/pmap.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/i386/include/pmap.h ============================================================================== --- stable/8/sys/i386/include/pmap.h Fri Oct 15 17:56:51 2010 (r213901) +++ stable/8/sys/i386/include/pmap.h Fri Oct 15 18:07:45 2010 (r213902) @@ -417,7 +417,7 @@ struct pmap { struct mtx pm_mtx; pd_entry_t *pm_pdir; /* KVA of page directory */ TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ - cpumask_t pm_active; /* active on cpus */ + cpumask_t pm_active; /* active on cpus */ struct pmap_statistics pm_stats; /* pmap statistics */ LIST_ENTRY(pmap) pm_list; /* List of all pmaps */ #ifdef PAE From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 18:50:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4615E106564A; Fri, 15 Oct 2010 18:50:51 +0000 (UTC) (envelope-from rpaulo@freebsd.org) Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33]) by mx1.freebsd.org (Postfix) with ESMTP id 184118FC1B; Fri, 15 Oct 2010 18:50:50 +0000 (UTC) Received: from c.earth.lavabit.com (c.earth.lavabit.com [192.168.111.12]) by karen.lavabit.com (Postfix) with ESMTP id 528EB15754E; Fri, 15 Oct 2010 13:50:50 -0500 (CDT) Received: from rui-macbook.lan (bl17-136-196.dsl.telepac.pt [188.82.136.196]) by lavabit.com with ESMTP id 29LBPQGH7N7C; Fri, 15 Oct 2010 13:50:50 -0500 References: <201010141919.o9EJJJIc034032@svn.freebsd.org> <201010141539.23573.jhb@freebsd.org> <4CB771A6.1070103@FreeBSD.org> <201010150845.22576.jhb@freebsd.org> In-Reply-To: <201010150845.22576.jhb@freebsd.org> Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii Message-Id: <96F4E353-55A6-48E6-BA20-92720EC2C4E7@freebsd.org> Content-Transfer-Encoding: quoted-printable From: Rui Paulo Date: Fri, 15 Oct 2010 19:50:46 +0100 To: John Baldwin X-Mailer: Apple Mail (2.1081) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric Subject: Re: svn commit: r213845 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 18:50:51 -0000 On 15 Oct 2010, at 13:45, John Baldwin wrote: > On Thursday, October 14, 2010 5:09:58 pm Dimitry Andric wrote: >> On 2010-10-14 21:39, John Baldwin wrote: >>> On Thursday, October 14, 2010 3:19:19 pm Rui Paulo wrote: >> ... >>>> Revert r213765. This is required because our build infrastructure = uses >>>> the host lex instead of the lex built during buildworld. I will = MFC the >>>> lex changes soon and in a few weeks this I'll commit again = r213765. >>> Can't you make 'lex' a build-tool to workaround this? >>=20 >> That will not help for "cd conf/CONF && make kernel", apparently. It >> will always use the host lex. >=20 > Well, yes, but that is always true. build-tools are only used for > buildkernel. However, if an 8.x lex cannot build a 9.x kernel, then = having > lex be a build-tool (or cross-tool, ru@ knows which category better = than I) > will let a 'make kernel-toolchain' followed by 'make buildkernel' of a = 9.x > source tree work on an 8.x host. Yes, but I was told that 'cd conf/CONF && make kernel' is a supported = configuration (without requiring kernel-toolchain first). Regards, -- Rui Paulo From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 20:01:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53E081065672; Fri, 15 Oct 2010 20:01:36 +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 427CC8FC17; Fri, 15 Oct 2010 20:01:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FK1an1076705; Fri, 15 Oct 2010 20:01:36 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FK1a9C076703; Fri, 15 Oct 2010 20:01:36 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201010152001.o9FK1a9C076703@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 15 Oct 2010 20:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213903 - head/tools/regression/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 20:01:36 -0000 Author: jilles Date: Fri Oct 15 20:01:35 2010 New Revision: 213903 URL: http://svn.freebsd.org/changeset/base/213903 Log: sh: Allow running 'prove' from tools/regression/bin/sh again without needing to set special environment variables, testing the 'sh' from PATH. Modified: head/tools/regression/bin/sh/regress.t Modified: head/tools/regression/bin/sh/regress.t ============================================================================== --- head/tools/regression/bin/sh/regress.t Fri Oct 15 18:07:45 2010 (r213902) +++ head/tools/regression/bin/sh/regress.t Fri Oct 15 20:01:35 2010 (r213903) @@ -1,11 +1,7 @@ #!/bin/sh # $FreeBSD$ -if [ -z "${SH}" ]; then - echo '${SH} is not set, please correct and re-run.' - exit 1 -fi -export SH=${SH} +export SH="${SH:-sh}" cd `dirname $0` From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 20:08:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18C66106564A; Fri, 15 Oct 2010 20:08:17 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 053A88FC08; Fri, 15 Oct 2010 20:08:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FK8Ge8076913; Fri, 15 Oct 2010 20:08:16 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FK8GBl076905; Fri, 15 Oct 2010 20:08:16 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201010152008.o9FK8GBl076905@svn.freebsd.org> From: Andreas Tobler Date: Fri, 15 Oct 2010 20:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213904 - in head/sys: conf dev/iicbus powerpc/conf powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 20:08:17 -0000 Author: andreast Date: Fri Oct 15 20:08:16 2010 New Revision: 213904 URL: http://svn.freebsd.org/changeset/base/213904 Log: Add three new drivers for fan control and temperature reading on the PowerMac7,2. - The fcu driver lets us read and write the fan RPMs for all fans in the PowerMac7,2. This driver is PowerMac specific. - The ds1775 is a driver to read the temperature for the drive bay sensor. - The max6690 is another driver to read temperatures. Here it is used to read the inlet, the backside and the U3 heatsink temperature. An additional driver, the ad7417, will follow later. Thanks to nwhitehorn for guiding me through this driver development. Approved by: nwhitehorn (mentor) Added: head/sys/dev/iicbus/ds1775.c (contents, props changed) head/sys/dev/iicbus/max6690.c (contents, props changed) head/sys/powerpc/powermac/fcu.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/conf/NOTES Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Fri Oct 15 20:01:35 2010 (r213903) +++ head/sys/conf/files.powerpc Fri Oct 15 20:08:16 2010 (r213904) @@ -26,6 +26,8 @@ dev/cfi/cfi_bus_fdt.c optional cfi fdt dev/fb/fb.c optional sc dev/fdt/fdt_powerpc.c optional fdt dev/hwpmc/hwpmc_powerpc.c optional hwpmc +dev/iicbus/ds1775.c optional ds1775 powermac +dev/iicbus/max6690.c optional max6690 powermac dev/kbd/kbd.c optional sc dev/mem/memutil.c optional mem dev/ofw/openfirm.c optional aim | fdt @@ -138,6 +140,7 @@ powerpc/powermac/ata_dbdma.c optional po powerpc/powermac/cuda.c optional powermac cuda powerpc/powermac/cpcht.c optional powermac pci powerpc/powermac/dbdma.c optional powermac pci +powerpc/powermac/fcu.c optional powermac fcu powerpc/powermac/grackle.c optional powermac pci powerpc/powermac/hrowpic.c optional powermac pci powerpc/powermac/kiic.c optional powermac kiic Added: head/sys/dev/iicbus/ds1775.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/ds1775.c Fri Oct 15 20:08:16 2010 (r213904) @@ -0,0 +1,255 @@ +/*- + * Copyright (c) 2010 Andreas Tobler + * 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 ``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 BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#define FCU_ZERO_C_TO_K 2732 + +/* Drivebay sensor: LM75/DS1775. */ +#define DS1775_TEMP 0x0 + +struct ds1775_sensor { + char location[32]; +}; + +/* Regular bus attachment functions */ +static int ds1775_probe(device_t); +static int ds1775_attach(device_t); + +/* Utility functions */ +static int ds1775_sensor_sysctl(SYSCTL_HANDLER_ARGS); +static void ds1775_start(void *xdev); +static int ds1775_read_2(device_t dev, uint32_t addr, uint8_t reg, + uint16_t *data); + +struct ds1775_softc { + device_t sc_dev; + struct intr_config_hook enum_hook; + uint32_t sc_addr; + struct ds1775_sensor *sc_sensors; + +}; +static device_method_t ds1775_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ds1775_probe), + DEVMETHOD(device_attach, ds1775_attach), + { 0, 0 }, +}; + +static driver_t ds1775_driver = { + "ds1775", + ds1775_methods, + sizeof(struct ds1775_softc) +}; + +static devclass_t ds1775_devclass; + +DRIVER_MODULE(ds1755, iicbus, ds1775_driver, ds1775_devclass, 0, 0); +MALLOC_DEFINE(M_DS1775, "ds1775", "Temp-Monitor DS1775"); + +static int +ds1775_read_2(device_t dev, uint32_t addr, uint8_t reg, uint16_t *data) +{ + uint8_t buf[4]; + + struct iic_msg msg[2] = { + { addr, IIC_M_WR | IIC_M_NOSTOP, 1, ® }, + { addr, IIC_M_RD, 2, buf }, + }; + + if (iicbus_transfer(dev, msg, 2) != 0) { + device_printf(dev, "iicbus read failed\n"); + return (EIO); + } + + *data = *((uint16_t*)buf); + + return (0); +} + +static int +ds1775_probe(device_t dev) +{ + const char *name, *compatible; + struct ds1775_softc *sc; + + name = ofw_bus_get_name(dev); + compatible = ofw_bus_get_compat(dev); + + if (!name) + return (ENXIO); + + if (strcmp(name, "temp-monitor") != 0 || + strcmp(compatible, "ds1775") != 0) + return (ENXIO); + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_addr = iicbus_get_addr(dev); + + device_set_desc(dev, "Temp-Monitor DS1755"); + + return (0); +} + +static int +ds1775_attach(device_t dev) +{ + struct ds1775_softc *sc; + + sc = device_get_softc(dev); + + sc->enum_hook.ich_func = ds1775_start; + sc->enum_hook.ich_arg = dev; + + /* We have to wait until interrupts are enabled. I2C read and write + * only works if the interrupts are available. + * The unin/i2c is controlled by the htpic on unin. But this is not + * the master. The openpic on mac-io is controlling the htpic. + * This one gets attached after the mac-io probing and then the + * interrupts will be available. + */ + + if (config_intrhook_establish(&sc->enum_hook) != 0) + return (ENOMEM); + + return (0); +} + +static void +ds1775_start(void *xdev) +{ + phandle_t child; + struct ds1775_softc *sc; + struct ds1775_sensor *sens; + struct sysctl_oid *sensroot_oid; + struct sysctl_ctx_list *ctx; + int i; + char sysctl_name[40], sysctl_desc[40]; + const char *units; + + device_t dev = (device_t)xdev; + + sc = device_get_softc(dev); + + child = ofw_bus_get_node(dev); + + sc->sc_sensors = malloc (sizeof(struct ds1775_sensor), + M_DS1775, M_WAITOK | M_ZERO); + + sens = sc->sc_sensors; + + ctx = device_get_sysctl_ctx(dev); + sensroot_oid = device_get_sysctl_tree(dev); + + OF_getprop(child, "hwsensor-location", sens->location, + sizeof(sens->location)); + units = "C"; + + for (i = 0; i < strlen(sens->location); i++) { + sysctl_name[i] = tolower(sens->location[i]); + if (isspace(sysctl_name[i])) + sysctl_name[i] = '_'; + } + sysctl_name[i] = 0; + + sprintf(sysctl_desc,"%s (%s)", sens->location, units); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(sensroot_oid), OID_AUTO, + sysctl_name, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, dev, + 0, ds1775_sensor_sysctl, "IK", sysctl_desc); + + config_intrhook_disestablish(&sc->enum_hook); +} + +static int +ds1775_sensor_read(device_t dev, struct ds1775_sensor *sens, int *temp) +{ + struct ds1775_softc *sc; + uint16_t buf[2]; + uint16_t read; + + sc = device_get_softc(dev); + + ds1775_read_2(sc->sc_dev, sc->sc_addr, DS1775_TEMP, buf); + + read = *((int16_t *)buf); + + /* The default mode of the ADC is 9 bit, the resolution is 0.5 C per + bit. The temperature is in tenth kelvin. + */ + *temp = ((int16_t)(read) >> 7) * 5; + + return (0); +} +static int +ds1775_sensor_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev; + struct ds1775_softc *sc; + struct ds1775_sensor *sens; + int value; + int error; + unsigned int temp; + + dev = arg1; + sc = device_get_softc(dev); + sens = &sc->sc_sensors[arg2]; + + error = ds1775_sensor_read(dev, sens, &value); + if (error != 0) + return (error); + + temp = value + FCU_ZERO_C_TO_K; + + error = sysctl_handle_int(oidp, &temp, 0, req); + + return (error); +} Added: head/sys/dev/iicbus/max6690.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/iicbus/max6690.c Fri Oct 15 20:08:16 2010 (r213904) @@ -0,0 +1,335 @@ +/*- + * Copyright (c) 2010 Andreas Tobler + * 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 ``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 BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#define FCU_ZERO_C_TO_K 2732 + +/* Inlet, Backside, U3 Heatsink sensor: MAX6690. */ + +#define MAX6690_INT_TEMP 0x0 +#define MAX6690_EXT_TEMP 0x1 +#define MAX6690_EEXT_TEMP 0x10 +#define MAX6690_IEXT_TEMP 0x11 +#define MAX6690_TEMP_MASK 0xe0 + +struct max6690_sensor { + int id; + char location[32]; +}; + +/* Regular bus attachment functions */ +static int max6690_probe(device_t); +static int max6690_attach(device_t); + +/* Utility functions */ +static int max6690_sensor_sysctl(SYSCTL_HANDLER_ARGS); +static void max6690_start(void *xdev); +static int max6690_read_1(device_t dev, uint32_t addr, uint8_t reg, + uint8_t *data); + +struct max6690_softc { + device_t sc_dev; + struct intr_config_hook enum_hook; + uint32_t sc_addr; + struct max6690_sensor *sc_sensors; + int sc_nsensors; +}; +static device_method_t max6690_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, max6690_probe), + DEVMETHOD(device_attach, max6690_attach), + { 0, 0 }, +}; + +static driver_t max6690_driver = { + "max6690", + max6690_methods, + sizeof(struct max6690_softc) +}; + +static devclass_t max6690_devclass; + +DRIVER_MODULE(max6690, iicbus, max6690_driver, max6690_devclass, 0, 0); +MALLOC_DEFINE(M_MAX6690, "max6690", "Temp-Monitor MAX6690"); + +static int +max6690_read_1(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data) +{ + uint8_t buf[4]; + + struct iic_msg msg[2] = { + { addr, IIC_M_WR | IIC_M_NOSTOP, 1, ® }, + { addr, IIC_M_RD, 1, buf }, + }; + + if (iicbus_transfer(dev, msg, 2) != 0) { + device_printf(dev, "iicbus read failed\n"); + return (EIO); + } + + *data = *((uint8_t*)buf); + + return (0); +} + +static int +max6690_probe(device_t dev) +{ + const char *name, *compatible; + struct max6690_softc *sc; + + name = ofw_bus_get_name(dev); + compatible = ofw_bus_get_compat(dev); + + if (!name) + return (ENXIO); + + if (strcmp(name, "temp-monitor") != 0 || + strcmp(compatible, "max6690") != 0) + return (ENXIO); + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_addr = iicbus_get_addr(dev); + + device_set_desc(dev, "Temp-Monitor MAX6690"); + + return (0); +} + +/* + * This function returns the number of sensors. If we call it the second time + * and we have allocated memory for sc->sc_sensors, we fill in the properties. + */ +static int +max6690_fill_sensor_prop(device_t dev) +{ + phandle_t child; + struct max6690_softc *sc; + u_int id[8]; + char location[96]; + int i = 0, j, len = 0, prop_len, prev_len = 0; + + sc = device_get_softc(dev); + + child = ofw_bus_get_node(dev); + + /* Fill the sensor location property. */ + prop_len = OF_getprop(child, "hwsensor-location", location, + sizeof(location)); + while (len < prop_len) { + if (sc->sc_sensors != NULL) + strcpy(sc->sc_sensors[i].location, location + len); + prev_len = strlen(location + len) + 1; + len += prev_len; + i++; + } + if (sc->sc_sensors == NULL) + return (i); + + /* Fill the sensor id property. */ + prop_len = OF_getprop(child, "hwsensor-id", id, sizeof(id)); + for (j = 0; j < i; j++) + sc->sc_sensors[j].id = (id[j] & 0xf); + + return (i); +} +static int +max6690_attach(device_t dev) +{ + struct max6690_softc *sc; + + sc = device_get_softc(dev); + + sc->enum_hook.ich_func = max6690_start; + sc->enum_hook.ich_arg = dev; + + /* We have to wait until interrupts are enabled. I2C read and write + * only works if the interrupts are available. + * The unin/i2c is controlled by the htpic on unin. But this is not + * the master. The openpic on mac-io is controlling the htpic. + * This one gets attached after the mac-io probing and then the + * interrupts will be available. + */ + + if (config_intrhook_establish(&sc->enum_hook) != 0) + return (ENOMEM); + + return (0); +} + +static void +max6690_start(void *xdev) +{ + phandle_t child; + struct max6690_softc *sc; + struct sysctl_oid *oid, *sensroot_oid; + struct sysctl_ctx_list *ctx; + char sysctl_name[32]; + int i, j; + + device_t dev = (device_t)xdev; + + sc = device_get_softc(dev); + + sc->sc_nsensors = 0; + + child = ofw_bus_get_node(dev); + + /* Count the actual number of sensors. */ + sc->sc_nsensors = max6690_fill_sensor_prop(dev); + + device_printf(dev, "%d sensors detected.\n", sc->sc_nsensors); + + if (sc->sc_nsensors == 0) + device_printf(dev, "WARNING: No MAX6690 sensors detected!\n"); + + sc->sc_sensors = malloc (sc->sc_nsensors * sizeof(struct max6690_sensor), + M_MAX6690, M_WAITOK | M_ZERO); + + ctx = device_get_sysctl_ctx(dev); + sensroot_oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensor", + CTLFLAG_RD, 0, "MAX6690 Sensor Information"); + + /* Now we can fill the properties into the allocated struct. */ + sc->sc_nsensors = max6690_fill_sensor_prop(dev); + + /* Add sysctls for the sensors. */ + for (i = 0; i < sc->sc_nsensors; i++) { + for (j = 0; j < strlen(sc->sc_sensors[i].location); j++) { + sysctl_name[j] = tolower(sc->sc_sensors[i].location[j]); + if (isspace(sysctl_name[j])) + sysctl_name[j] = '_'; + } + sysctl_name[j] = 0; + + oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sensroot_oid), + OID_AUTO, + sysctl_name, CTLFLAG_RD, 0, + "Sensor Information"); + /* I use i to pass the sensor id. */ + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "temp", + CTLTYPE_INT | CTLFLAG_RD, dev, i % 2, + max6690_sensor_sysctl, "IK", + "Sensor Temp in °C"); + + } + /* Dump sensor location & ID. */ + if (bootverbose) { + device_printf(dev, "Sensors\n"); + for (i = 0; i < sc->sc_nsensors; i++) { + device_printf(dev, "Location : %s ID: %d\n", + sc->sc_sensors[i].location, + sc->sc_sensors[i].id); + } + } + + config_intrhook_disestablish(&sc->enum_hook); +} + +static int +max6690_sensor_read(device_t dev, struct max6690_sensor *sens, int *temp) +{ + uint8_t reg_int = 0, reg_ext = 0; + uint8_t integer; + uint8_t fraction; + struct max6690_softc *sc; + + sc = device_get_softc(dev); + + /* The internal sensor id's are even, the external ar odd. */ + if ((sens->id % 2) == 0) { + reg_int = MAX6690_INT_TEMP; + reg_ext = MAX6690_IEXT_TEMP; + } else { + reg_int = MAX6690_EXT_TEMP; + reg_ext = MAX6690_EEXT_TEMP; + } + + max6690_read_1(sc->sc_dev, sc->sc_addr, reg_int, &integer); + + max6690_read_1(sc->sc_dev, sc->sc_addr, reg_ext, &fraction); + + fraction &= MAX6690_TEMP_MASK; + + /* The temperature is in tenth kelvin, the fractional part resolution + is 0.125. + */ + *temp = (integer * 10) + (fraction >> 5) * 10 / 8; + + return (0); +} + +static int +max6690_sensor_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev; + struct max6690_softc *sc; + struct max6690_sensor *sens; + int value = 0; + int error; + unsigned int temp; + + dev = arg1; + sc = device_get_softc(dev); + sens = &sc->sc_sensors[arg2]; + + error = max6690_sensor_read(dev, sens, &value); + if (error != 0) + return (error); + + temp = value + FCU_ZERO_C_TO_K; + + error = sysctl_handle_int(oidp, &temp, 0, req); + + return (error); +} Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Fri Oct 15 20:01:35 2010 (r213903) +++ head/sys/powerpc/conf/GENERIC Fri Oct 15 20:08:16 2010 (r213904) @@ -173,6 +173,9 @@ device sbp # SCSI over FireWire (Requi device fwe # Ethernet over FireWire (non-standard!) # Misc +device ds1775 # PowerMac7,2 temperature sensor +device fcu # Apple Fan Control Unit +device max6690 # PowerMac7,2 temperature sensor device powermac_nvram # Open Firmware configuration NVRAM device smu # Apple System Management Unit Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Fri Oct 15 20:01:35 2010 (r213903) +++ head/sys/powerpc/conf/GENERIC64 Fri Oct 15 20:08:16 2010 (r213904) @@ -170,6 +170,9 @@ device sbp # SCSI over FireWire (Requi device fwe # Ethernet over FireWire (non-standard!) # Misc +device ds1775 # PowerMac7,2 temperature sensor +device fcu # Apple Fan Control Unit +device max6690 # PowerMac7,2 temperature sensor device powermac_nvram # Open Firmware configuration NVRAM device smu # Apple System Management Unit Modified: head/sys/powerpc/conf/NOTES ============================================================================== --- head/sys/powerpc/conf/NOTES Fri Oct 15 20:01:35 2010 (r213903) +++ head/sys/powerpc/conf/NOTES Fri Oct 15 20:08:16 2010 (r213904) @@ -36,6 +36,9 @@ device kiic # Apple Keywest I2C Contro device ofwd # Open Firmware disks device adb # Apple Desktop Bus device cuda # VIA-CUDA ADB interface +device ds1775 # PowerMac7,2 temperature sensor +device fcu # Apple Fan Control Unit +device max6690 # PowerMac7,2 temperature sensor device pmu # Apple Power Management Unit device smu # Apple System Management Unit device snd_ai2s # Apple I2S Audio Added: head/sys/powerpc/powermac/fcu.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powermac/fcu.c Fri Oct 15 20:08:16 2010 (r213904) @@ -0,0 +1,506 @@ +/*- + * Copyright (c) 2010 Andreas Tobler + * 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 ``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 BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +/* FCU registers + * /u3@0,f8000000/i2c@f8001000/fan@15e + */ +#define FCU_RPM_FAIL 0x0b /* fans states in bits 0<1-6>7 */ +#define FCU_RPM_AVAILABLE 0x0c +#define FCU_RPM_ACTIVE 0x0d +#define FCU_RPM_READ(x) 0x11 + (x) * 2 +#define FCU_RPM_SET(x) 0x10 + (x) * 2 + +#define FCU_PWM_FAIL 0x2b +#define FCU_PWM_AVAILABLE 0x2c +#define FCU_PWM_ACTIVE 0x2d +#define FCU_PWM_READ(x) 0x31 + (x) * 2 +#define FCU_PWM_SET(x) 0x30 + (x) * 2 + +struct fcu_fan { + int id; + cell_t min_rpm; + cell_t max_rpm; + char location[32]; + enum { + FCU_FAN_RPM, + FCU_FAN_PWM + } type; + int setpoint; +}; + +struct fcu_softc { + device_t sc_dev; + struct intr_config_hook enum_hook; + uint32_t sc_addr; + struct fcu_fan *sc_fans; + int sc_nfans; +}; + +static int fcu_rpm_shift; + +/* Regular bus attachment functions */ +static int fcu_probe(device_t); +static int fcu_attach(device_t); + +/* Utility functions */ +static void fcu_attach_fans(device_t dev); +static int fcu_fill_fan_prop(device_t dev); +static int fcu_fan_set_rpm(device_t dev, struct fcu_fan *fan, int rpm); +static int fcu_fan_get_rpm(device_t dev, struct fcu_fan *fan, int *rpm); +static int fcu_fanrpm_sysctl(SYSCTL_HANDLER_ARGS); +static void fcu_start(void *xdev); +static int fcu_write(device_t dev, uint32_t addr, uint8_t reg, uint8_t *buf, + int len); +static int fcu_read_1(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data); + +static device_method_t fcu_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, fcu_probe), + DEVMETHOD(device_attach, fcu_attach), + { 0, 0 }, +}; + +static driver_t fcu_driver = { + "fcu", + fcu_methods, + sizeof(struct fcu_softc) +}; + +static devclass_t fcu_devclass; + +DRIVER_MODULE(fcu, iicbus, fcu_driver, fcu_devclass, 0, 0); +MALLOC_DEFINE(M_FCU, "fcu", "FCU Sensor Information"); + +static int +fcu_write(device_t dev, uint32_t addr, uint8_t reg, uint8_t *buff, + int len) +{ + unsigned char buf[4]; + struct iic_msg msg[] = { + { addr, IIC_M_WR, 0, buf } + }; + + msg[0].len = len + 1; + buf[0] = reg; + memcpy(buf + 1, buff, len); + if (iicbus_transfer(dev, msg, 1) != 0) { + device_printf(dev, "iicbus write failed\n"); + return (EIO); + } + + return (0); + +} + +static int +fcu_read_1(device_t dev, uint32_t addr, uint8_t reg, uint8_t *data) +{ + uint8_t buf[4]; + + struct iic_msg msg[2] = { + { addr, IIC_M_WR | IIC_M_NOSTOP, 1, ® }, + { addr, IIC_M_RD, 1, buf }, + }; + + if (iicbus_transfer(dev, msg, 2) != 0) { + device_printf(dev, "iicbus read failed\n"); + return (EIO); + } + + *data = *((uint8_t*)buf); + + return (0); +} + +static int +fcu_probe(device_t dev) +{ + const char *name, *compatible; + struct fcu_softc *sc; + + name = ofw_bus_get_name(dev); + compatible = ofw_bus_get_compat(dev); + + if (!name) + return (ENXIO); + + if (strcmp(name, "fan") != 0 || strcmp(compatible, "fcu") != 0) + return (ENXIO); + + sc = device_get_softc(dev); + sc->sc_dev = dev; + sc->sc_addr = iicbus_get_addr(dev); + + device_set_desc(dev, "Apple Fan Control Unit"); + + return (0); +} + +static int +fcu_attach(device_t dev) +{ + struct fcu_softc *sc; + + sc = device_get_softc(dev); + + sc->enum_hook.ich_func = fcu_start; + sc->enum_hook.ich_arg = dev; + + /* We have to wait until interrupts are enabled. I2C read and write + * only works if the interrupts are available. + * The unin/i2c is controlled by the htpic on unin. But this is not + * the master. The openpic on mac-io is controlling the htpic. + * This one gets attached after the mac-io probing and then the + * interrupts will be available. + */ + + if (config_intrhook_establish(&sc->enum_hook) != 0) + return (ENOMEM); + + return (0); +} + +static void +fcu_start(void *xdev) +{ + unsigned char buf[1] = { 0xff }; + struct fcu_softc *sc; + + device_t dev = (device_t)xdev; + + sc = device_get_softc(dev); + + /* Start the fcu device. */ + fcu_write(sc->sc_dev, sc->sc_addr, 0xe, buf, 1); + fcu_write(sc->sc_dev, sc->sc_addr, 0x2e, buf, 1); + fcu_read_1(sc->sc_dev, sc->sc_addr, 0, buf); + fcu_rpm_shift = (buf[0] == 1) ? 2 : 3; + + device_printf(dev, "FCU initialized, RPM shift: %d\n", + fcu_rpm_shift); + + /* Detect and attach child devices. */ + + fcu_attach_fans(dev); + + config_intrhook_disestablish(&sc->enum_hook); + +} + +static int +fcu_fan_set_rpm(device_t dev, struct fcu_fan *fan, int rpm) +{ + uint8_t reg; + struct fcu_softc *sc; + unsigned char buf[2]; + + sc = device_get_softc(dev); + + /* Clamp to allowed range */ + rpm = max(fan->min_rpm, rpm); + rpm = min(fan->max_rpm, rpm); + + if (fan->type == FCU_FAN_RPM) { + reg = FCU_RPM_SET(fan->id); + fan->setpoint = rpm; + } else if (fan->type == FCU_FAN_PWM) { + reg = FCU_PWM_SET(fan->id); + if (rpm > 3500) + rpm = 3500; + if (rpm < 500) + rpm = 500; + fan->setpoint = rpm; + /* PWM 30: 550 rpm, PWM 255: 3400 rpm. */ + rpm = (rpm * 255) / 3500; + } else { + device_printf(dev, "Unknown fan type: %d\n", fan->type); + return (EIO); + } + + if (fan->type == FCU_FAN_RPM) { + buf[0] = rpm >> (8 - fcu_rpm_shift); + buf[1] = rpm << fcu_rpm_shift; + fcu_write(sc->sc_dev, sc->sc_addr, reg, buf, 2); + } else { + buf[0] = rpm; + fcu_write(sc->sc_dev, sc->sc_addr, reg, buf, 1); + } + + return (0); +} + +static int +fcu_fan_get_rpm(device_t dev, struct fcu_fan *fan, int *rpm) +{ + uint8_t reg; + struct fcu_softc *sc; + uint8_t buff[2] = { 0, 0 }; + uint8_t active = 0, avail = 0, fail = 0; + + sc = device_get_softc(dev); + + if (fan->type == FCU_FAN_RPM) { + /* Check if the fan is available. */ + reg = FCU_RPM_AVAILABLE; + fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &avail); + if ((avail & (1 << fan->id)) == 0) { + device_printf(dev, "RPM Fan not available ID: %d\n", + fan->id); + return (EIO); + } + /* Check if we have a failed fan. */ + reg = FCU_RPM_FAIL; + fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &fail); + if ((fail & (1 << fan->id)) != 0) { + device_printf(dev, "RPM Fan failed ID: %d\n", fan->id); + return (EIO); + } + /* Check if fan is active. */ + reg = FCU_RPM_ACTIVE; + fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &active); + if ((active & (1 << fan->id)) == 0) { + device_printf(dev, "RPM Fan not active ID: %d\n", + fan->id); + return (ENXIO); + } + reg = FCU_RPM_READ(fan->id); + } else if (fan->type == FCU_FAN_PWM) { + /* Check if the fan is available. */ + reg = FCU_PWM_AVAILABLE; + fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &avail); + if ((avail & (1 << fan->id)) == 0) { + device_printf(dev, "PWM Fan not available ID: %d\n", + fan->id); + return (EIO); + } + /* Check if we have a failed fan. */ + reg = FCU_PWM_FAIL; + fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &fail); + if ((fail & (1 << fan->id)) != 0) { + device_printf(dev, "PWM Fan failed ID: %d\n", fan->id); + return (EIO); + } + /* Check if fan is active. */ + reg = FCU_PWM_ACTIVE; + fcu_read_1(sc->sc_dev, sc->sc_addr, reg, &active); + if ((active & (1 << fan->id)) == 0) { + device_printf(dev, "PWM Fan not active ID: %d\n", + fan->id); + return (ENXIO); + } + reg = FCU_PWM_READ(fan->id); + } else { + device_printf(dev, "Unknown fan type: %d\n", fan->type); + return (EIO); + } + + /* It seems that we can read the fans rpm. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 20:41:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FF2E106566B; Fri, 15 Oct 2010 20:41:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0EEA98FC0C; Fri, 15 Oct 2010 20:41:45 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 9F61146B06; Fri, 15 Oct 2010 16:41:44 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8AB988A027; Fri, 15 Oct 2010 16:41:43 -0400 (EDT) From: John Baldwin To: Rui Paulo Date: Fri, 15 Oct 2010 16:28:40 -0400 User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100819; KDE/4.4.5; amd64; ; ) References: <201010141919.o9EJJJIc034032@svn.freebsd.org> <201010150845.22576.jhb@freebsd.org> <96F4E353-55A6-48E6-BA20-92720EC2C4E7@freebsd.org> In-Reply-To: <96F4E353-55A6-48E6-BA20-92720EC2C4E7@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010151628.41177.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Fri, 15 Oct 2010 16:41:43 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric Subject: Re: svn commit: r213845 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 20:41:45 -0000 On Friday, October 15, 2010 2:50:46 pm Rui Paulo wrote: > On 15 Oct 2010, at 13:45, John Baldwin wrote: > > > On Thursday, October 14, 2010 5:09:58 pm Dimitry Andric wrote: > >> On 2010-10-14 21:39, John Baldwin wrote: > >>> On Thursday, October 14, 2010 3:19:19 pm Rui Paulo wrote: > >> ... > >>>> Revert r213765. This is required because our build infrastructure uses > >>>> the host lex instead of the lex built during buildworld. I will MFC the > >>>> lex changes soon and in a few weeks this I'll commit again r213765. > >>> Can't you make 'lex' a build-tool to workaround this? > >> > >> That will not help for "cd conf/CONF && make kernel", apparently. It > >> will always use the host lex. > > > > Well, yes, but that is always true. build-tools are only used for > > buildkernel. However, if an 8.x lex cannot build a 9.x kernel, then having > > lex be a build-tool (or cross-tool, ru@ knows which category better than I) > > will let a 'make kernel-toolchain' followed by 'make buildkernel' of a 9.x > > source tree work on an 8.x host. > > Yes, but I was told that 'cd conf/CONF && make kernel' is a supported configuration (without requiring kernel-toolchain first). Nah, just when it happens to work. It's ok to require people to build a new world to get a new lex in that case. However, for the buildkernel case the 'buildworld' / 'toolchain' / 'kernel-toolchain' targets should always build enough tools to let buildkernel work, so if a new lex is required they should build a new lex. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 21:39:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0144B106566C; Fri, 15 Oct 2010 21:39:52 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3E048FC18; Fri, 15 Oct 2010 21:39:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FLdpQF079278; Fri, 15 Oct 2010 21:39:51 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FLdpCe079276; Fri, 15 Oct 2010 21:39:51 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201010152139.o9FLdpCe079276@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 15 Oct 2010 21:39:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213905 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 21:39:52 -0000 Author: jkim Date: Fri Oct 15 21:39:51 2010 New Revision: 213905 URL: http://svn.freebsd.org/changeset/base/213905 Log: Move setting power state for children into a separate function as they were essentially the same. This also restores hw.pci.do_power_resume tunable, which was broken since r211430. Reviewed by: jhb Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Fri Oct 15 20:08:16 2010 (r213904) +++ head/sys/dev/pci/pci.c Fri Oct 15 21:39:51 2010 (r213905) @@ -2903,12 +2903,43 @@ pci_attach(device_t dev) return (bus_generic_attach(dev)); } +static void +pci_set_power_children(device_t dev, device_t *devlist, int numdevs, + int state) +{ + device_t child, pcib; + struct pci_devinfo *dinfo; + int dstate, i; + + if (!pci_do_power_resume) + return; + + /* + * Set the device to the given state. If the firmware suggests + * a different power state, use it instead. If power management + * is not present, the firmware is responsible for managing + * device power. Skip children who aren't attached since they + * are handled separately. Only manage type 0 devices for now. + */ + pcib = device_get_parent(dev); + for (i = 0; i < numdevs; i++) { + child = devlist[i]; + dinfo = device_get_ivars(child); + dstate = state; + if (device_is_attached(child) && + (dinfo->cfg.hdrtype & PCIM_HDRTYPE) == + PCIM_HDRTYPE_NORMAL && + PCIB_POWER_FOR_SLEEP(pcib, dev, &dstate) == 0) + pci_set_powerstate(child, dstate); + } +} + int pci_suspend(device_t dev) { - int dstate, error, i, numdevs; - device_t child, *devlist, pcib; + device_t child, *devlist; struct pci_devinfo *dinfo; + int error, i, numdevs; /* * Save the PCI configuration space for each child and set the @@ -2928,26 +2959,7 @@ pci_suspend(device_t dev) free(devlist, M_TEMP); return (error); } - - /* - * Always set the device to D3. If the firmware suggests a - * different power state, use it instead. If power management - * is not present, the firmware is responsible for managing - * device power. Skip children who aren't attached since they - * are powered down separately. Only manage type 0 devices - * for now. - */ - pcib = device_get_parent(dev); - for (i = 0; pci_do_power_resume && i < numdevs; i++) { - child = devlist[i]; - dinfo = (struct pci_devinfo *) device_get_ivars(child); - dstate = PCI_POWERSTATE_D3; - if (device_is_attached(child) && - (dinfo->cfg.hdrtype & PCIM_HDRTYPE) == - PCIM_HDRTYPE_NORMAL && - PCIB_POWER_FOR_SLEEP(pcib, dev, &dstate) == 0) - pci_set_powerstate(child, dstate); - } + pci_set_power_children(dev, devlist, numdevs, PCI_POWERSTATE_D3); free(devlist, M_TEMP); return (0); } @@ -2955,32 +2967,22 @@ pci_suspend(device_t dev) int pci_resume(device_t dev) { - int i, numdevs, error; - device_t child, *devlist, pcib; + device_t child, *devlist; struct pci_devinfo *dinfo; + int error, i, numdevs; /* * Set each child to D0 and restore its PCI configuration space. */ if ((error = device_get_children(dev, &devlist, &numdevs)) != 0) return (error); - pcib = device_get_parent(dev); + pci_set_power_children(dev, devlist, numdevs, PCI_POWERSTATE_D0); + + /* Now the device is powered up, restore its config space. */ for (i = 0; i < numdevs; i++) { - /* - * Notify power managment we're going to D0 but ignore - * the result. If power management is not present, - * the firmware is responsible for managing device - * power. Only manage type 0 devices for now. - */ child = devlist[i]; - dinfo = (struct pci_devinfo *) device_get_ivars(child); - if (device_is_attached(child) && - (dinfo->cfg.hdrtype & PCIM_HDRTYPE) == - PCIM_HDRTYPE_NORMAL && - PCIB_POWER_FOR_SLEEP(pcib, dev, NULL) == 0) - pci_set_powerstate(child, PCI_POWERSTATE_D0); + dinfo = device_get_ivars(child); - /* Now the device is powered up, restore its config space. */ pci_cfg_restore(child, dinfo); if (!device_is_attached(child)) pci_cfg_save(child, dinfo, 1); From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 21:40:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B70011065696; Fri, 15 Oct 2010 21:40:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A610C8FC18; Fri, 15 Oct 2010 21:40:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FLeKf0079331; Fri, 15 Oct 2010 21:40:20 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FLeKlo079329; Fri, 15 Oct 2010 21:40:20 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201010152140.o9FLeKlo079329@svn.freebsd.org> From: Dimitry Andric Date: Fri, 15 Oct 2010 21:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213906 - head/lib/csu/ia64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 21:40:20 -0000 Author: dim Date: Fri Oct 15 21:40:20 2010 New Revision: 213906 URL: http://svn.freebsd.org/changeset/base/213906 Log: Remove two .endp's without matching .proc in lib/csu/ia64/crtn.S. This allows it to assemble with newer binutils. Reviewed by: marcel Modified: head/lib/csu/ia64/crtn.S Modified: head/lib/csu/ia64/crtn.S ============================================================================== --- head/lib/csu/ia64/crtn.S Fri Oct 15 21:39:51 2010 (r213905) +++ head/lib/csu/ia64/crtn.S Fri Oct 15 21:40:20 2010 (r213906) @@ -33,11 +33,9 @@ mov b0=loc0 /* Recover return addr */ mov ar.pfs=loc1 br.ret.sptk.many b0 - .endp _init# .section .fini,"ax",@progbits .regstk 0,2,0,0 mov b0=loc0 /* Recover return addr */ mov ar.pfs=loc1 br.ret.sptk.many b0 - .endp _fini# From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 21:42:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 443B01065673; Fri, 15 Oct 2010 21:42:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 256F48FC16; Fri, 15 Oct 2010 21:42:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FLfxAl079402; Fri, 15 Oct 2010 21:41:59 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FLfxZl079400; Fri, 15 Oct 2010 21:41:59 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201010152141.o9FLfxZl079400@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 15 Oct 2010 21:41:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213907 - head/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 21:42:00 -0000 Author: jkim Date: Fri Oct 15 21:41:59 2010 New Revision: 213907 URL: http://svn.freebsd.org/changeset/base/213907 Log: Remove unnecessary castings and fix couple of style(9) nits. Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Fri Oct 15 21:40:20 2010 (r213906) +++ head/sys/dev/pci/pci.c Fri Oct 15 21:41:59 2010 (r213907) @@ -2949,7 +2949,7 @@ pci_suspend(device_t dev) return (error); for (i = 0; i < numdevs; i++) { child = devlist[i]; - dinfo = (struct pci_devinfo *) device_get_ivars(child); + dinfo = device_get_ivars(child); pci_cfg_save(child, dinfo, 0); } @@ -3340,7 +3340,7 @@ pci_probe_nomatch(device_t dev, device_t } printf(" at device %d.%d (no driver attached)\n", pci_get_slot(child), pci_get_function(child)); - pci_cfg_save(child, (struct pci_devinfo *)device_get_ivars(child), 1); + pci_cfg_save(child, device_get_ivars(child), 1); return; } @@ -4021,9 +4021,8 @@ pci_cfg_restore(device_t dev, struct pci * the noise on boot by doing nothing if we are already in * state D0. */ - if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) { + if (pci_get_powerstate(dev) != PCI_POWERSTATE_D0) pci_set_powerstate(dev, PCI_POWERSTATE_D0); - } for (i = 0; i < dinfo->cfg.nummaps; i++) pci_write_config(dev, PCIR_BAR(i), dinfo->cfg.bar[i], 4); pci_write_config(dev, PCIR_BIOS, dinfo->cfg.bios, 4); From owner-svn-src-all@FreeBSD.ORG Fri Oct 15 23:34:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 462B0106564A; Fri, 15 Oct 2010 23:34:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1A72A8FC12; Fri, 15 Oct 2010 23:34:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9FNYVrH092384; Fri, 15 Oct 2010 23:34:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9FNYVQ3092382; Fri, 15 Oct 2010 23:34:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201010152334.o9FNYVQ3092382@svn.freebsd.org> From: Marius Strobl Date: Fri, 15 Oct 2010 23:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213908 - head/sys/dev/dc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Oct 2010 23:34:32 -0000 Author: marius Date: Fri Oct 15 23:34:31 2010 New Revision: 213908 URL: http://svn.freebsd.org/changeset/base/213908 Log: Convert the PHY drivers to honor the mii_flags passed down and convert the NIC drivers as well as the PHY drivers to take advantage of the mii_attach() introduced in r213878 to get rid of certain hacks. For the most part these were: - Artificially limiting miibus_{read,write}reg methods to certain PHY addresses; we now let mii_attach() only probe the PHY at the desired address(es) instead. - PHY drivers setting MIIF_* flags based on the NIC driver they hang off from, partly even based on grabbing and using the softc of the parent; we now pass these flags down from the NIC to the PHY drivers via mii_attach(). This got us rid of all such hacks except those of brgphy() in combination with bce(4) and bge(4), which is way beyond what can be expressed with simple flags. While at it, I took the opportunity to change the NIC drivers to pass up the error returned by mii_attach() (previously by mii_phy_probe()) and unify the error message used in this case where and as appropriate as mii_attach() actually can fail for a number of reasons, not just because of no PHY(s) being present at the expected address(es). This file was missed in r213893. Modified: head/sys/dev/dc/dcphy.c Modified: head/sys/dev/dc/dcphy.c ============================================================================== --- head/sys/dev/dc/dcphy.c Fri Oct 15 21:41:59 2010 (r213907) +++ head/sys/dev/dc/dcphy.c Fri Oct 15 23:34:31 2010 (r213908) @@ -149,6 +149,7 @@ dcphy_attach(device_t dev) mii = ma->mii_data; LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list); + sc->mii_flags = miibus_get_flags(dev); sc->mii_inst = mii->mii_instance++; sc->mii_phy = ma->mii_phyno; sc->mii_service = dcphy_service; @@ -211,7 +212,6 @@ dcphy_service(struct mii_softc *sc, stru if ((mii->mii_ifp->if_flags & IFF_UP) == 0) break; - sc->mii_flags = 0; mii->mii_media_active = IFM_NONE; mode = CSR_READ_4(dc_sc, DC_NETCFG); mode &= ~(DC_NETCFG_FULLDUPLEX | DC_NETCFG_PORTSEL | From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 04:14:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63428106566C; Sat, 16 Oct 2010 04:14:46 +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 50FAA8FC0A; Sat, 16 Oct 2010 04:14:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9G4EkhW010302; Sat, 16 Oct 2010 04:14:46 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9G4EkJA010298; Sat, 16 Oct 2010 04:14:46 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201010160414.o9G4EkJA010298@svn.freebsd.org> From: Lawrence Stewart Date: Sat, 16 Oct 2010 04:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213910 - in head: share/man/man9 sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 04:14:46 -0000 Author: lstewart Date: Sat Oct 16 04:14:45 2010 New Revision: 213910 URL: http://svn.freebsd.org/changeset/base/213910 Log: - Simplify implementation of uma_zone_get_max. - Add uma_zone_get_cur which returns the current approximate occupancy of a zone. This is useful for providing stats via sysctl amongst other things. Sponsored by: FreeBSD Foundation Reviewed by: gnn, jhb MFC after: 2 weeks Modified: head/share/man/man9/zone.9 head/sys/vm/uma.h head/sys/vm/uma_core.c Modified: head/share/man/man9/zone.9 ============================================================================== --- head/share/man/man9/zone.9 Sat Oct 16 01:35:15 2010 (r213909) +++ head/share/man/man9/zone.9 Sat Oct 16 04:14:45 2010 (r213910) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 19, 2008 +.Dd October 9, 2010 .Dt ZONE 9 .Os .Sh NAME @@ -35,7 +35,9 @@ .Nm uma_zfree , .Nm uma_zfree_arg , .Nm uma_zdestroy , -.Nm uma_zone_set_max +.Nm uma_zone_set_max, +.Nm uma_zone_get_max, +.Nm uma_zone_get_cur .Nd zone allocator .Sh SYNOPSIS .In sys/param.h @@ -59,6 +61,10 @@ .Fn uma_zdestroy "uma_zone_t zone" .Ft void .Fn uma_zone_set_max "uma_zone_t zone" "int nitems" +.Ft int +.Fn uma_zone_get_max "uma_zone_t zone" +.Ft int +.Fn uma_zone_get_cur "uma_zone_t zone" .Sh DESCRIPTION The zone allocator provides an efficient interface for managing dynamically-sized collections of items of similar size. @@ -170,21 +176,36 @@ must have been freed with .Fn uma_zfree before. .Pp -The purpose of +The .Fn uma_zone_set_max -is to limit the maximum amount of memory that the system can dedicated -toward the zone specified by the -.Fa zone -argument. +function limits the number of items +.Pq and therefore memory +that can be allocated to +.Fa zone . The .Fa nitems -argument gives the upper limit of items in the zone. -This limits the total number of items in the zone which includes: +argument specifies the requested upper limit number of items. +The effective limit may end up being higher than requested, as the +implementation will round up to ensure all memory pages allocated to the zone +are utilised to capacity. +The limit applies to the total number of items in the zone, which includes allocated items, free items and free items in the per-cpu caches. On systems with more than one CPU it may not be possible to allocate the specified number of items even when there is no shortage of memory, because all of the remaining free items may be in the caches of the other CPUs when the limit is hit. +.Pp +The +.Fn uma_zone_get_max +function returns the effective upper limit number of items for a zone. +.Pp +The +.Fn uma_zone_get_cur +function returns the approximate current occupancy of the zone. +The returned value is approximate because appropriate synchronisation to +determine an exact value is not performend by the implementation. +This ensures low overhead at the expense of potentially stale data being used +in the calculation. .Sh RETURN VALUES The .Fn uma_zalloc Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Sat Oct 16 01:35:15 2010 (r213909) +++ head/sys/vm/uma.h Sat Oct 16 04:14:45 2010 (r213910) @@ -471,6 +471,17 @@ void uma_zone_set_max(uma_zone_t zone, i int uma_zone_get_max(uma_zone_t zone); /* + * Obtains the approximate current number of items allocated from a zone + * + * Arguments: + * zone The zone to obtain the current allocation count from + * + * Return: + * int The approximate current number of items allocated from the zone + */ +int uma_zone_get_cur(uma_zone_t zone); + +/* * The following two routines (uma_zone_set_init/fini) * are used to set the backend init/fini pair which acts on an * object as it becomes allocated and is placed in a slab within Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sat Oct 16 01:35:15 2010 (r213909) +++ head/sys/vm/uma_core.c Sat Oct 16 04:14:45 2010 (r213910) @@ -2805,16 +2805,36 @@ uma_zone_get_max(uma_zone_t zone) ZONE_LOCK(zone); keg = zone_first_keg(zone); - if (keg->uk_maxpages) - nitems = keg->uk_maxpages * keg->uk_ipers; - else - nitems = 0; + nitems = keg->uk_maxpages * keg->uk_ipers; ZONE_UNLOCK(zone); return (nitems); } /* See uma.h */ +int +uma_zone_get_cur(uma_zone_t zone) +{ + int64_t nitems; + u_int i; + + ZONE_LOCK(zone); + nitems = zone->uz_allocs - zone->uz_frees; + CPU_FOREACH(i) { + /* + * See the comment in sysctl_vm_zone_stats() regarding the + * safety of accessing the per-cpu caches. With the zone lock + * held, it is safe, but can potentially result in stale data. + */ + nitems += zone->uz_cpu[i].uc_allocs - + zone->uz_cpu[i].uc_frees; + } + ZONE_UNLOCK(zone); + + return (nitems < 0 ? 0 : nitems); +} + +/* See uma.h */ void uma_zone_set_init(uma_zone_t zone, uma_init uminit) { From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 04:41:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B3F91065698; Sat, 16 Oct 2010 04:41:46 +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 1F9DE8FC17; Sat, 16 Oct 2010 04:41:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9G4fkKb014664; Sat, 16 Oct 2010 04:41:46 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9G4fj9K014659; Sat, 16 Oct 2010 04:41:45 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201010160441.o9G4fj9K014659@svn.freebsd.org> From: Lawrence Stewart Date: Sat, 16 Oct 2010 04:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213911 - in head: share/man/man9 sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 04:41:46 -0000 Author: lstewart Date: Sat Oct 16 04:41:45 2010 New Revision: 213911 URL: http://svn.freebsd.org/changeset/base/213911 Log: Change uma_zone_set_max to return the effective value of "nitems" after rounding. The same value can also be obtained with uma_zone_get_max, but this change avoids a caller having to make two back-to-back calls. Sponsored by: FreeBSD Foundation Reviewed by: gnn, jhb Modified: head/share/man/man9/zone.9 head/sys/vm/uma.h head/sys/vm/uma_core.c Modified: head/share/man/man9/zone.9 ============================================================================== --- head/share/man/man9/zone.9 Sat Oct 16 04:14:45 2010 (r213910) +++ head/share/man/man9/zone.9 Sat Oct 16 04:41:45 2010 (r213911) @@ -59,7 +59,7 @@ .Fn uma_zfree_arg "uma_zone_t zone" "void *item" "void *arg" .Ft void .Fn uma_zdestroy "uma_zone_t zone" -.Ft void +.Ft int .Fn uma_zone_set_max "uma_zone_t zone" "int nitems" .Ft int .Fn uma_zone_get_max "uma_zone_t zone" @@ -185,9 +185,9 @@ that can be allocated to The .Fa nitems argument specifies the requested upper limit number of items. -The effective limit may end up being higher than requested, as the -implementation will round up to ensure all memory pages allocated to the zone -are utilised to capacity. +The effective limit is returned to the caller, as it may end up being higher +than requested due to the implementation rounding up to ensure all memory pages +allocated to the zone are utilised to capacity. The limit applies to the total number of items in the zone, which includes allocated items, free items and free items in the per-cpu caches. On systems with more than one CPU it may not be possible to allocate Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Sat Oct 16 04:14:45 2010 (r213910) +++ head/sys/vm/uma.h Sat Oct 16 04:41:45 2010 (r213911) @@ -452,11 +452,12 @@ int uma_zone_set_obj(uma_zone_t zone, st * * Arguments: * zone The zone to limit + * nitems The requested upper limit on the number of items allowed * * Returns: - * Nothing + * int The effective value of nitems after rounding up based on page size */ -void uma_zone_set_max(uma_zone_t zone, int nitems); +int uma_zone_set_max(uma_zone_t zone, int nitems); /* * Obtains the effective limit on the number of items in a zone Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sat Oct 16 04:14:45 2010 (r213910) +++ head/sys/vm/uma_core.c Sat Oct 16 04:41:45 2010 (r213911) @@ -2782,7 +2782,7 @@ zone_free_item(uma_zone_t zone, void *it } /* See uma.h */ -void +int uma_zone_set_max(uma_zone_t zone, int nitems) { uma_keg_t keg; @@ -2792,8 +2792,10 @@ uma_zone_set_max(uma_zone_t zone, int ni keg->uk_maxpages = (nitems / keg->uk_ipers) * keg->uk_ppera; if (keg->uk_maxpages * keg->uk_ipers < nitems) keg->uk_maxpages += keg->uk_ppera; - + nitems = keg->uk_maxpages * keg->uk_ipers; ZONE_UNLOCK(zone); + + return (nitems); } /* See uma.h */ From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 05:37:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B2881065670; Sat, 16 Oct 2010 05:37:45 +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 892CC8FC0A; Sat, 16 Oct 2010 05:37:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9G5bj1S025747; Sat, 16 Oct 2010 05:37:45 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9G5bjFj025745; Sat, 16 Oct 2010 05:37:45 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201010160537.o9G5bjFj025745@svn.freebsd.org> From: Lawrence Stewart Date: Sat, 16 Oct 2010 05:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213912 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 05:37:45 -0000 Author: lstewart Date: Sat Oct 16 05:37:45 2010 New Revision: 213912 URL: http://svn.freebsd.org/changeset/base/213912 Log: - Switch the "net.inet.tcp.reass.cursegments" and "net.inet.tcp.reass.maxsegments" sysctl variables to be based on UMA zone stats. The value returned by the cursegments sysctl is approximate owing to the way in which uma_zone_get_cur is implemented. - Discontinue use of V_tcp_reass_qsize as a global reassembly segment count variable in the reassembly implementation. The variable was used without proper synchronisation and was duplicating accounting done by UMA already. The lack of synchronisation was particularly problematic on SMP systems terminating many TCP sessions, resulting in poor TCP performance for connections with non-zero packet loss. Sponsored by: FreeBSD Foundation Reviewed by: andre, gnn, rpaulo (as part of a larger patch) MFC after: 2 weeks Modified: head/sys/netinet/tcp_reass.c Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Sat Oct 16 04:41:45 2010 (r213911) +++ head/sys/netinet/tcp_reass.c Sat Oct 16 05:37:45 2010 (r213912) @@ -74,19 +74,22 @@ __FBSDID("$FreeBSD$"); #include #endif /* TCPDEBUG */ +static int tcp_reass_sysctl_maxseg(SYSCTL_HANDLER_ARGS); +static int tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS); + SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0, "TCP Segment Reassembly Queue"); static VNET_DEFINE(int, tcp_reass_maxseg) = 0; #define V_tcp_reass_maxseg VNET(tcp_reass_maxseg) -SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN, - &VNET_NAME(tcp_reass_maxseg), 0, +SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN, + &VNET_NAME(tcp_reass_maxseg), 0, &tcp_reass_sysctl_maxseg, "I", "Global maximum number of TCP Segments in Reassembly Queue"); static VNET_DEFINE(int, tcp_reass_qsize) = 0; #define V_tcp_reass_qsize VNET(tcp_reass_qsize) -SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, cursegments, CTLFLAG_RD, - &VNET_NAME(tcp_reass_qsize), 0, +SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, cursegments, CTLFLAG_RD, + &VNET_NAME(tcp_reass_qsize), 0, &tcp_reass_sysctl_qsize, "I", "Global number of TCP Segments currently in Reassembly Queue"); static VNET_DEFINE(int, tcp_reass_maxqlen) = 48; @@ -148,7 +151,6 @@ tcp_reass_flush(struct tcpcb *tp) m_freem(qe->tqe_m); uma_zfree(V_tcp_reass_zone, qe); tp->t_segqlen--; - V_tcp_reass_qsize--; } KASSERT((tp->t_segqlen == 0), @@ -156,6 +158,20 @@ tcp_reass_flush(struct tcpcb *tp) tp, tp->t_segqlen)); } +static int +tcp_reass_sysctl_maxseg(SYSCTL_HANDLER_ARGS) +{ + V_tcp_reass_maxseg = uma_zone_get_max(V_tcp_reass_zone); + return (sysctl_handle_int(oidp, arg1, arg2, req)); +} + +static int +tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS) +{ + V_tcp_reass_qsize = uma_zone_get_cur(V_tcp_reass_zone); + return (sysctl_handle_int(oidp, arg1, arg2, req)); +} + int tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m) { @@ -184,12 +200,10 @@ tcp_reass(struct tcpcb *tp, struct tcphd * Limit the number of segments in the reassembly queue to prevent * holding on to too many segments (and thus running out of mbufs). * Make sure to let the missing segment through which caused this - * queue. Always keep one global queue entry spare to be able to - * process the missing segment. + * queue. */ if (th->th_seq != tp->rcv_nxt && - (V_tcp_reass_qsize + 1 >= V_tcp_reass_maxseg || - tp->t_segqlen >= V_tcp_reass_maxqlen)) { + tp->t_segqlen >= V_tcp_reass_maxqlen) { V_tcp_reass_overflows++; TCPSTAT_INC(tcps_rcvmemdrop); m_freem(m); @@ -209,7 +223,6 @@ tcp_reass(struct tcpcb *tp, struct tcphd return (0); } tp->t_segqlen++; - V_tcp_reass_qsize++; /* * Find a segment which begins after this one does. @@ -236,7 +249,6 @@ tcp_reass(struct tcpcb *tp, struct tcphd m_freem(m); uma_zfree(V_tcp_reass_zone, te); tp->t_segqlen--; - V_tcp_reass_qsize--; /* * Try to present any queued data * at the left window edge to the user. @@ -273,7 +285,6 @@ tcp_reass(struct tcpcb *tp, struct tcphd m_freem(q->tqe_m); uma_zfree(V_tcp_reass_zone, q); tp->t_segqlen--; - V_tcp_reass_qsize--; q = nq; } @@ -310,7 +321,6 @@ present: sbappendstream_locked(&so->so_rcv, q->tqe_m); uma_zfree(V_tcp_reass_zone, q); tp->t_segqlen--; - V_tcp_reass_qsize--; q = nq; } while (q && q->tqe_th->th_seq == tp->rcv_nxt); ND6_HINT(tp); From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 07:12:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DAA6106566C; Sat, 16 Oct 2010 07:12:40 +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 3BC608FC17; Sat, 16 Oct 2010 07:12:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9G7CeTw058027; Sat, 16 Oct 2010 07:12:40 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9G7Ce0S058025; Sat, 16 Oct 2010 07:12:40 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201010160712.o9G7Ce0S058025@svn.freebsd.org> From: Lawrence Stewart Date: Sat, 16 Oct 2010 07:12:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213913 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 07:12:40 -0000 Author: lstewart Date: Sat Oct 16 07:12:39 2010 New Revision: 213913 URL: http://svn.freebsd.org/changeset/base/213913 Log: Retire the system-wide, per-reassembly queue segment limit. The mechanism is far too coarse grained to be useful and the default value significantly degrades TCP performance on moderate to high bandwidth-delay product paths with non-zero loss (e.g. 5+Mbps connections across the public Internet often suffer). Replace the outgoing mechanism with an individual per-queue limit based on the number of MSS segments that fit into the socket's receive buffer. This should strike a good balance between performance and the potential for resource exhaustion when FreeBSD is acting as a TCP receiver. With socket buffer autotuning (which is enabled by default), the reassembly queue tracks the socket buffer and benefits too. As the XXX comment suggests, my testing uncovered some unexpected behaviour which requires further investigation. By using so->so_rcv.sb_hiwat instead of sbspace(&so->so_rcv), we allow more segments to be held across both the socket receive buffer and reassembly queue than we probably should. The tradeoff is better performance in at least one common scenario, versus a devious sender's ability to consume more resources on a FreeBSD receiver. Sponsored by: FreeBSD Foundation Reviewed by: andre, gnn, rpaulo MFC after: 2 weeks Modified: head/sys/netinet/tcp_reass.c Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Sat Oct 16 05:37:45 2010 (r213912) +++ head/sys/netinet/tcp_reass.c Sat Oct 16 07:12:39 2010 (r213913) @@ -92,12 +92,6 @@ SYSCTL_VNET_PROC(_net_inet_tcp_reass, OI &VNET_NAME(tcp_reass_qsize), 0, &tcp_reass_sysctl_qsize, "I", "Global number of TCP Segments currently in Reassembly Queue"); -static VNET_DEFINE(int, tcp_reass_maxqlen) = 48; -#define V_tcp_reass_maxqlen VNET(tcp_reass_maxqlen) -SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, maxqlen, CTLFLAG_RW, - &VNET_NAME(tcp_reass_maxqlen), 0, - "Maximum number of TCP Segments per individual Reassembly Queue"); - static VNET_DEFINE(int, tcp_reass_overflows) = 0; #define V_tcp_reass_overflows VNET(tcp_reass_overflows) SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows, CTLFLAG_RD, @@ -197,13 +191,23 @@ tcp_reass(struct tcpcb *tp, struct tcphd goto present; /* - * Limit the number of segments in the reassembly queue to prevent - * holding on to too many segments (and thus running out of mbufs). - * Make sure to let the missing segment through which caused this - * queue. + * Limit the number of segments that can be queued to reduce the + * potential for mbuf exhaustion. For best performance, we want to be + * able to queue a full window's worth of segments. The size of the + * socket receive buffer determines our advertised window and grows + * automatically when socket buffer autotuning is enabled. Use it as the + * basis for our queue limit. + * Always let the missing segment through which caused this queue. + * NB: Access to the socket buffer is left intentionally unlocked as we + * can tolerate stale information here. + * + * XXXLAS: Using sbspace(so->so_rcv) instead of so->so_rcv.sb_hiwat + * should work but causes packets to be dropped when they shouldn't. + * Investigate why and re-evaluate the below limit after the behaviour + * is understood. */ if (th->th_seq != tp->rcv_nxt && - tp->t_segqlen >= V_tcp_reass_maxqlen) { + tp->t_segqlen >= (so->so_rcv.sb_hiwat / tp->t_maxseg) + 1) { V_tcp_reass_overflows++; TCPSTAT_INC(tcps_rcvmemdrop); m_freem(m); From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 08:07:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F02E106566C; Sat, 16 Oct 2010 08:07:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 35AB68FC08; Sat, 16 Oct 2010 08:07:54 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o9G87piM060403 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 16 Oct 2010 11:07:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o9G87p1D026108; Sat, 16 Oct 2010 11:07:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o9G87pgG026107; Sat, 16 Oct 2010 11:07:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 16 Oct 2010 11:07:51 +0300 From: Kostik Belousov To: John Baldwin Message-ID: <20101016080751.GQ2392@deviant.kiev.zoral.com.ua> References: <201010141919.o9EJJJIc034032@svn.freebsd.org> <201010150845.22576.jhb@freebsd.org> <96F4E353-55A6-48E6-BA20-92720EC2C4E7@freebsd.org> <201010151628.41177.jhb@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AIVxJgaslCM/0U4c" Content-Disposition: inline In-Reply-To: <201010151628.41177.jhb@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, Dimitry Andric , svn-src-all@freebsd.org, src-committers@freebsd.org, Rui Paulo Subject: Re: svn commit: r213845 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 08:07:55 -0000 --AIVxJgaslCM/0U4c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 15, 2010 at 04:28:40PM -0400, John Baldwin wrote: > On Friday, October 15, 2010 2:50:46 pm Rui Paulo wrote: > > On 15 Oct 2010, at 13:45, John Baldwin wrote: > >=20 > > > On Thursday, October 14, 2010 5:09:58 pm Dimitry Andric wrote: > > >> On 2010-10-14 21:39, John Baldwin wrote: > > >>> On Thursday, October 14, 2010 3:19:19 pm Rui Paulo wrote: > > >> ... > > >>>> Revert r213765. This is required because our build infrastructur= e uses > > >>>> the host lex instead of the lex built during buildworld. I will = MFC the > > >>>> lex changes soon and in a few weeks this I'll commit again r2137= 65. > > >>> Can't you make 'lex' a build-tool to workaround this? > > >>=20 > > >> That will not help for "cd conf/CONF && make kernel", apparently. It > > >> will always use the host lex. > > >=20 > > > Well, yes, but that is always true. build-tools are only used for > > > buildkernel. However, if an 8.x lex cannot build a 9.x kernel, then = having > > > lex be a build-tool (or cross-tool, ru@ knows which category better t= han I) > > > will let a 'make kernel-toolchain' followed by 'make buildkernel' of = a 9.x > > > source tree work on an 8.x host. > >=20 > > Yes, but I was told that 'cd conf/CONF && make kernel' is a supported c= onfiguration (without requiring kernel-toolchain first). >=20 > Nah, just when it happens to work. It's ok to require people to build a = new > world to get a new lex in that case. However, for the buildkernel case t= he > 'buildworld' / 'toolchain' / 'kernel-toolchain' targets should always bui= ld > enough tools to let buildkernel work, so if a new lex is required they sh= ould > build a new lex. If it does not cost too much to keep make kernel style of build working, then it should be kept. In this case, the only requirement is to merge lex changes to stable branches. This is what I suggested (or requested, depending on how you interpret my mood). The lex backporting is orthogonal to the issue whether the lex shall become build tool. --AIVxJgaslCM/0U4c Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAky5XVYACgkQC3+MBN1Mb4hpDACeNPOuAFZGGkY3/8UfC+VB489i BeQAnRPhxbaEW42GBY8iwW2sWn4gSHyu =2otL -----END PGP SIGNATURE----- --AIVxJgaslCM/0U4c-- From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 08:12:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 837661065670; Sat, 16 Oct 2010 08:12:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id F100C8FC12; Sat, 16 Oct 2010 08:12:40 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o9G8CbrB060709 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 16 Oct 2010 11:12:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o9G8CbiQ026150; Sat, 16 Oct 2010 11:12:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o9G8Cbqw026149; Sat, 16 Oct 2010 11:12:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 16 Oct 2010 11:12:37 +0300 From: Kostik Belousov To: Hans Petter Selasky Message-ID: <20101016081237.GR2392@deviant.kiev.zoral.com.ua> References: <201010142038.o9EKcImV036360@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jGE3xONbfNfY0RQX" Content-Disposition: inline In-Reply-To: <201010142038.o9EKcImV036360@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r213852 - in head: lib/libusb sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 08:12:41 -0000 --jGE3xONbfNfY0RQX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Oct 14, 2010 at 08:38:18PM +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Oct 14 20:38:18 2010 > New Revision: 213852 > URL: http://svn.freebsd.org/changeset/base/213852 >=20 > Log: > - Add support for LibUSB in 32-bit compatibility mode. > =20 > Approved by: thompsa (mentor) >=20 > Modified: > head/lib/libusb/Makefile > head/lib/libusb/libusb20.c > head/lib/libusb/libusb20_int.h > head/lib/libusb/libusb20_ugen20.c > head/sys/dev/usb/usb_ioctl.h >=20 > Modified: head/lib/libusb/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libusb/Makefile Thu Oct 14 20:31:07 2010 (r213851) > +++ head/lib/libusb/Makefile Thu Oct 14 20:38:18 2010 (r213852) > @@ -30,5 +30,9 @@ SRCS+=3D libusb10.c > SRCS+=3D libusb10_desc.c > SRCS+=3D libusb10_io.c > =20 > +.if defined(COMPAT_32BIT) > +CFLAGS+=3D -DCOMPAT_32BIT > +.endif > + > .include The support is provided in a way that contradicts the established practice of doing 32-bit compat. Very nice that the support is provided, thank you for care about it. But, can it be changed so that the kernel emulates 32-bit ABI instead of library conforming to the kernel ABI ? For COMPAT32, we aim in making the system where 32bit binaries and libraries just work on the 64bit host. Your change does not allow to take 32bit host into jail and run it on 64bit kernel, as example. Please see numerous examples of ioctl translations under #ifdef COMPAT_FREEBSD32 on how it is done. --jGE3xONbfNfY0RQX Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAky5XnQACgkQC3+MBN1Mb4i8fwCeLIBdtrj7uuq95LBmLD8NJDVC cFAAnRFvYgdJHwSHj4YsGdYtSjLA33lj =OQhf -----END PGP SIGNATURE----- --jGE3xONbfNfY0RQX-- From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 08:38:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 483EE106564A; Sat, 16 Oct 2010 08:38:13 +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 362508FC08; Sat, 16 Oct 2010 08:38:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9G8cDPk068052; Sat, 16 Oct 2010 08:38:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9G8cDh2068050; Sat, 16 Oct 2010 08:38:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010160838.o9G8cDh2068050@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 16 Oct 2010 08:38: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: r213914 - stable/8/sys/dev/ciss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 08:38:13 -0000 Author: kib Date: Sat Oct 16 08:38:12 2010 New Revision: 213914 URL: http://svn.freebsd.org/changeset/base/213914 Log: MFC r213354: Cosmetic: make it less confusing when displaying RAID 1 level, that might be 1+0 as well. PR: kern/150936 Modified: stable/8/sys/dev/ciss/ciss.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ciss/ciss.c ============================================================================== --- stable/8/sys/dev/ciss/ciss.c Sat Oct 16 07:12:39 2010 (r213913) +++ stable/8/sys/dev/ciss/ciss.c Sat Oct 16 08:38:12 2010 (r213914) @@ -4394,7 +4394,7 @@ ciss_name_ldrive_org(int org) case CISS_LDRIVE_RAID0: return("RAID 0"); case CISS_LDRIVE_RAID1: - return("RAID 1"); + return("RAID 1(1+0)"); case CISS_LDRIVE_RAID4: return("RAID 4"); case CISS_LDRIVE_RAID5: From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 08:43:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E64FD106564A; Sat, 16 Oct 2010 08:43:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9C3F8FC16; Sat, 16 Oct 2010 08:43:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9G8hN0L068219; Sat, 16 Oct 2010 08:43:23 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9G8hNhv068216; Sat, 16 Oct 2010 08:43:23 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010160843.o9G8hNhv068216@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 16 Oct 2010 08:43: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: r213915 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 08:43:24 -0000 Author: kib Date: Sat Oct 16 08:43:23 2010 New Revision: 213915 URL: http://svn.freebsd.org/changeset/base/213915 Log: MFC r213359: Release the vnode lock and close the linker file vnode earlier in the linker_load_file methods. This prevents the LOR between kernel linker sx xlock and vnode lock. Modified: stable/8/sys/kern/link_elf.c stable/8/sys/kern/link_elf_obj.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/link_elf.c ============================================================================== --- stable/8/sys/kern/link_elf.c Sat Oct 16 08:38:12 2010 (r213914) +++ stable/8/sys/kern/link_elf.c Sat Oct 16 08:43:23 2010 (r213915) @@ -967,15 +967,15 @@ nosyms: *result = lf; out: + VOP_UNLOCK(nd.ni_vp, 0); + vn_close(nd.ni_vp, FREAD, td->td_ucred, td); + VFS_UNLOCK_GIANT(vfslocked); if (error && lf) linker_file_unload(lf, LINKER_UNLOAD_FORCE); if (shdr) free(shdr, M_LINKER); if (firstpage) free(firstpage, M_LINKER); - VOP_UNLOCK(nd.ni_vp, 0); - vn_close(nd.ni_vp, FREAD, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); return error; } Modified: stable/8/sys/kern/link_elf_obj.c ============================================================================== --- stable/8/sys/kern/link_elf_obj.c Sat Oct 16 08:38:12 2010 (r213914) +++ stable/8/sys/kern/link_elf_obj.c Sat Oct 16 08:43:23 2010 (r213915) @@ -885,13 +885,13 @@ link_elf_load_file(linker_class_t cls, c *result = lf; out: + VOP_UNLOCK(nd.ni_vp, 0); + vn_close(nd.ni_vp, FREAD, td->td_ucred, td); + VFS_UNLOCK_GIANT(vfslocked); if (error && lf) linker_file_unload(lf, LINKER_UNLOAD_FORCE); if (hdr) free(hdr, M_LINKER); - VOP_UNLOCK(nd.ni_vp, 0); - vn_close(nd.ni_vp, FREAD, td->td_ucred, td); - VFS_UNLOCK_GIANT(vfslocked); return error; } From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 09:40:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6961A106564A; Sat, 16 Oct 2010 09:40:18 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from swip.net (mailfe04.swip.net [212.247.154.97]) by mx1.freebsd.org (Postfix) with ESMTP id 5C46E8FC0C; Sat, 16 Oct 2010 09:40:16 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=gl0LPzB4YDQuuzpDoHYit7deEV0cOo++Sg28kyvF6vg= c=1 sm=1 a=JDvfM8UUrIYA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=6I5d2MoRAAAA:8 a=0lmskw69dS5j8ZysOG4A:9 a=bKm1Q0e_LByfRHvquksA:7 a=pcbShyqzeheGKVouiTlebcqnCLAA:4 a=PUjeQqilurYA:10 a=kRdFP4orv5aoMcEBSJwA:9 a=zkbzQjI9Bv3q3-CZc9UA:7 a=7z1EF6CxapNonKvoKVYfRoHaFMMA:4 a=wPNLvfGTeEIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe04.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 35905655; Sat, 16 Oct 2010 11:40:15 +0200 Received-SPF: softfail receiver=mailfe04.swip.net; client-ip=188.126.198.129; envelope-from=hselasky@freebsd.org From: Hans Petter Selasky To: Kostik Belousov Date: Sat, 16 Oct 2010 11:41:31 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.1-STABLE; KDE/4.4.5; amd64; ; ) References: <201010142038.o9EKcImV036360@svn.freebsd.org> <20101016081237.GR2392@deviant.kiev.zoral.com.ua> In-Reply-To: <20101016081237.GR2392@deviant.kiev.zoral.com.ua> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_MNXuMe5sUEJ+naY" Message-Id: <201010161141.32116.hselasky@freebsd.org> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Andrew Thompson Subject: Re: svn commit: r213852 - in head: lib/libusb sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 09:40:18 -0000 --Boundary-00=_MNXuMe5sUEJ+naY Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit On Saturday 16 October 2010 10:12:37 Kostik Belousov wrote: > On Thu, Oct 14, 2010 at 08:38:18PM +0000, Hans Petter Selasky wrote: > > Author: hselasky > > Date: Thu Oct 14 20:38:18 2010 > > New Revision: 213852 > > URL: http://svn.freebsd.org/changeset/base/213852 > > > > Log: > > - Add support for LibUSB in 32-bit compatibility mode. > > > > Approved by: thompsa (mentor) > > > > Modified: > > head/lib/libusb/Makefile > > head/lib/libusb/libusb20.c > > head/lib/libusb/libusb20_int.h > > head/lib/libusb/libusb20_ugen20.c > > head/sys/dev/usb/usb_ioctl.h > > > > Modified: head/lib/libusb/Makefile > > ========================================================================= > > ===== --- head/lib/libusb/Makefile Thu Oct 14 20:31:07 2010 (r213851) > > +++ head/lib/libusb/Makefile Thu Oct 14 20:38:18 2010 (r213852) > > @@ -30,5 +30,9 @@ SRCS+= libusb10.c > > > > SRCS+= libusb10_desc.c > > SRCS+= libusb10_io.c > > > > +.if defined(COMPAT_32BIT) > > +CFLAGS+= -DCOMPAT_32BIT > > +.endif > > + > > > > .include > > The support is provided in a way that contradicts the established practice > of doing 32-bit compat. Very nice that the support is provided, thank you > for care about it. But, can it be changed so that the kernel emulates > 32-bit ABI instead of library conforming to the kernel ABI ? The short answer is yes, but it adds much more code than in the existing approach, with regard to USB. It is not all about IOCTL's it is also about shared memory layout. The existing approach means: You need to compile /usr/lib32/ and use that with the 32-bit binaries. I.E. I want to have the 32->64 bit conversion in user-space, hence as per implementation in the kernel, there are no pointer mappings involved. It is simply a matter of zero-extending the pointer variable from 32-bit to 64-bit. > > For COMPAT32, we aim in making the system where 32bit binaries and > libraries just work on the 64bit host. Your change does not allow to take > 32bit host into jail and run it on 64bit kernel, as example. USB has some shared memory structures which are used in both user-land and kernel, which are not part of IOCTLs. Your approach means that there are two sets of IOCTL's of all kinds, one for 32-bit and one for 64-bit? > > Please see numerous examples of ioctl translations under > #ifdef COMPAT_FREEBSD32 on how it is done. Please find attached a patch to fix libusbhid world breakage. Sorry about that. I will do some more checing and see if more is broken. I will commit this as soon as I get a go. --HPS --Boundary-00=_MNXuMe5sUEJ+naY Content-Type: text/plain; charset="ISO-8859-1"; name="050.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="050.txt" ==== Patch <050.txt> level 1 Source: [No source] Target: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f:/head/lib/libusbhid:208023 [mirrored] (svn+ssh://hselasky@svn.freebsd.org/base) Log: Fix worldbuild breakage. === Makefile ================================================================== --- Makefile (revision 208023) +++ Makefile (patch 050.txt level 1) @@ -19,4 +19,8 @@ INCS= usbhid.h +.if defined(COMPAT_32BIT) +CFLAGS+= -DCOMPAT_32BIT +.endif + .include === descr.c ================================================================== --- descr.c (revision 208023) +++ descr.c (patch 050.txt level 1) @@ -103,7 +103,7 @@ memset(&ugd, 0, sizeof(ugd)); /* get actual length first */ - ugd.ugd_data = NULL; + ugd.ugd_data = hid_pass_ptr(NULL); ugd.ugd_maxlen = 65535; if (ioctl(fd, USB_GET_REPORT_DESC, &ugd) < 0) { #ifdef HID_COMPAT7 @@ -124,7 +124,7 @@ return (NULL); /* fetch actual descriptor */ - ugd.ugd_data = data; + ugd.ugd_data = hid_pass_ptr(data); ugd.ugd_maxlen = ugd.ugd_actlen; if (ioctl(fd, USB_GET_REPORT_DESC, &ugd) < 0) { /* could not read descriptor */ @@ -133,7 +133,7 @@ } /* check END_COLLECTION */ - if (((unsigned char *)ugd.ugd_data)[ugd.ugd_actlen -1] != 0xC0) { + if (((unsigned char *)data)[ugd.ugd_actlen -1] != 0xC0) { /* invalid end byte */ free(data); return (NULL); === usbvar.h ================================================================== --- usbvar.h (revision 208023) +++ usbvar.h (patch 050.txt level 1) @@ -29,6 +29,9 @@ * */ +#ifndef _USBVAR_H_ +#define _USBVAR_H_ + struct report_desc { uint32_t size; uint8_t data[1]; @@ -41,3 +44,11 @@ int hid_get_report_id_compat7(int fd); report_desc_t hid_get_report_desc_compat7(int fd); #endif + +#ifdef COMPAT_32BIT +#define hid_pass_ptr(ptr) ((uint64_t)(uintptr_t)(ptr)) +#else +#define hid_pass_ptr(ptr) (ptr) +#endif + +#endif /* _USBVAR_H_ */ --Boundary-00=_MNXuMe5sUEJ+naY-- From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 09:44:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52115106566B; Sat, 16 Oct 2010 09:44:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21BB68FC08; Sat, 16 Oct 2010 09:44:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9G9iWaE069490; Sat, 16 Oct 2010 09:44:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9G9iWKC069488; Sat, 16 Oct 2010 09:44:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010160944.o9G9iWKC069488@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 16 Oct 2010 09:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213916 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 09:44:32 -0000 Author: kib Date: Sat Oct 16 09:44:31 2010 New Revision: 213916 URL: http://svn.freebsd.org/changeset/base/213916 Log: Provide vfs.ncsizefactor instead of hard-coding namecache ratio. Move debug.ncnegfactor to vfs.ncnegfactor [1]. Provide some descriptions for the namecache related sysctls [1]. Based on the submission by: Rogier R. Mulhuijzen [1] MFC after: 2 weeks X-MFC-note: remove debug.ncnegfactor in HEAD after MFC Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Oct 16 08:43:23 2010 (r213915) +++ head/sys/kern/vfs_cache.c Sat Oct 16 09:44:31 2010 (r213916) @@ -126,20 +126,27 @@ struct namecache { static LIST_HEAD(nchashhead, namecache) *nchashtbl; /* Hash Table */ static TAILQ_HEAD(, namecache) ncneg; /* Hash Table */ static u_long nchash; /* size of hash table */ -SYSCTL_ULONG(_debug, OID_AUTO, nchash, CTLFLAG_RD, &nchash, 0, ""); +SYSCTL_ULONG(_debug, OID_AUTO, nchash, CTLFLAG_RD, &nchash, 0, + "Size of namecache hash table"); static u_long ncnegfactor = 16; /* ratio of negative entries */ +/* _debug sysctl left for backward compatibility */ SYSCTL_ULONG(_debug, OID_AUTO, ncnegfactor, CTLFLAG_RW, &ncnegfactor, 0, ""); -static u_long numneg; /* number of cache entries allocated */ -SYSCTL_ULONG(_debug, OID_AUTO, numneg, CTLFLAG_RD, &numneg, 0, ""); +SYSCTL_ULONG(_vfs, OID_AUTO, ncnegfactor, CTLFLAG_RW, &ncnegfactor, 0, + "Ratio of negative namecache entries"); +static u_long numneg; /* number of negative entries allocated */ +SYSCTL_ULONG(_debug, OID_AUTO, numneg, CTLFLAG_RD, &numneg, 0, + "Number of negative entries in namecache"); static u_long numcache; /* number of cache entries allocated */ -SYSCTL_ULONG(_debug, OID_AUTO, numcache, CTLFLAG_RD, &numcache, 0, ""); +SYSCTL_ULONG(_debug, OID_AUTO, numcache, CTLFLAG_RD, &numcache, 0, + "Number of namecache entries"); static u_long numcachehv; /* number of cache entries with vnodes held */ -SYSCTL_ULONG(_debug, OID_AUTO, numcachehv, CTLFLAG_RD, &numcachehv, 0, ""); -#if 0 -static u_long numcachepl; /* number of cache purge for leaf entries */ -SYSCTL_ULONG(_debug, OID_AUTO, numcachepl, CTLFLAG_RD, &numcachepl, 0, ""); -#endif -struct nchstats nchstats; /* cache effectiveness statistics */ +SYSCTL_ULONG(_debug, OID_AUTO, numcachehv, CTLFLAG_RD, &numcachehv, 0, + "Number of namecache entries with vnodes held"); +static u_int ncsizefactor = 2; +SYSCTL_UINT(_vfs, OID_AUTO, ncsizefactor, CTLFLAG_RW, &ncsizefactor, 0, + "Size factor for namecache"); + +struct nchstats nchstats; /* cache effectiveness statistics */ static struct rwlock cache_lock; RW_SYSINIT(vfscache, &cache_lock, "Name Cache"); @@ -174,7 +181,8 @@ static uma_zone_t cache_zone_large; } while (0) static int doingcache = 1; /* 1 => enable the cache */ -SYSCTL_INT(_debug, OID_AUTO, vfscache, CTLFLAG_RW, &doingcache, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, vfscache, CTLFLAG_RW, &doingcache, 0, + "VFS namecache enabled"); /* Export size information to userland */ SYSCTL_INT(_debug_sizeof, OID_AUTO, namecache, CTLFLAG_RD, 0, @@ -620,7 +628,7 @@ cache_enter(dvp, vp, cnp) /* * Avoid blowout in namecache entries. */ - if (numcache >= desiredvnodes * 2) + if (numcache >= desiredvnodes * ncsizefactor) return; flag = 0; From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 09:46:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88708106566C; Sat, 16 Oct 2010 09:46:03 +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 6A0248FC1D; Sat, 16 Oct 2010 09:46:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9G9k3n3069571; Sat, 16 Oct 2010 09:46:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9G9k3FC069569; Sat, 16 Oct 2010 09:46:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201010160946.o9G9k3FC069569@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 16 Oct 2010 09:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213917 - head/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 09:46:03 -0000 Author: kib Date: Sat Oct 16 09:46:03 2010 New Revision: 213917 URL: http://svn.freebsd.org/changeset/base/213917 Log: Document vfs.ncsizefactor and vfs.ncnegfactor. MFC after: 2 weeks Modified: head/share/man/man7/tuning.7 Modified: head/share/man/man7/tuning.7 ============================================================================== --- head/share/man/man7/tuning.7 Sat Oct 16 09:44:31 2010 (r213916) +++ head/share/man/man7/tuning.7 Sat Oct 16 09:46:03 2010 (r213917) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 11, 2010 +.Dd October 16, 2010 .Dt TUNING 7 .Os .Sh NAME @@ -534,6 +534,24 @@ It may be tuned down in specific cases w read-ahead adversely affects performance or where system memory is really low. .Pp +The +.Va vfs.ncsizefactor +sysctl defines how large VFS namecache may grow. +The number of currently allocated entries in namecache is provided by +.Va debug.numcache +sysctl and the condition +debug.numcache < kern.maxvnodes * vfs.ncsizefactor +is adhered to. +.Pp +The +.Va vfs.ncnegfactor +sysctl defines how many negative entries VFS namecache is allowed to create. +The number of currently allocated negative entries is provided by +.Va debug.numneg +sysctl and the condition +vfs.ncnegfactor * debug.numneg < debug.numcache +is adhered to. +.Pp There are various other buffer-cache and VM page cache related sysctls. We do not recommend modifying these values. As of From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 10:00:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DD5A106566B; Sat, 16 Oct 2010 10:00:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 160508FC17; Sat, 16 Oct 2010 10:00:54 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o9GA0pNv066597 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 16 Oct 2010 13:00:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o9GA0pFM028163; Sat, 16 Oct 2010 13:00:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o9GA0pHB028162; Sat, 16 Oct 2010 13:00:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 16 Oct 2010 13:00:51 +0300 From: Kostik Belousov To: Hans Petter Selasky Message-ID: <20101016100051.GS2392@deviant.kiev.zoral.com.ua> References: <201010142038.o9EKcImV036360@svn.freebsd.org> <20101016081237.GR2392@deviant.kiev.zoral.com.ua> <201010161141.32116.hselasky@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="q05O4hSO92p5GF/S" Content-Disposition: inline In-Reply-To: <201010161141.32116.hselasky@freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_05, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Andrew Thompson Subject: Re: svn commit: r213852 - in head: lib/libusb sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 10:00:55 -0000 --q05O4hSO92p5GF/S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 16, 2010 at 11:41:31AM +0200, Hans Petter Selasky wrote: > On Saturday 16 October 2010 10:12:37 Kostik Belousov wrote: > > On Thu, Oct 14, 2010 at 08:38:18PM +0000, Hans Petter Selasky wrote: > > > Author: hselasky > > > Date: Thu Oct 14 20:38:18 2010 > > > New Revision: 213852 > > > URL: http://svn.freebsd.org/changeset/base/213852 > > >=20 > > > Log: > > > - Add support for LibUSB in 32-bit compatibility mode. > > > =20 > > > Approved by: thompsa (mentor) > > >=20 > > > Modified: > > > head/lib/libusb/Makefile > > > head/lib/libusb/libusb20.c > > > head/lib/libusb/libusb20_int.h > > > head/lib/libusb/libusb20_ugen20.c > > > head/sys/dev/usb/usb_ioctl.h > > >=20 > > > Modified: head/lib/libusb/Makefile > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > =3D=3D=3D=3D=3D --- head/lib/libusb/Makefile Thu Oct 14 20:31:07 2010= (r213851) > > > +++ head/lib/libusb/Makefile Thu Oct 14 20:38:18 2010 (r213852) > > > @@ -30,5 +30,9 @@ SRCS+=3D libusb10.c > > >=20 > > > SRCS+=3D libusb10_desc.c > > > SRCS+=3D libusb10_io.c > > >=20 > > > +.if defined(COMPAT_32BIT) > > > +CFLAGS+=3D -DCOMPAT_32BIT > > > +.endif > > > + > > >=20 > > > .include > >=20 > > The support is provided in a way that contradicts the established pract= ice > > of doing 32-bit compat. Very nice that the support is provided, thank y= ou > > for care about it. But, can it be changed so that the kernel emulates > > 32-bit ABI instead of library conforming to the kernel ABI ? >=20 > The short answer is yes, but it adds much more code than in the existing= =20 > approach, with regard to USB. It is not all about IOCTL's it is also abou= t=20 > shared memory layout. The existing approach means: >=20 > You need to compile /usr/lib32/ and use that with the 32-bit binaries. I.= E. I=20 > want to have the 32->64 bit conversion in user-space, hence as per=20 Right, I undestand this, and I pointed that there are some scenarious that do not work with this approach. All other FreeBSD subsystems try to implement native 32bit ABI instead of providing usermode compatibility shims. > implementation in the kernel, there are no pointer mappings involved. It = is=20 > simply a matter of zero-extending the pointer variable from 32-bit to 64-= bit. >=20 > >=20 > > For COMPAT32, we aim in making the system where 32bit binaries and > > libraries just work on the 64bit host. Your change does not allow to ta= ke > > 32bit host into jail and run it on 64bit kernel, as example. >=20 > USB has some shared memory structures which are used in both user-land an= d=20 > kernel, which are not part of IOCTLs. Your approach means that there are = two=20 > sets of IOCTL's of all kinds, one for 32-bit and one for 64-bit? For all kinds of structures that are not ABI-invariant, yes. >=20 > >=20 > > Please see numerous examples of ioctl translations under > > #ifdef COMPAT_FREEBSD32 on how it is done. >=20 > Please find attached a patch to fix libusbhid world breakage. Sorry about= =20 > that. I will do some more checing and see if more is broken. I will commi= t=20 > this as soon as I get a go. --q05O4hSO92p5GF/S Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAky5d9EACgkQC3+MBN1Mb4gK2ACgoGF8W8m8db5tOngENVHWgWu4 DJUAoIirZDtXjqs6weOWkydNEtdlGACv =VTQj -----END PGP SIGNATURE----- --q05O4hSO92p5GF/S-- From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 10:11:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFDDF106564A; Sat, 16 Oct 2010 10:11:28 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from swip.net (mailfe02.swip.net [212.247.154.33]) by mx1.freebsd.org (Postfix) with ESMTP id D2F528FC12; Sat, 16 Oct 2010 10:11:27 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=yevn+QCjI6xy199BDvBOOiO14qYvyLq62he9tTtU3M8= c=1 sm=1 a=JDvfM8UUrIYA:10 a=Q9fys5e9bTEA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=eWn195XVIN2fRthuEo0A:9 a=MdxGQbdepDADdKRm27a66468vDEA:4 a=PUjeQqilurYA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe02.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 35844157; Sat, 16 Oct 2010 12:11:26 +0200 Received-SPF: softfail receiver=mailfe02.swip.net; client-ip=188.126.198.129; envelope-from=hselasky@freebsd.org From: Hans Petter Selasky To: Kostik Belousov Date: Sat, 16 Oct 2010 12:12:43 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.1-STABLE; KDE/4.4.5; amd64; ; ) References: <201010161141.32116.hselasky@freebsd.org> <20101016100051.GS2392@deviant.kiev.zoral.com.ua> In-Reply-To: <20101016100051.GS2392@deviant.kiev.zoral.com.ua> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'( =?iso-8859-1?q?=3B=5FIjlA=3A=0A=09hGE=2E=2EEw?=, =?iso-8859-1?q?XAQ*o=23=5C/M=7ESC=3DS1-f9=7BEzRfT=27=7CHhll5Q=5Dha5Bt-s=7Co?= =?iso-8859-1?q?TlKMusi=3A1e=5BwJl=7Dkd=7DGR=0A=09Z0adGx-x=5F0zGbZj=27e?=(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201010161212.43749.hselasky@freebsd.org> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Andrew Thompson Subject: Re: svn commit: r213852 - in head: lib/libusb sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 10:11:28 -0000 On Saturday 16 October 2010 12:00:51 Kostik Belousov wrote: > > USB has some shared memory structures which are used in both user-land > > and kernel, which are not part of IOCTLs. Your approach means that > > there are two sets of IOCTL's of all kinds, one for 32-bit and one for > > 64-bit? > > For all kinds of structures that are not ABI-invariant, yes. The approach that was discussed by me and Andrew earlier this year, was to use uint64_t instead of "void *" in shared memory structures. The only disadvantage is that this will force you to recompile libusb when you update the kernel, and so we kind of put that approach aside to keep seamless upgrade compatibility. --HPS From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 10:45:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFCE4106564A; Sat, 16 Oct 2010 10:45: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 AE46C8FC16; Sat, 16 Oct 2010 10:45:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GAjaFQ074249; Sat, 16 Oct 2010 10:45:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GAja2N074247; Sat, 16 Oct 2010 10:45:36 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010161045.o9GAja2N074247@svn.freebsd.org> From: Andriy Gapon Date: Sat, 16 Oct 2010 10:45:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213918 - head/sys/x86/isa X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 10:45:36 -0000 Author: avg Date: Sat Oct 16 10:45:36 2010 New Revision: 213918 URL: http://svn.freebsd.org/changeset/base/213918 Log: atrtc: remove (pre-)historic check of RTC NVRAM at address 0x0e Old scrolls tell that once upon a time IBM AT BIOS was known to put some useful system diagnostic information into RTC NVRAM. It is not really known if and for how long PC BIOSes followed that convention, but I believe that many, if not all, modern BIOSes do not do that any more (not mentioning other types of x86 firmware). Some diagnostic bits don't even make any sense any longer. The check results in confusing messages upon boot on some systems. So I am removing it. Discussed with: bde, jhb, mav MFC after: 3 weeks Modified: head/sys/x86/isa/atrtc.c Modified: head/sys/x86/isa/atrtc.c ============================================================================== --- head/sys/x86/isa/atrtc.c Sat Oct 16 09:46:03 2010 (r213917) +++ head/sys/x86/isa/atrtc.c Sat Oct 16 10:45:36 2010 (r213918) @@ -242,15 +242,12 @@ atrtc_attach(device_t dev) { struct atrtc_softc *sc; u_long s; - int i, diag; + int i; sc = device_get_softc(dev); if (!(sc->port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->port_rid, IO_RTC, IO_RTC + 1, 2, RF_ACTIVE))) device_printf(dev,"Warning: Couldn't map I/O.\n"); - diag = rtcin(RTC_DIAG); - if (diag != 0) - printf("RTC BIOS diagnostic error %b\n", diag, RTCDG_BITS); atrtc_start(); clock_register(dev, 1000000); bzero(&sc->et, sizeof(struct eventtimer)); From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 11:19:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3FA9106564A; Sat, 16 Oct 2010 11:19:31 +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 A1A258FC12; Sat, 16 Oct 2010 11:19:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GBJVxs074990; Sat, 16 Oct 2010 11:19:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GBJVD7074988; Sat, 16 Oct 2010 11:19:31 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010161119.o9GBJVD7074988@svn.freebsd.org> From: Andriy Gapon Date: Sat, 16 Oct 2010 11:19: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: r213919 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 11:19:31 -0000 Author: avg Date: Sat Oct 16 11:19:31 2010 New Revision: 213919 URL: http://svn.freebsd.org/changeset/base/213919 Log: MFC r213527: vm.kmem_map_size: a sysctl to query current kmem_map->size 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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_malloc.c ============================================================================== --- stable/8/sys/kern/kern_malloc.c Sat Oct 16 10:45:36 2010 (r213918) +++ stable/8/sys/kern/kern_malloc.c Sat Oct 16 11:19:31 2010 (r213919) @@ -197,6 +197,11 @@ static u_int vm_kmem_size_scale; SYSCTL_UINT(_vm, OID_AUTO, kmem_size_scale, CTLFLAG_RDTUN, &vm_kmem_size_scale, 0, "Scale factor for kernel memory size"); +static int sysctl_kmem_map_size(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_vm, OID_AUTO, kmem_map_size, + CTLFLAG_RD | CTLTYPE_ULONG | CTLFLAG_MPSAFE, NULL, 0, + sysctl_kmem_map_size, "LU", "Current kmem_map allocation size"); + /* * The malloc_mtx protects the kmemstatistics linked list. */ @@ -233,6 +238,15 @@ SYSCTL_INT(_debug_malloc, OID_AUTO, fail &malloc_failure_count, 0, "Number of imposed M_NOWAIT malloc failures"); #endif +static int +sysctl_kmem_map_size(SYSCTL_HANDLER_ARGS) +{ + u_long size; + + size = kmem_map->size; + return (sysctl_handle_long(oidp, &size, 0, req)); +} + int malloc_last_fail(void) { From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 11:20:53 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0C771065672; Sat, 16 Oct 2010 11:20:53 +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 B475F8FC0C; Sat, 16 Oct 2010 11:20:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GBKrmW075080; Sat, 16 Oct 2010 11:20:53 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GBKrIL075076; Sat, 16 Oct 2010 11:20:53 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201010161120.o9GBKrIL075076@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 16 Oct 2010 11:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213920 - head/lib/libusbhid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 11:20:54 -0000 Author: hselasky Date: Sat Oct 16 11:20:53 2010 New Revision: 213920 URL: http://svn.freebsd.org/changeset/base/213920 Log: - Add support for libusbhid in 32-bit compatibility mode. - Add missing check for ugd_actlen being too small. - Add missing inclusion guard to usbvar.h header file. - This also fixes buildworld breakage since r213852. Modified: head/lib/libusbhid/Makefile head/lib/libusbhid/descr.c head/lib/libusbhid/usbvar.h Modified: head/lib/libusbhid/Makefile ============================================================================== --- head/lib/libusbhid/Makefile Sat Oct 16 11:19:31 2010 (r213919) +++ head/lib/libusbhid/Makefile Sat Oct 16 11:20:53 2010 (r213920) @@ -19,4 +19,8 @@ SRCS= descr.c descr_compat.c parse.c usa INCS= usbhid.h +.if defined(COMPAT_32BIT) +CFLAGS+= -DCOMPAT_32BIT +.endif + .include Modified: head/lib/libusbhid/descr.c ============================================================================== --- head/lib/libusbhid/descr.c Sat Oct 16 11:19:31 2010 (r213919) +++ head/lib/libusbhid/descr.c Sat Oct 16 11:20:53 2010 (r213920) @@ -103,7 +103,7 @@ hid_get_report_desc(int fd) memset(&ugd, 0, sizeof(ugd)); /* get actual length first */ - ugd.ugd_data = NULL; + ugd.ugd_data = hid_pass_ptr(NULL); ugd.ugd_maxlen = 65535; if (ioctl(fd, USB_GET_REPORT_DESC, &ugd) < 0) { #ifdef HID_COMPAT7 @@ -124,7 +124,7 @@ hid_get_report_desc(int fd) return (NULL); /* fetch actual descriptor */ - ugd.ugd_data = data; + ugd.ugd_data = hid_pass_ptr(data); ugd.ugd_maxlen = ugd.ugd_actlen; if (ioctl(fd, USB_GET_REPORT_DESC, &ugd) < 0) { /* could not read descriptor */ @@ -132,8 +132,15 @@ hid_get_report_desc(int fd) return (NULL); } + /* sanity check */ + if (ugd.ugd_actlen < 1) { + /* invalid report descriptor */ + free(data); + return (NULL); + } + /* check END_COLLECTION */ - if (((unsigned char *)ugd.ugd_data)[ugd.ugd_actlen -1] != 0xC0) { + if (((unsigned char *)data)[ugd.ugd_actlen -1] != 0xC0) { /* invalid end byte */ free(data); return (NULL); Modified: head/lib/libusbhid/usbvar.h ============================================================================== --- head/lib/libusbhid/usbvar.h Sat Oct 16 11:19:31 2010 (r213919) +++ head/lib/libusbhid/usbvar.h Sat Oct 16 11:20:53 2010 (r213920) @@ -29,6 +29,9 @@ * */ +#ifndef _USBVAR_H_ +#define _USBVAR_H_ + struct report_desc { uint32_t size; uint8_t data[1]; @@ -41,3 +44,11 @@ int hid_set_immed_compat7(int fd, int en int hid_get_report_id_compat7(int fd); report_desc_t hid_get_report_desc_compat7(int fd); #endif + +#ifdef COMPAT_32BIT +#define hid_pass_ptr(ptr) ((uint64_t)(uintptr_t)(ptr)) +#else +#define hid_pass_ptr(ptr) (ptr) +#endif + +#endif /* _USBVAR_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 11:24:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A75491065674; Sat, 16 Oct 2010 11:24:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9520B8FC13; Sat, 16 Oct 2010 11:24:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GBOR4o075196; Sat, 16 Oct 2010 11:24:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GBORpP075194; Sat, 16 Oct 2010 11:24:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010161124.o9GBORpP075194@svn.freebsd.org> From: Andriy Gapon Date: Sat, 16 Oct 2010 11:24: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: r213921 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 11:24:27 -0000 Author: avg Date: Sat Oct 16 11:24:27 2010 New Revision: 213921 URL: http://svn.freebsd.org/changeset/base/213921 Log: MFC r213651: add kmem_map_free sysctl: query largest contiguous free range in kmem_map 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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_malloc.c ============================================================================== --- stable/8/sys/kern/kern_malloc.c Sat Oct 16 11:20:53 2010 (r213920) +++ stable/8/sys/kern/kern_malloc.c Sat Oct 16 11:24:27 2010 (r213921) @@ -202,6 +202,11 @@ SYSCTL_PROC(_vm, OID_AUTO, kmem_map_size CTLFLAG_RD | CTLTYPE_ULONG | CTLFLAG_MPSAFE, NULL, 0, sysctl_kmem_map_size, "LU", "Current kmem_map allocation size"); +static int sysctl_kmem_map_free(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_vm, OID_AUTO, kmem_map_free, + CTLFLAG_RD | CTLTYPE_ULONG | CTLFLAG_MPSAFE, NULL, 0, + sysctl_kmem_map_free, "LU", "Largest contiguous free range in kmem_map"); + /* * The malloc_mtx protects the kmemstatistics linked list. */ @@ -247,6 +252,18 @@ sysctl_kmem_map_size(SYSCTL_HANDLER_ARGS return (sysctl_handle_long(oidp, &size, 0, req)); } +static int +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; + vm_map_unlock_read(kmem_map); + return (sysctl_handle_long(oidp, &size, 0, req)); +} + int malloc_last_fail(void) { From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 11:29:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC492106564A; Sat, 16 Oct 2010 11:29:16 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe07.swip.net [212.247.154.193]) by mx1.freebsd.org (Postfix) with ESMTP id A81728FC19; Sat, 16 Oct 2010 11:29:15 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=sEolSJAlcSxSMaOm1MQ0bvrIu+BNAN+OqG2UAUgC4Ok= c=1 sm=1 a=JDvfM8UUrIYA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=6I5d2MoRAAAA:8 a=n5-G4sEZgtiaszGX_7gA:9 a=14KlHf8dsPfPLKwOEKYA:7 a=q0nRkw06_Gt-72_VwbkFzgMNnKMA:4 a=pILNOxqGKmIA:10 a=zK40HWSAGXpK1S42oqQA:9 a=gnB4RclB4wQogc_v6mUA:7 a=PPrse_5yiIbdUBVEOCR7ouyfPNcA:4 a=QEXdDO2ut3YA:10 a=WQ_67oLP1xdXm_gn:21 a=sLo_uR9Tib-Su8yZ:21 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe07.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 35921570; Sat, 16 Oct 2010 13:29:13 +0200 From: Hans Petter Selasky To: Kostik Belousov Date: Sat, 16 Oct 2010 13:30:31 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.1-STABLE; KDE/4.4.5; amd64; ; ) References: <20101016100051.GS2392@deviant.kiev.zoral.com.ua> <201010161212.43749.hselasky@freebsd.org> In-Reply-To: <201010161212.43749.hselasky@freebsd.org> X-Face: +~\`s("[*|O,="7?X@L.elg*F"OA\I/3%^p8g?ab%RN'(; _IjlA: hGE..Ew, XAQ*o#\/M~SC=S1-f9{EzRfT'|Hhll5Q]ha5Bt-s|oTlKMusi:1e[wJl}kd}GR Z0adGx-x_0zGbZj'e(Y[(UNle~)8CQWXW@:DX+9)_YlB[tIccCPN$7/L' MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_XzYuMmBl0afcInl" Message-Id: <201010161330.31549.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Andrew Thompson Subject: Re: svn commit: r213852 - in head: lib/libusb sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 11:29:16 -0000 --Boundary-00=_XzYuMmBl0afcInl Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit On Saturday 16 October 2010 12:12:43 Hans Petter Selasky wrote: > On Saturday 16 October 2010 12:00:51 Kostik Belousov wrote: > > > USB has some shared memory structures which are used in both user-land > > > and kernel, which are not part of IOCTLs. Your approach means that > > > there are two sets of IOCTL's of all kinds, one for 32-bit and one for > > > 64-bit? > > > > For all kinds of structures that are not ABI-invariant, yes. > Hi, I've committed a patch to fix the buildworld breakage after feedback from Andreas Tobler. http://svn.freebsd.org/changeset/base/213920 > The approach that was discussed by me and Andrew earlier this year, was to > use uint64_t instead of "void *" in shared memory structures. The only > disadvantage is that this will force you to recompile libusb when you > update the kernel, and so we kind of put that approach aside to keep > seamless upgrade compatibility. This will also break the ABI on 8-stable and that was the main reason for going the other route. However, most applications access USB via libusb, so the breakage would probably be minimal. Do you have any opinions here? Should we make an exception for the general rule to not change the ABI within a stable branch? I'm attaching the other approach, which allows both 32 and 64 bit applications to use USB using the same IOCTL's. See thread: [FreeBSD 8/9] [64-bit IOCTL] Using the USB stack from a 32-bit application under a 64-bit kernel. --HPS --Boundary-00=_XzYuMmBl0afcInl Content-Type: text/plain; charset="UTF-8"; name="usb_64bit_patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="usb_64bit_patch.txt" --- src/lib/libusb/libusb20.c 2010-03-08 16:57:53.000000000 0000 +++ src/lib/libusb/libusb20.c 2010-03-08 16:57:53.000000000 0000 @@ -320,7 +320,7 @@ void libusb20_tr_set_buffer(struct libusb20_transfer *xfer, void *buffer, uint16_t frIndex) { - xfer->ppBuffer[frIndex] = buffer; + xfer->ppBuffer[frIndex] = libusb20_u64ptr(buffer); return; } @@ -386,7 +386,7 @@ void libusb20_tr_setup_bulk(struct libusb20_transfer *xfer, void *pBuf, uint32_t length, uint32_t timeout) { - xfer->ppBuffer[0] = pBuf; + xfer->ppBuffer[0] = libusb20_u64ptr(pBuf); xfer->pLength[0] = length; xfer->timeout = timeout; xfer->nFrames = 1; @@ -398,7 +398,7 @@ { uint16_t len; - xfer->ppBuffer[0] = psetup; + xfer->ppBuffer[0] = libusb20_u64ptr(psetup); xfer->pLength[0] = 8; /* fixed */ xfer->timeout = timeout; @@ -406,7 +406,7 @@ if (len != 0) { xfer->nFrames = 2; - xfer->ppBuffer[1] = pBuf; + xfer->ppBuffer[1] = libusb20_u64ptr(pBuf); xfer->pLength[1] = len; } else { xfer->nFrames = 1; @@ -417,7 +417,7 @@ void libusb20_tr_setup_intr(struct libusb20_transfer *xfer, void *pBuf, uint32_t length, uint32_t timeout) { - xfer->ppBuffer[0] = pBuf; + xfer->ppBuffer[0] = libusb20_u64ptr(pBuf); xfer->pLength[0] = length; xfer->timeout = timeout; xfer->nFrames = 1; @@ -431,7 +431,7 @@ /* should not happen */ return; } - xfer->ppBuffer[frIndex] = pBuf; + xfer->ppBuffer[frIndex] = libusb20_u64ptr(pBuf); xfer->pLength[frIndex] = length; return; } --- src/lib/libusb/libusb20_int.h 2010-03-08 16:57:53.000000000 0000 +++ src/lib/libusb/libusb20_int.h 2010-03-08 16:57:53.000000000 0000 @@ -31,6 +31,8 @@ #ifndef _LIBUSB20_INT_H_ #define _LIBUSB20_INT_H_ +#define libusb20_u64ptr(ptr) ((uint64_t)(uintptr_t)(ptr)) + struct libusb20_device; struct libusb20_backend; struct libusb20_transfer; @@ -148,7 +150,7 @@ /* * Pointer to a list of buffer pointers: */ - void **ppBuffer; + uint64_t *ppBuffer; /* * Pointer to frame lengths, which are updated to actual length * after the USB transfer completes: --- src/lib/libusb/libusb20_ugen20.c 2010-03-08 16:57:53.000000000 0000 +++ src/lib/libusb/libusb20_ugen20.c 2010-03-08 16:57:53.000000000 0000 @@ -763,8 +763,8 @@ xfer->maxPacketLen = temp.max_packet_length; /* setup buffer and length lists */ - fsep->ppBuffer = xfer->ppBuffer;/* zero copy */ - fsep->pLength = xfer->pLength; /* zero copy */ + fsep->ppBuffer = libusb20_u64ptr(xfer->ppBuffer); /* zero copy */ + fsep->pLength = libusb20_u64ptr(xfer->pLength); /* zero copy */ return (0); /* success */ } --- src/sys/dev/usb/usb_generic.c 2010-05-17 04:19:10.000000000 0000 +++ src/sys/dev/usb/usb_generic.c 2010-05-17 04:19:10.000000000 0000 @@ -76,6 +76,7 @@ #define UGEN_BULK_FS_BUFFER_SIZE (64*32) /* bytes */ #define UGEN_BULK_HS_BUFFER_SIZE (1024*32) /* bytes */ #define UGEN_HW_FRAMES 50 /* number of milliseconds per transfer */ +#define UGEN_HW_PTR(u64) ((void *)(uintptr_t)(u64)) /* function prototypes */ @@ -134,7 +135,6 @@ TUNABLE_INT("hw.usb.ugen.debug", &ugen_debug); #endif - /* prototypes */ static int @@ -1039,7 +1039,7 @@ struct usb_device_request *req; struct usb_xfer *xfer; struct usb_fs_endpoint fs_ep; - void *uaddr; /* userland pointer */ + uint64_t uaddr; /* userland pointer */ void *kaddr; usb_frlength_t offset; usb_frlength_t rem; @@ -1077,11 +1077,13 @@ xfer->error = USB_ERR_INVAL; goto complete; } - error = copyin(fs_ep.ppBuffer, + + /* read frame buffer pointer */ + error = copyin(UGEN_HW_PTR(fs_ep.ppBuffer), &uaddr, sizeof(uaddr)); - if (error) { + if (error) return (error); - } + /* reset first frame */ usbd_xfer_set_frame_offset(xfer, 0, 0); @@ -1089,7 +1091,8 @@ req = xfer->frbuffers[0].buffer; - error = copyin(fs_ep.pLength, + /* read frame buffer length */ + error = copyin(UGEN_HW_PTR(fs_ep.pLength), &length, sizeof(length)); if (error) { return (error); @@ -1099,7 +1102,7 @@ goto complete; } if (length != 0) { - error = copyin(uaddr, req, length); + error = copyin(UGEN_HW_PTR(uaddr), req, length); if (error) { return (error); } @@ -1159,11 +1162,12 @@ for (; n != xfer->nframes; n++) { - error = copyin(fs_ep.pLength + n, + /* read frame buffer length */ + error = copyin(UGEN_HW_PTR(fs_ep.pLength + (4 * n)), &length, sizeof(length)); - if (error) { + if (error) break; - } + usbd_xfer_set_frame_len(xfer, n, length); if (length > rem) { @@ -1174,12 +1178,12 @@ if (!isread) { - /* we need to know the source buffer */ - error = copyin(fs_ep.ppBuffer + n, + /* read frame buffer pointer */ + error = copyin(UGEN_HW_PTR(fs_ep.ppBuffer + (8 * n)), &uaddr, sizeof(uaddr)); - if (error) { + if (error) break; - } + if (xfer->flags_int.isochronous_xfr) { /* get kernel buffer address */ kaddr = xfer->frbuffers[0].buffer; @@ -1193,7 +1197,7 @@ } /* move data */ - error = copyin(uaddr, kaddr, length); + error = copyin(UGEN_HW_PTR(uaddr), kaddr, length); if (error) { break; } @@ -1216,7 +1220,7 @@ struct usb_xfer *xfer; struct usb_fs_endpoint fs_ep; struct usb_fs_endpoint *fs_ep_uptr; /* userland ptr */ - void *uaddr; /* userland ptr */ + uint64_t uaddr; /* userland ptr */ void *kaddr; usb_frlength_t offset; usb_frlength_t rem; @@ -1281,12 +1285,12 @@ for (; n != xfer->nframes; n++) { - /* get initial length into "temp" */ - error = copyin(fs_ep.pLength + n, + /* get initial frame buffer length into "temp" */ + error = copyin(UGEN_HW_PTR(fs_ep.pLength + (4 * n)), &temp, sizeof(temp)); - if (error) { + if (error) return (error); - } + if (temp > rem) { /* the userland length has been corrupted */ DPRINTF("corrupt userland length " @@ -1307,12 +1311,12 @@ } if (isread) { - /* we need to know the destination buffer */ - error = copyin(fs_ep.ppBuffer + n, + /* read destination frame buffer pointer */ + error = copyin(UGEN_HW_PTR(fs_ep.ppBuffer + (8 * n)), &uaddr, sizeof(uaddr)); - if (error) { + if (error) return (error); - } + if (xfer->flags_int.isochronous_xfr) { /* only one frame buffer */ kaddr = USB_ADD_BYTES( @@ -1323,7 +1327,7 @@ } /* move data */ - error = copyout(kaddr, uaddr, length); + error = copyout(kaddr, UGEN_HW_PTR(uaddr), length); if (error) { return (error); } @@ -1334,12 +1338,11 @@ */ offset += temp; - /* update length */ + /* update frame buffer length */ error = copyout(&length, - fs_ep.pLength + n, sizeof(length)); - if (error) { + UGEN_HW_PTR(fs_ep.pLength + (4 * n)), sizeof(length)); + if (error) return (error); - } } complete: --- src/sys/dev/usb/usb_ioctl.h 2010-02-14 12:03:51.000000000 0000 +++ src/sys/dev/usb/usb_ioctl.h 2010-02-14 12:03:51.000000000 0000 @@ -131,9 +131,10 @@ * NOTE: isochronous USB transfer only use one buffer, but can have * multiple frame lengths ! */ - void **ppBuffer; /* pointer to userland buffers */ - uint32_t *pLength; /* pointer to frame lengths, updated - * to actual length */ + uint64_t ppBuffer; /* pointer to 64-bit userland buffer pointers */ + uint64_t pLength; /* pointer to 32-bit frame lengths, which + * get updated to the actual length after + * the transfer is complete. */ uint32_t nFrames; /* number of frames */ uint32_t aFrames; /* actual number of frames */ uint16_t flags; --Boundary-00=_XzYuMmBl0afcInl-- From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 11:41:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 395C01065670; Sat, 16 Oct 2010 11:41:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 270298FC14; Sat, 16 Oct 2010 11:41:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GBfLA4075585; Sat, 16 Oct 2010 11:41:21 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GBfLG9075583; Sat, 16 Oct 2010 11:41:21 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010161141.o9GBfLG9075583@svn.freebsd.org> From: Andriy Gapon Date: Sat, 16 Oct 2010 11:41:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213922 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 11:41:21 -0000 Author: avg Date: Sat Oct 16 11:41:20 2010 New Revision: 213922 URL: http://svn.freebsd.org/changeset/base/213922 Log: MFC r213527: vm.kmem_map_size: a sysctl to query current kmem_map->size Modified: stable/7/sys/kern/kern_malloc.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_malloc.c ============================================================================== --- stable/7/sys/kern/kern_malloc.c Sat Oct 16 11:24:27 2010 (r213921) +++ stable/7/sys/kern/kern_malloc.c Sat Oct 16 11:41:20 2010 (r213922) @@ -197,6 +197,11 @@ static u_int vm_kmem_size_scale; SYSCTL_UINT(_vm, OID_AUTO, kmem_size_scale, CTLFLAG_RDTUN, &vm_kmem_size_scale, 0, "Scale factor for kernel memory size"); +static int sysctl_kmem_map_size(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_vm, OID_AUTO, kmem_map_size, + CTLFLAG_RD | CTLTYPE_ULONG | CTLFLAG_MPSAFE, NULL, 0, + sysctl_kmem_map_size, "LU", "Current kmem_map allocation size"); + /* * The malloc_mtx protects the kmemstatistics linked list. */ @@ -233,6 +238,15 @@ SYSCTL_INT(_debug_malloc, OID_AUTO, fail &malloc_failure_count, 0, "Number of imposed M_NOWAIT malloc failures"); #endif +static int +sysctl_kmem_map_size(SYSCTL_HANDLER_ARGS) +{ + u_long size; + + size = kmem_map->size; + return (sysctl_handle_long(oidp, &size, 0, req)); +} + int malloc_last_fail(void) { From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 11:44:58 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFD4E106566C; Sat, 16 Oct 2010 11:44:58 +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 ADAFF8FC1D; Sat, 16 Oct 2010 11:44:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GBiwVX075722; Sat, 16 Oct 2010 11:44:58 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GBiwoM075720; Sat, 16 Oct 2010 11:44:58 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010161144.o9GBiwoM075720@svn.freebsd.org> From: Andriy Gapon Date: Sat, 16 Oct 2010 11:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213923 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 11:44:58 -0000 Author: avg Date: Sat Oct 16 11:44:58 2010 New Revision: 213923 URL: http://svn.freebsd.org/changeset/base/213923 Log: MFC r213651: add kmem_map_free sysctl: query largest contiguous free range in kmem_map Modified: stable/7/sys/kern/kern_malloc.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_malloc.c ============================================================================== --- stable/7/sys/kern/kern_malloc.c Sat Oct 16 11:41:20 2010 (r213922) +++ stable/7/sys/kern/kern_malloc.c Sat Oct 16 11:44:58 2010 (r213923) @@ -202,6 +202,11 @@ SYSCTL_PROC(_vm, OID_AUTO, kmem_map_size CTLFLAG_RD | CTLTYPE_ULONG | CTLFLAG_MPSAFE, NULL, 0, sysctl_kmem_map_size, "LU", "Current kmem_map allocation size"); +static int sysctl_kmem_map_free(SYSCTL_HANDLER_ARGS); +SYSCTL_PROC(_vm, OID_AUTO, kmem_map_free, + CTLFLAG_RD | CTLTYPE_ULONG | CTLFLAG_MPSAFE, NULL, 0, + sysctl_kmem_map_free, "LU", "Largest contiguous free range in kmem_map"); + /* * The malloc_mtx protects the kmemstatistics linked list. */ @@ -247,6 +252,18 @@ sysctl_kmem_map_size(SYSCTL_HANDLER_ARGS return (sysctl_handle_long(oidp, &size, 0, req)); } +static int +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; + vm_map_unlock_read(kmem_map); + return (sysctl_handle_long(oidp, &size, 0, req)); +} + int malloc_last_fail(void) { From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 11:52:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5704B106566C; Sat, 16 Oct 2010 11:52: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 445568FC08; Sat, 16 Oct 2010 11:52:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GBqiTg075921; Sat, 16 Oct 2010 11:52:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GBqidB075919; Sat, 16 Oct 2010 11:52:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010161152.o9GBqidB075919@svn.freebsd.org> From: Andriy Gapon Date: Sat, 16 Oct 2010 11:52: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: r213924 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 11:52:44 -0000 Author: avg Date: Sat Oct 16 11:52:43 2010 New Revision: 213924 URL: http://svn.freebsd.org/changeset/base/213924 Log: MFC r213730: zfs + sendfile: do not produce partially valid pages for vnode's tail Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Oct 16 11:44:58 2010 (r213923) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Oct 16 11:52:43 2010 (r213924) @@ -491,6 +491,8 @@ again: * but it pessimize performance of sendfile/UFS, that's * why I handle this special case in ZFS code. */ + KASSERT(off == 0, + ("unexpected offset in mappedread for sendfile")); if ((m->oflags & VPO_BUSY) != 0) { /* * Reference the page before unlocking and @@ -511,14 +513,15 @@ again: } if (error == 0) { va = zfs_map_page(m, &sf); - error = dmu_read(os, zp->z_id, start + off, - bytes, (void *)(va + off), + error = dmu_read(os, zp->z_id, start, bytes, va, DMU_READ_PREFETCH); + if (bytes != PAGE_SIZE) + bzero(va + bytes, PAGE_SIZE - bytes); zfs_unmap_page(sf); } VM_OBJECT_LOCK(obj); if (error == 0) - vm_page_set_valid(m, off, bytes); + m->valid = VM_PAGE_BITS_ALL; vm_page_wakeup(m); if (error == 0) { uio->uio_resid -= bytes; From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 12:40:00 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB6FC1065674; Sat, 16 Oct 2010 12:40:00 +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 A55A28FC16; Sat, 16 Oct 2010 12:40:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GCe0nT076931; Sat, 16 Oct 2010 12:40:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GCe0Vk076929; Sat, 16 Oct 2010 12:40:00 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201010161240.o9GCe0Vk076929@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 16 Oct 2010 12:40:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213925 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 12:40:00 -0000 Author: jilles Date: Sat Oct 16 12:40:00 2010 New Revision: 213925 URL: http://svn.freebsd.org/changeset/base/213925 Log: sh: Use rather than . is only for the kernel and conflicts with . Modified: head/bin/sh/jobs.c Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sat Oct 16 11:52:43 2010 (r213924) +++ head/bin/sh/jobs.c Sat Oct 16 12:40:00 2010 (r213925) @@ -41,13 +41,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include #include #include #include +#include #include #include From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 13:28:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C08B9106566C; Sat, 16 Oct 2010 13:28:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 22AC48FC0C; Sat, 16 Oct 2010 13:28:00 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o9GDRrON079666 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 16 Oct 2010 16:27:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o9GDRrj8029405; Sat, 16 Oct 2010 16:27:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o9GDRr06029404; Sat, 16 Oct 2010 16:27:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 16 Oct 2010 16:27:53 +0300 From: Kostik Belousov To: Hans Petter Selasky Message-ID: <20101016132753.GU2392@deviant.kiev.zoral.com.ua> References: <20101016100051.GS2392@deviant.kiev.zoral.com.ua> <201010161212.43749.hselasky@freebsd.org> <201010161330.31549.hselasky@c2i.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fQBt9K8gdUvY6oNp" Content-Disposition: inline In-Reply-To: <201010161330.31549.hselasky@c2i.net> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_05, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Andrew Thompson Subject: Re: svn commit: r213852 - in head: lib/libusb sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 13:28:01 -0000 --fQBt9K8gdUvY6oNp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 16, 2010 at 01:30:31PM +0200, Hans Petter Selasky wrote: > On Saturday 16 October 2010 12:12:43 Hans Petter Selasky wrote: > > On Saturday 16 October 2010 12:00:51 Kostik Belousov wrote: > > > > USB has some shared memory structures which are used in both user-l= and > > > > and kernel, which are not part of IOCTLs. Your approach means that > > > > there are two sets of IOCTL's of all kinds, one for 32-bit and one = for > > > > 64-bit? > > >=20 > > > For all kinds of structures that are not ABI-invariant, yes. > >=20 >=20 > Hi, >=20 > I've committed a patch to fix the buildworld breakage after feedback from= =20 > Andreas Tobler. >=20 > http://svn.freebsd.org/changeset/base/213920 >=20 > > The approach that was discussed by me and Andrew earlier this year, was= to > > use uint64_t instead of "void *" in shared memory structures. The only > > disadvantage is that this will force you to recompile libusb when you > > update the kernel, and so we kind of put that approach aside to keep > > seamless upgrade compatibility. >=20 > This will also break the ABI on 8-stable and that was the main reason for= =20 > going the other route. However, most applications access USB via libusb, = so=20 > the breakage would probably be minimal. Do you have any opinions here? Sh= ould=20 > we make an exception for the general rule to not change the ABI within a= =20 > stable branch? >=20 > I'm attaching the other approach, which allows both 32 and 64 bit applica= tions=20 > to use USB using the same IOCTL's. >=20 > See thread: [FreeBSD 8/9] [64-bit IOCTL] Using the USB stack from a 32-bi= t=20 > application under a 64-bit kernel. >=20 This is a choice of the poison :). Ideally, you would switch to the new ABI and keep old ABI shims around for binary compatibility. In essence, this is equivalent to the proper 32bit compat shims. > --HPS > --- src/lib/libusb/libusb20.c 2010-03-08 16:57:53.000000000 0000 > +++ src/lib/libusb/libusb20.c 2010-03-08 16:57:53.000000000 0000 > @@ -320,7 +320,7 @@ > void > libusb20_tr_set_buffer(struct libusb20_transfer *xfer, void *buffer, uin= t16_t frIndex) > { > - xfer->ppBuffer[frIndex] =3D buffer; > + xfer->ppBuffer[frIndex] =3D libusb20_u64ptr(buffer); > return; > } > =20 > @@ -386,7 +386,7 @@ > void > libusb20_tr_setup_bulk(struct libusb20_transfer *xfer, void *pBuf, uint3= 2_t length, uint32_t timeout) > { > - xfer->ppBuffer[0] =3D pBuf; > + xfer->ppBuffer[0] =3D libusb20_u64ptr(pBuf); > xfer->pLength[0] =3D length; > xfer->timeout =3D timeout; > xfer->nFrames =3D 1; > @@ -398,7 +398,7 @@ > { > uint16_t len; > =20 > - xfer->ppBuffer[0] =3D psetup; > + xfer->ppBuffer[0] =3D libusb20_u64ptr(psetup); > xfer->pLength[0] =3D 8; /* fixed */ > xfer->timeout =3D timeout; > =20 > @@ -406,7 +406,7 @@ > =20 > if (len !=3D 0) { > xfer->nFrames =3D 2; > - xfer->ppBuffer[1] =3D pBuf; > + xfer->ppBuffer[1] =3D libusb20_u64ptr(pBuf); > xfer->pLength[1] =3D len; > } else { > xfer->nFrames =3D 1; > @@ -417,7 +417,7 @@ > void > libusb20_tr_setup_intr(struct libusb20_transfer *xfer, void *pBuf, uint3= 2_t length, uint32_t timeout) > { > - xfer->ppBuffer[0] =3D pBuf; > + xfer->ppBuffer[0] =3D libusb20_u64ptr(pBuf); > xfer->pLength[0] =3D length; > xfer->timeout =3D timeout; > xfer->nFrames =3D 1; > @@ -431,7 +431,7 @@ > /* should not happen */ > return; > } > - xfer->ppBuffer[frIndex] =3D pBuf; > + xfer->ppBuffer[frIndex] =3D libusb20_u64ptr(pBuf); > xfer->pLength[frIndex] =3D length; > return; > } > --- src/lib/libusb/libusb20_int.h 2010-03-08 16:57:53.000000000 0000 > +++ src/lib/libusb/libusb20_int.h 2010-03-08 16:57:53.000000000 0000 > @@ -31,6 +31,8 @@ > #ifndef _LIBUSB20_INT_H_ > #define _LIBUSB20_INT_H_ > =20 > +#define libusb20_u64ptr(ptr) ((uint64_t)(uintptr_t)(ptr)) > + > struct libusb20_device; > struct libusb20_backend; > struct libusb20_transfer; > @@ -148,7 +150,7 @@ > /* > * Pointer to a list of buffer pointers: > */ > - void **ppBuffer; > + uint64_t *ppBuffer; > /* > * Pointer to frame lengths, which are updated to actual length > * after the USB transfer completes: > --- src/lib/libusb/libusb20_ugen20.c 2010-03-08 16:57:53.000000000 0000 > +++ src/lib/libusb/libusb20_ugen20.c 2010-03-08 16:57:53.000000000 0000 > @@ -763,8 +763,8 @@ > xfer->maxPacketLen =3D temp.max_packet_length; > =20 > /* setup buffer and length lists */ > - fsep->ppBuffer =3D xfer->ppBuffer;/* zero copy */ > - fsep->pLength =3D xfer->pLength; /* zero copy */ > + fsep->ppBuffer =3D libusb20_u64ptr(xfer->ppBuffer); /* zero copy */ > + fsep->pLength =3D libusb20_u64ptr(xfer->pLength); /* zero copy */ > =20 > return (0); /* success */ > } > --- src/sys/dev/usb/usb_generic.c 2010-05-17 04:19:10.000000000 0000 > +++ src/sys/dev/usb/usb_generic.c 2010-05-17 04:19:10.000000000 0000 > @@ -76,6 +76,7 @@ > #define UGEN_BULK_FS_BUFFER_SIZE (64*32) /* bytes */ > #define UGEN_BULK_HS_BUFFER_SIZE (1024*32) /* bytes */ > #define UGEN_HW_FRAMES 50 /* number of milliseconds per transfer */ > +#define UGEN_HW_PTR(u64) ((void *)(uintptr_t)(u64)) > =20 > /* function prototypes */ > =20 > @@ -134,7 +135,6 @@ > TUNABLE_INT("hw.usb.ugen.debug", &ugen_debug); > #endif > =20 > - > /* prototypes */ > =20 > static int > @@ -1039,7 +1039,7 @@ > struct usb_device_request *req; > struct usb_xfer *xfer; > struct usb_fs_endpoint fs_ep; > - void *uaddr; /* userland pointer */ > + uint64_t uaddr; /* userland pointer */ > void *kaddr; > usb_frlength_t offset; > usb_frlength_t rem; > @@ -1077,11 +1077,13 @@ > xfer->error =3D USB_ERR_INVAL; > goto complete; > } > - error =3D copyin(fs_ep.ppBuffer, > + > + /* read frame buffer pointer */ > + error =3D copyin(UGEN_HW_PTR(fs_ep.ppBuffer), > &uaddr, sizeof(uaddr)); > - if (error) { > + if (error) > return (error); > - } > + > /* reset first frame */ > usbd_xfer_set_frame_offset(xfer, 0, 0); > =20 > @@ -1089,7 +1091,8 @@ > =20 > req =3D xfer->frbuffers[0].buffer; > =20 > - error =3D copyin(fs_ep.pLength, > + /* read frame buffer length */ > + error =3D copyin(UGEN_HW_PTR(fs_ep.pLength), > &length, sizeof(length)); > if (error) { > return (error); > @@ -1099,7 +1102,7 @@ > goto complete; > } > if (length !=3D 0) { > - error =3D copyin(uaddr, req, length); > + error =3D copyin(UGEN_HW_PTR(uaddr), req, length); > if (error) { > return (error); > } > @@ -1159,11 +1162,12 @@ > =20 > for (; n !=3D xfer->nframes; n++) { > =20 > - error =3D copyin(fs_ep.pLength + n, > + /* read frame buffer length */ > + error =3D copyin(UGEN_HW_PTR(fs_ep.pLength + (4 * n)), > &length, sizeof(length)); > - if (error) { > + if (error) > break; > - } > + > usbd_xfer_set_frame_len(xfer, n, length); > =20 > if (length > rem) { > @@ -1174,12 +1178,12 @@ > =20 > if (!isread) { > =20 > - /* we need to know the source buffer */ > - error =3D copyin(fs_ep.ppBuffer + n, > + /* read frame buffer pointer */ > + error =3D copyin(UGEN_HW_PTR(fs_ep.ppBuffer + (8 * n)), > &uaddr, sizeof(uaddr)); > - if (error) { > + if (error) > break; > - } > + > if (xfer->flags_int.isochronous_xfr) { > /* get kernel buffer address */ > kaddr =3D xfer->frbuffers[0].buffer; > @@ -1193,7 +1197,7 @@ > } > =20 > /* move data */ > - error =3D copyin(uaddr, kaddr, length); > + error =3D copyin(UGEN_HW_PTR(uaddr), kaddr, length); > if (error) { > break; > } > @@ -1216,7 +1220,7 @@ > struct usb_xfer *xfer; > struct usb_fs_endpoint fs_ep; > struct usb_fs_endpoint *fs_ep_uptr; /* userland ptr */ > - void *uaddr; /* userland ptr */ > + uint64_t uaddr; /* userland ptr */ > void *kaddr; > usb_frlength_t offset; > usb_frlength_t rem; > @@ -1281,12 +1285,12 @@ > =20 > for (; n !=3D xfer->nframes; n++) { > =20 > - /* get initial length into "temp" */ > - error =3D copyin(fs_ep.pLength + n, > + /* get initial frame buffer length into "temp" */ > + error =3D copyin(UGEN_HW_PTR(fs_ep.pLength + (4 * n)), > &temp, sizeof(temp)); > - if (error) { > + if (error) > return (error); > - } > + > if (temp > rem) { > /* the userland length has been corrupted */ > DPRINTF("corrupt userland length " > @@ -1307,12 +1311,12 @@ > } > if (isread) { > =20 > - /* we need to know the destination buffer */ > - error =3D copyin(fs_ep.ppBuffer + n, > + /* read destination frame buffer pointer */ > + error =3D copyin(UGEN_HW_PTR(fs_ep.ppBuffer + (8 * n)), > &uaddr, sizeof(uaddr)); > - if (error) { > + if (error) > return (error); > - } > + > if (xfer->flags_int.isochronous_xfr) { > /* only one frame buffer */ > kaddr =3D USB_ADD_BYTES( > @@ -1323,7 +1327,7 @@ > } > =20 > /* move data */ > - error =3D copyout(kaddr, uaddr, length); > + error =3D copyout(kaddr, UGEN_HW_PTR(uaddr), length); > if (error) { > return (error); > } > @@ -1334,12 +1338,11 @@ > */ > offset +=3D temp; > =20 > - /* update length */ > + /* update frame buffer length */ > error =3D copyout(&length, > - fs_ep.pLength + n, sizeof(length)); > - if (error) { > + UGEN_HW_PTR(fs_ep.pLength + (4 * n)), sizeof(length)); > + if (error) > return (error); > - } > } > =20 > complete: > --- src/sys/dev/usb/usb_ioctl.h 2010-02-14 12:03:51.000000000 0000 > +++ src/sys/dev/usb/usb_ioctl.h 2010-02-14 12:03:51.000000000 0000 > @@ -131,9 +131,10 @@ > * NOTE: isochronous USB transfer only use one buffer, but can have > * multiple frame lengths ! > */ > - void **ppBuffer; /* pointer to userland buffers */ > - uint32_t *pLength; /* pointer to frame lengths, updated > - * to actual length */ > + uint64_t ppBuffer; /* pointer to 64-bit userland buffer pointers */ > + uint64_t pLength; /* pointer to 32-bit frame lengths, which > + * get updated to the actual length after > + * the transfer is complete. */ > uint32_t nFrames; /* number of frames */ > uint32_t aFrames; /* actual number of frames */ > uint16_t flags; --fQBt9K8gdUvY6oNp Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAky5qFkACgkQC3+MBN1Mb4hXawCg8790Uqptejc7vi9PWKbnZ8yJ TXMAoMqH/yxVZaEc2qxlq2q5os790EXs =O9Du -----END PGP SIGNATURE----- --fQBt9K8gdUvY6oNp-- From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 14:37:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4DB8106564A; Sat, 16 Oct 2010 14:37:56 +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 A40588FC14; Sat, 16 Oct 2010 14:37:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GEbuFg079568; Sat, 16 Oct 2010 14:37:56 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GEbunj079566; Sat, 16 Oct 2010 14:37:56 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201010161437.o9GEbunj079566@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 16 Oct 2010 14:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213926 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 14:37:56 -0000 Author: jilles Date: Sat Oct 16 14:37:56 2010 New Revision: 213926 URL: http://svn.freebsd.org/changeset/base/213926 Log: sh(1): Clarify subshells/processes for pipelines. For multi-command pipelines, 1. all commands are direct children of the shell (unlike the original Bourne shell) 2. all commands are executed in a subshell (unlike the real Korn shell) MFC after: 1 week Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sat Oct 16 12:40:00 2010 (r213925) +++ head/bin/sh/sh.1 Sat Oct 16 14:37:56 2010 (r213926) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd September 10, 2010 +.Dd October 16, 2010 .Dt SH 1 .Os .Sh NAME @@ -736,6 +736,13 @@ both of a command is considered to be as pipeline before any redirection specified by redirection operators that are part of the command. .Pp +Note that unlike some other shells, +.Nm +executes each process in a pipeline with more than one command +in a subshell environment and as a child of the +.Nm +process. +.Pp If the pipeline is not in the background (discussed later), the shell waits for all commands to complete. .Pp @@ -773,15 +780,6 @@ to be executed sequentially; an .Ql & causes asynchronous execution of the preceding AND-OR-list. -.Pp -Note that unlike some other shells, -.Nm -executes each process in the pipeline as a child of the -.Nm -process. -Shell built-in commands are the exception to this rule. -They are executed in the current shell, although they do not affect its -environment when used in pipelines. .Ss Background Commands (&) If a command is terminated by the control operator ampersand .Pq Ql & , From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 15:24:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25038106564A; Sat, 16 Oct 2010 15:24:05 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12F118FC0A; Sat, 16 Oct 2010 15:24:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GFO4O9080544; Sat, 16 Oct 2010 15:24:04 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GFO4aK080538; Sat, 16 Oct 2010 15:24:04 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201010161524.o9GFO4aK080538@svn.freebsd.org> From: Benedict Reuschling Date: Sat, 16 Oct 2010 15:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213927 - in head: usr.bin/compress usr.bin/gzip usr.sbin/pmcannotate X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 15:24:05 -0000 Author: bcr (doc committer) Date: Sat Oct 16 15:24:04 2010 New Revision: 213927 URL: http://svn.freebsd.org/changeset/base/213927 Log: Correct some typos in comments, no functional changes. Modified: head/usr.bin/compress/zopen.c head/usr.bin/gzip/gzip.c head/usr.bin/gzip/unpack.c head/usr.bin/gzip/zuncompress.c head/usr.sbin/pmcannotate/pmcannotate.c Modified: head/usr.bin/compress/zopen.c ============================================================================== --- head/usr.bin/compress/zopen.c Sat Oct 16 14:37:56 2010 (r213926) +++ head/usr.bin/compress/zopen.c Sat Oct 16 15:24:04 2010 (r213927) @@ -131,7 +131,7 @@ struct s_zstate { code_int zs_ent; code_int zs_hsize_reg; int zs_hshift; - } w; /* Write paramenters */ + } w; /* Write parameters */ struct { char_type *zs_stackp; int zs_finchar; Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Sat Oct 16 14:37:56 2010 (r213926) +++ head/usr.bin/gzip/gzip.c Sat Oct 16 15:24:04 2010 (r213927) @@ -1162,7 +1162,7 @@ unlink_input(const char *file, const str if (kflag) return; if (stat(file, &nsb) != 0) - /* Must be gone alrady */ + /* Must be gone already */ return; if (nsb.st_dev != sb->st_dev || nsb.st_ino != sb->st_ino) /* Definitely a different file */ Modified: head/usr.bin/gzip/unpack.c ============================================================================== --- head/usr.bin/gzip/unpack.c Sat Oct 16 14:37:56 2010 (r213926) +++ head/usr.bin/gzip/unpack.c Sat Oct 16 15:24:04 2010 (r213927) @@ -40,7 +40,7 @@ * tree levels, each level would consume 1 byte (See [1]). * * After the symbol count table, there is the symbol table, storing - * symbols represented by coresponding leaf node. EOB is not being + * symbols represented by corresponding leaf node. EOB is not being * explicitly transmitted (not necessary anyway) in the symbol table. * * Compressed data goes after the symbol table. @@ -61,7 +61,7 @@ /* * unpack descriptor * - * Represent the huffman tree in a similiar way that pack(1) would + * Represent the huffman tree in a similar way that pack(1) would * store in a packed file. We store all symbols in a linear table, * and store pointers to each level's first symbol. In addition to * that, maintain two counts for each level: inner nodes count and @@ -92,7 +92,7 @@ typedef struct { * Caller is responsible to make sure that all of these pointers are * initialized (in our case, they all point to valid memory block). * We don't zero out pointers here because nobody else would ever - * reference the memory block without scrubing them. + * reference the memory block without scrubbing them. */ static void unpack_descriptor_fini(unpack_descriptor_t *unpackd) @@ -117,7 +117,7 @@ unpackd_fill_inodesin(const unpack_descr /* * The internal nodes would be 1/2 of total internal nodes and * leaf nodes in the next level. For the last level there - * would be no internal node by defination. + * would be no internal node by definition. */ if (level < unpackd->treelevels) { unpackd_fill_inodesin(unpackd, level + 1); @@ -140,7 +140,7 @@ accepted_bytes(off_t *bytes_in, off_t ne /* * Read file header and construct the tree. Also, prepare the buffered I/O - * for decode rountine. + * for decode routine. * * Return value is uncompressed size. */ @@ -195,7 +195,7 @@ unpack_parse_header(int in, int out, cha /* We count from 0 so adjust to match array upper bound */ unpackd->treelevels--; - /* Read the levels symbol count table and caculate total */ + /* Read the levels symbol count table and calculate total */ unpackd->symbol_size = 1; /* EOB */ for (i = 0; i <= unpackd->treelevels; i++) { if ((thisbyte = fgetc(unpackd->fpIn)) == EOF) @@ -237,7 +237,7 @@ unpack_parse_header(int in, int out, cha /* * The symbolsin table has been constructed now. - * Caculate the internal nodes count table based on it. + * Calculate the internal nodes count table based on it. */ unpackd_fill_inodesin(unpackd, 0); } Modified: head/usr.bin/gzip/zuncompress.c ============================================================================== --- head/usr.bin/gzip/zuncompress.c Sat Oct 16 14:37:56 2010 (r213926) +++ head/usr.bin/gzip/zuncompress.c Sat Oct 16 15:24:04 2010 (r213927) @@ -115,7 +115,7 @@ struct s_zstate { code_int zs_ent; code_int zs_hsize_reg; int zs_hshift; - } w; /* Write paramenters */ + } w; /* Write parameters */ struct { char_type *zs_stackp; int zs_finchar; Modified: head/usr.sbin/pmcannotate/pmcannotate.c ============================================================================== --- head/usr.sbin/pmcannotate/pmcannotate.c Sat Oct 16 14:37:56 2010 (r213926) +++ head/usr.sbin/pmcannotate/pmcannotate.c Sat Oct 16 15:24:04 2010 (r213927) @@ -356,7 +356,7 @@ fqueue_insertent(struct entry *entry) } /* - * If the firt-level aggregation object alredy exist, + * If the first-level aggregation object already exist, * just aggregate the samples and, if needed, resort * it. */ From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 17:30:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CD101065674; Sat, 16 Oct 2010 17:30:28 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B1A98FC1E; Sat, 16 Oct 2010 17:30:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GHUS2Q083495; Sat, 16 Oct 2010 17:30:28 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GHUSeF083493; Sat, 16 Oct 2010 17:30:28 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201010161730.o9GHUSeF083493@svn.freebsd.org> From: Benedict Reuschling Date: Sat, 16 Oct 2010 17:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213928 - head/usr.sbin/pmcannotate X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 17:30:28 -0000 Author: bcr (doc committer) Date: Sat Oct 16 17:30:27 2010 New Revision: 213928 URL: http://svn.freebsd.org/changeset/base/213928 Log: Fix a grammatical error connected to the previous commit. Spotted by: gjb@ Modified: head/usr.sbin/pmcannotate/pmcannotate.c Modified: head/usr.sbin/pmcannotate/pmcannotate.c ============================================================================== --- head/usr.sbin/pmcannotate/pmcannotate.c Sat Oct 16 15:24:04 2010 (r213927) +++ head/usr.sbin/pmcannotate/pmcannotate.c Sat Oct 16 17:30:27 2010 (r213928) @@ -356,7 +356,7 @@ fqueue_insertent(struct entry *entry) } /* - * If the first-level aggregation object already exist, + * If the first-level aggregation object already exists, * just aggregate the samples and, if needed, resort * it. */ From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 18:42:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78D6B1065670; Sat, 16 Oct 2010 18:42:09 +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 67CB48FC12; Sat, 16 Oct 2010 18:42:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GIg9JA085748; Sat, 16 Oct 2010 18:42:09 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GIg9NH085745; Sat, 16 Oct 2010 18:42:09 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201010161842.o9GIg9NH085745@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 16 Oct 2010 18:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213929 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 18:42:09 -0000 Author: bz Date: Sat Oct 16 18:42:09 2010 New Revision: 213929 URL: http://svn.freebsd.org/changeset/base/213929 Log: lltable_drain() has never been used so far, thus #if 0 it for now. While touching it add the missing locking to the now disabled code for the time when we'll resurrect it. MFC after: 3 days Modified: head/sys/net/if_llatbl.c head/sys/net/if_llatbl.h Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Sat Oct 16 17:30:27 2010 (r213928) +++ head/sys/net/if_llatbl.c Sat Oct 16 18:42:09 2010 (r213929) @@ -183,6 +183,7 @@ lltable_free(struct lltable *llt) free(llt, M_LLTABLE); } +#if 0 void lltable_drain(int af) { @@ -197,15 +198,18 @@ lltable_drain(int af) for (i=0; i < LLTBL_HASHTBL_SIZE; i++) { LIST_FOREACH(lle, &llt->lle_head[i], lle_next) { + LLE_WLOCK(lle); if (lle->la_hold) { m_freem(lle->la_hold); lle->la_hold = NULL; } + LLE_WUNLOCK(lle); } } } LLTABLE_RUNLOCK(); } +#endif void lltable_prefix_free(int af, struct sockaddr *prefix, struct sockaddr *mask) Modified: head/sys/net/if_llatbl.h ============================================================================== --- head/sys/net/if_llatbl.h Sat Oct 16 17:30:27 2010 (r213928) +++ head/sys/net/if_llatbl.h Sat Oct 16 18:42:09 2010 (r213929) @@ -186,7 +186,9 @@ struct lltable *lltable_init(struct ifne void lltable_free(struct lltable *); void lltable_prefix_free(int, struct sockaddr *, struct sockaddr *); +#if 0 void lltable_drain(int); +#endif int lltable_sysctl_dumparp(int, struct sysctl_req *); void llentry_free(struct llentry *); From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 19:25:27 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C39B31065679; Sat, 16 Oct 2010 19:25:27 +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 B2C308FC0A; Sat, 16 Oct 2010 19:25:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GJPRx2087141; Sat, 16 Oct 2010 19:25:27 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GJPRmg087139; Sat, 16 Oct 2010 19:25:27 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201010161925.o9GJPRmg087139@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 16 Oct 2010 19:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213930 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 19:25:27 -0000 Author: bz Date: Sat Oct 16 19:25:27 2010 New Revision: 213930 URL: http://svn.freebsd.org/changeset/base/213930 Log: Close a race acquiring the IF_ADDR_LOCK() for each entry while iterating over all interfaces to make sure the address will neither change nor be freed while we are working on it. PR: kern/146250 Submitted by: Mikolaj Golub (to.my.trociny gmail.com) MFC after: 1 week Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sat Oct 16 18:42:09 2010 (r213929) +++ head/sys/net/rtsock.c Sat Oct 16 19:25:27 2010 (r213930) @@ -1473,6 +1473,7 @@ sysctl_iflist(int af, struct walkarg *w) TAILQ_FOREACH(ifp, &V_ifnet, if_link) { if (w->w_arg && w->w_arg != ifp->if_index) continue; + IF_ADDR_LOCK(ifp); ifa = ifp->if_addr; info.rti_info[RTAX_IFP] = ifa->ifa_addr; len = rt_msg2(RTM_IFINFO, &info, NULL, w); @@ -1530,10 +1531,13 @@ sysctl_iflist(int af, struct walkarg *w) goto done; } } + IF_ADDR_UNLOCK(ifp); info.rti_info[RTAX_IFA] = info.rti_info[RTAX_NETMASK] = info.rti_info[RTAX_BRD] = NULL; } done: + if (ifp != NULL) + IF_ADDR_UNLOCK(ifp); IFNET_RUNLOCK(); return (error); } From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 19:29:37 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E830F106566C; Sat, 16 Oct 2010 19:29:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D755C8FC14; Sat, 16 Oct 2010 19:29:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GJTbgY087291; Sat, 16 Oct 2010 19:29:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GJTbqW087289; Sat, 16 Oct 2010 19:29:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201010161929.o9GJTbqW087289@svn.freebsd.org> From: Alexander Motin Date: Sat, 16 Oct 2010 19:29:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213931 - head/sys/dev/usb/storage X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 19:29:38 -0000 Author: mav Date: Sat Oct 16 19:29:37 2010 New Revision: 213931 URL: http://svn.freebsd.org/changeset/base/213931 Log: Allow umass to use bigger transactions for USB 3.0 devices. It is less important for USB 2.0 devices and some of them reported to have problems with large transactions. But USB 3.0 benchmarks show that limited number of transactions per second on USB makes impossible to reach high transfer speeds without using bigger transactions. On my tests this change allows to read up to 220MB/s from USB-attached SSD (at block size of 256-512KB), comparing to only 113MB/s without it. Reviewed by: hselasky Modified: head/sys/dev/usb/storage/umass.c Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Sat Oct 16 19:25:27 2010 (r213930) +++ head/sys/dev/usb/storage/umass.c Sat Oct 16 19:29:37 2010 (r213931) @@ -2418,6 +2418,7 @@ umass_cam_action(struct cam_sim *sim, un case USB_SPEED_SUPER: cpi->base_transfer_speed = UMASS_SUPER_TRANSFER_SPEED; + cpi->maxio = MAXPHYS; break; case USB_SPEED_HIGH: cpi->base_transfer_speed = From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 19:53:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40EE4106566C; Sat, 16 Oct 2010 19:53:23 +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 2FE0B8FC08; Sat, 16 Oct 2010 19:53:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GJrNVH088037; Sat, 16 Oct 2010 19:53:23 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GJrN4q088035; Sat, 16 Oct 2010 19:53:23 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201010161953.o9GJrN4q088035@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 16 Oct 2010 19:53:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213932 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 19:53:23 -0000 Author: bz Date: Sat Oct 16 19:53:22 2010 New Revision: 213932 URL: http://svn.freebsd.org/changeset/base/213932 Log: MfP4 CH182763 (original version): Make it harder to exploit certain in_control() related races between the intiial lookup at the beginning and the time we will remove the entry from the lists by re-checking that entry is still in the list before trying to remove it. (*) It is believed that with the current code and locking strategy we cannot completely fix all race. Reported by: Nima Misaghian (nima_misa hotmail.com) on net@ 20100817 Tested by: Nima Misaghian (nima_misa hotmail.com) (original version) PR: kern/146250 Submitted by: Mikolaj Golub (to.my.trociny gmail.com) (different version) MFC after: 1 week Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Sat Oct 16 19:29:37 2010 (r213931) +++ head/sys/netinet/in.c Sat Oct 16 19:53:22 2010 (r213932) @@ -599,6 +599,21 @@ in_control(struct socket *so, u_long cmd } IF_ADDR_LOCK(ifp); + /* Re-check that ia is still part of the list. */ + TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa == &ia->ia_ifa) + break; + } + if (ifa == NULL) { + /* + * If we lost the race with another thread, there is no need to + * try it again for the next loop as there is no other exit + * path between here and out. + */ + IF_ADDR_UNLOCK(ifp); + error = EADDRNOTAVAIL; + goto out; + } TAILQ_REMOVE(&ifp->if_addrhead, &ia->ia_ifa, ifa_link); IF_ADDR_UNLOCK(ifp); ifa_free(&ia->ia_ifa); /* if_addrhead */ From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 19:56:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FA141065694; Sat, 16 Oct 2010 19:56:47 +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 5DE168FC32; Sat, 16 Oct 2010 19:56:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GJule2088191; Sat, 16 Oct 2010 19:56:47 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GJulGP088189; Sat, 16 Oct 2010 19:56:47 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010161956.o9GJulGP088189@svn.freebsd.org> From: Andriy Gapon Date: Sat, 16 Oct 2010 19:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213933 - stable/8/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 19:56:47 -0000 Author: avg Date: Sat Oct 16 19:56:46 2010 New Revision: 213933 URL: http://svn.freebsd.org/changeset/base/213933 Log: MFC r213735: tmpfs + sendfile: do not produce partially valid pages for vnode's tail Modified: stable/8/sys/fs/tmpfs/tmpfs_vnops.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/8/sys/fs/tmpfs/tmpfs_vnops.c Sat Oct 16 19:53:22 2010 (r213932) +++ stable/8/sys/fs/tmpfs/tmpfs_vnops.c Sat Oct 16 19:56:46 2010 (r213933) @@ -525,6 +525,8 @@ lookupvpg: VM_OBJECT_UNLOCK(vobj); return (error); } else if (m != NULL && uio->uio_segflg == UIO_NOCOPY) { + KASSERT(offset == 0, + ("unexpected offset in tmpfs_mappedread for sendfile")); if (vm_page_sleep_if_busy(m, FALSE, "tmfsmr")) goto lookupvpg; vm_page_busy(m); @@ -532,9 +534,10 @@ lookupvpg: sched_pin(); sf = sf_buf_alloc(m, SFB_CPUPRIVATE); ma = (char *)sf_buf_kva(sf); - error = tmpfs_nocacheread_buf(tobj, idx, offset, tlen, - ma + offset); + error = tmpfs_nocacheread_buf(tobj, idx, 0, tlen, ma); if (error == 0) { + if (tlen != PAGE_SIZE) + bzero(ma + tlen, PAGE_SIZE - tlen); uio->uio_offset += tlen; uio->uio_resid -= tlen; } @@ -542,7 +545,7 @@ lookupvpg: sched_unpin(); VM_OBJECT_LOCK(vobj); if (error == 0) - vm_page_set_valid(m, offset, tlen); + m->valid = VM_PAGE_BITS_ALL; vm_page_wakeup(m); VM_OBJECT_UNLOCK(vobj); return (error); From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 19:58:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC5E3106566B; Sat, 16 Oct 2010 19:58:49 +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 CAC0D8FC19; Sat, 16 Oct 2010 19:58:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GJwndD088309; Sat, 16 Oct 2010 19:58:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GJwnvH088307; Sat, 16 Oct 2010 19:58:49 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010161958.o9GJwnvH088307@svn.freebsd.org> From: Andriy Gapon Date: Sat, 16 Oct 2010 19:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213934 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 19:58:50 -0000 Author: avg Date: Sat Oct 16 19:58:49 2010 New Revision: 213934 URL: http://svn.freebsd.org/changeset/base/213934 Log: MFC r213648: panic_cpu variable should be volatile Modified: stable/8/sys/kern/kern_shutdown.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_shutdown.c ============================================================================== --- stable/8/sys/kern/kern_shutdown.c Sat Oct 16 19:56:46 2010 (r213933) +++ stable/8/sys/kern/kern_shutdown.c Sat Oct 16 19:58:49 2010 (r213934) @@ -513,10 +513,6 @@ shutdown_reset(void *junk, int howto) /* NOTREACHED */ /* assuming reset worked */ } -#ifdef SMP -static u_int panic_cpu = NOCPU; -#endif - /* * Panic is called on unresolvable fatal errors. It prints "panic: mesg", * and then reboots. If we are called twice, then we avoid trying to sync @@ -525,6 +521,9 @@ static u_int panic_cpu = NOCPU; void panic(const char *fmt, ...) { +#ifdef SMP + static volatile u_int panic_cpu = NOCPU; +#endif struct thread *td = curthread; int bootopt, newpanic; va_list ap; From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 20:01:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB071106566B; Sat, 16 Oct 2010 20:01:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C95D28FC1A; Sat, 16 Oct 2010 20:01:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GK1fOY088466; Sat, 16 Oct 2010 20:01:41 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GK1fuP088464; Sat, 16 Oct 2010 20:01:41 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010162001.o9GK1fuP088464@svn.freebsd.org> From: Andriy Gapon Date: Sat, 16 Oct 2010 20:01:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213935 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 20:01:42 -0000 Author: avg Date: Sat Oct 16 20:01:41 2010 New Revision: 213935 URL: http://svn.freebsd.org/changeset/base/213935 Log: MFC r213648: panic_cpu variable should be volatile Modified: stable/7/sys/kern/kern_shutdown.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_shutdown.c ============================================================================== --- stable/7/sys/kern/kern_shutdown.c Sat Oct 16 19:58:49 2010 (r213934) +++ stable/7/sys/kern/kern_shutdown.c Sat Oct 16 20:01:41 2010 (r213935) @@ -497,10 +497,6 @@ shutdown_reset(void *junk, int howto) /* NOTREACHED */ /* assuming reset worked */ } -#ifdef SMP -static u_int panic_cpu = NOCPU; -#endif - /* * Panic is called on unresolvable fatal errors. It prints "panic: mesg", * and then reboots. If we are called twice, then we avoid trying to sync @@ -509,6 +505,9 @@ static u_int panic_cpu = NOCPU; void panic(const char *fmt, ...) { +#ifdef SMP + static volatile u_int panic_cpu = NOCPU; +#endif struct thread *td = curthread; int bootopt, newpanic; va_list ap; From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 20:13:15 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0C5E1065670; Sat, 16 Oct 2010 20:13:15 +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 B41DE8FC0A; Sat, 16 Oct 2010 20:13:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GKDFcA088877; Sat, 16 Oct 2010 20:13:15 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GKDFLn088875; Sat, 16 Oct 2010 20:13:15 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010162013.o9GKDFLn088875@svn.freebsd.org> From: Andriy Gapon Date: Sat, 16 Oct 2010 20:13:15 +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: r213936 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 20:13:16 -0000 Author: avg Date: Sat Oct 16 20:13:15 2010 New Revision: 213936 URL: http://svn.freebsd.org/changeset/base/213936 Log: Revert r213261 (MFC of r212652): vm_page_sleep change has not been MFCed yet Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Oct 16 20:01:41 2010 (r213935) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Oct 16 20:13:15 2010 (r213936) @@ -322,17 +322,8 @@ page_lookup(vnode_t *vp, int64_t start, for (;;) { if ((pp = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && vm_page_is_valid(pp, (vm_offset_t)off, nbytes)) { - if ((pp->oflags & VPO_BUSY) != 0) { - /* - * Reference the page before unlocking and - * sleeping so that the page daemon is less - * likely to reclaim it. - */ - vm_page_lock_queues(); - vm_page_flag_set(pp, PG_REFERENCED); - vm_page_sleep(pp, "zfsmwb"); + if (vm_page_sleep_if_busy(pp, FALSE, "zfsmwb")) continue; - } vm_page_busy(pp); vm_page_lock_queues(); vm_page_undirty(pp); @@ -460,18 +451,8 @@ mappedread(vnode_t *vp, int nbytes, uio_ again: if ((m = vm_page_lookup(obj, OFF_TO_IDX(start))) != NULL && vm_page_is_valid(m, off, bytes)) { - if ((m->oflags & VPO_BUSY) != 0) { - /* - * Reference the page before unlocking and - * sleeping so that the page daemon is less - * likely to reclaim it. - */ - vm_page_lock_queues(); - vm_page_flag_set(m, PG_REFERENCED); - vm_page_sleep(m, "zfsmrb"); + if (vm_page_sleep_if_busy(m, FALSE, "zfsmrb")) goto again; - } - vm_page_busy(m); VM_OBJECT_UNLOCK(obj); if (dirbytes > 0) { @@ -493,17 +474,8 @@ again: */ KASSERT(off == 0, ("unexpected offset in mappedread for sendfile")); - if ((m->oflags & VPO_BUSY) != 0) { - /* - * Reference the page before unlocking and - * sleeping so that the page daemon is less - * likely to reclaim it. - */ - vm_page_lock_queues(); - vm_page_flag_set(m, PG_REFERENCED); - vm_page_sleep(m, "zfsmrb"); + if (vm_page_sleep_if_busy(m, FALSE, "zfsmrb")) goto again; - } vm_page_busy(m); VM_OBJECT_UNLOCK(obj); if (dirbytes > 0) { From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 20:15:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3384B106566B; Sat, 16 Oct 2010 20:15:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id AD7788FC12; Sat, 16 Oct 2010 20:15:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id A5BC041C71D; Sat, 16 Oct 2010 22:15:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id Bvetxud-+m+j; Sat, 16 Oct 2010 22:15:06 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id EDC9541C72C; Sat, 16 Oct 2010 22:15:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id C00514448F3; Sat, 16 Oct 2010 20:11:10 +0000 (UTC) Date: Sat, 16 Oct 2010 20:11:10 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201010161953.o9GJrN4q088035@svn.freebsd.org> Message-ID: <20101016195748.E10185@maildrop.int.zabbadoz.net> References: <201010161953.o9GJrN4q088035@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: Re: svn commit: r213932 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 20:15:08 -0000 On Sat, 16 Oct 2010, Bjoern A. Zeeb wrote: > Author: bz > Date: Sat Oct 16 19:53:22 2010 > New Revision: 213932 > URL: http://svn.freebsd.org/changeset/base/213932 > > Log: > MfP4 CH182763 (original version): > > Make it harder to exploit certain in_control() related races between the > intiial lookup at the beginning and the time we will remove the entry > from the lists by re-checking that entry is still in the list before > trying to remove it. > > (*) It is believed that with the current code and locking strategy we > cannot completely fix all race. Just as a follow-up: a couple of weeks ago I spent too much time on this to come to that conclusion. Try running 3 or more parallel ifconfig loops adding and removing the very same address and it's only matter of seconds. In case someone is interested I have a way huger patch of unknown state around but it's always only shifiting the problem. A possibly better fix to change the locking strategy is currently under discussion. > Reported by: Nima Misaghian (nima_misa hotmail.com) on net@ 20100817 > Tested by: Nima Misaghian (nima_misa hotmail.com) (original version) > PR: kern/146250 > Submitted by: Mikolaj Golub (to.my.trociny gmail.com) (different version) > MFC after: 1 week > > Modified: > head/sys/netinet/in.c -- Bjoern A. Zeeb Welcome a new stage of life. From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 20:43:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5543106564A; Sat, 16 Oct 2010 20:43:05 +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 5C55D8FC08; Sat, 16 Oct 2010 20:43:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GKh5lR089821; Sat, 16 Oct 2010 20:43:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GKh5PW089819; Sat, 16 Oct 2010 20:43:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010162043.o9GKh5PW089819@svn.freebsd.org> From: Andriy Gapon Date: Sat, 16 Oct 2010 20:43:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213937 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 20:43:05 -0000 Author: avg Date: Sat Oct 16 20:43:05 2010 New Revision: 213937 URL: http://svn.freebsd.org/changeset/base/213937 Log: zfs: add vop_getpages method implementation This should make vnode_pager_getpages path a bit shorter and clearer. Also this should eliminate problems with partially valid pages. Having this method opens room for future optimizations. To do: try to satisfy other pages besides the required one taking into account tradeofs between number of page faults, read throughput and read latency. Also, eventually vop_putpages should be added too. Reviewed by: kib, mm, pjd MFC after: 3 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Oct 16 20:13:15 2010 (r213936) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Oct 16 20:43:05 2010 (r213937) @@ -4199,6 +4199,96 @@ ioflags(int ioflags) } static int +zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int reqpage) +{ + znode_t *zp = VTOZ(vp); + zfsvfs_t *zfsvfs = zp->z_zfsvfs; + objset_t *os = zp->z_zfsvfs->z_os; + vm_page_t mreq; + vm_object_t object; + caddr_t va; + struct sf_buf *sf; + int i, error; + int pcount, size; + + ZFS_ENTER(zfsvfs); + ZFS_VERIFY_ZP(zp); + + pcount = round_page(count) / PAGE_SIZE; + mreq = m[reqpage]; + object = mreq->object; + error = 0; + + KASSERT(vp->v_object == object, ("mismatching object")); + + VM_OBJECT_LOCK(object); + + for (i = 0; i < pcount; i++) { + if (i != reqpage) { + vm_page_lock(m[i]); + vm_page_free(m[i]); + vm_page_unlock(m[i]); + } + } + + if (mreq->valid) { + if (mreq->valid != VM_PAGE_BITS_ALL) + vm_page_zero_invalid(mreq, TRUE); + VM_OBJECT_UNLOCK(object); + ZFS_EXIT(zfsvfs); + return (VM_PAGER_OK); + } + + PCPU_INC(cnt.v_vnodein); + PCPU_INC(cnt.v_vnodepgsin); + + if (IDX_TO_OFF(mreq->pindex) >= object->un_pager.vnp.vnp_size) { + VM_OBJECT_UNLOCK(object); + ZFS_EXIT(zfsvfs); + return (VM_PAGER_BAD); + } + + size = PAGE_SIZE; + if (IDX_TO_OFF(mreq->pindex) + size > object->un_pager.vnp.vnp_size) + size = object->un_pager.vnp.vnp_size - IDX_TO_OFF(mreq->pindex); + + VM_OBJECT_UNLOCK(object); + + va = zfs_map_page(mreq, &sf); + error = dmu_read(os, zp->z_id, IDX_TO_OFF(mreq->pindex), + size, va, DMU_READ_PREFETCH); + if (size != PAGE_SIZE) + bzero(va + size, PAGE_SIZE - size); + zfs_unmap_page(sf); + + VM_OBJECT_LOCK(object); + + if (!error) + mreq->valid = VM_PAGE_BITS_ALL; + KASSERT(mreq->dirty == 0, ("zfs_getpages: page %p is dirty", mreq)); + + VM_OBJECT_UNLOCK(object); + + ZFS_ACCESSTIME_STAMP(zfsvfs, zp); + ZFS_EXIT(zfsvfs); + return (error ? VM_PAGER_ERROR : VM_PAGER_OK); +} + +static int +zfs_freebsd_getpages(ap) + struct vop_getpages_args /* { + struct vnode *a_vp; + vm_page_t *a_m; + int a_count; + int a_reqpage; + vm_ooffset_t a_offset; + } */ *ap; +{ + + return (zfs_getpages(ap->a_vp, ap->a_m, ap->a_count, ap->a_reqpage)); +} + +static int zfs_freebsd_open(ap) struct vop_open_args /* { struct vnode *a_vp; @@ -5314,6 +5404,7 @@ struct vop_vector zfs_vnodeops = { .vop_getacl = zfs_freebsd_getacl, .vop_setacl = zfs_freebsd_setacl, .vop_aclcheck = zfs_freebsd_aclcheck, + .vop_getpages = zfs_freebsd_getpages, }; struct vop_vector zfs_fifoops = { From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 22:48:49 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CAD2106566B; Sat, 16 Oct 2010 22:48:49 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B5F18FC13; Sat, 16 Oct 2010 22:48:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GMmnp1093513; Sat, 16 Oct 2010 22:48:49 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GMmmWY093511; Sat, 16 Oct 2010 22:48:49 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010162248.o9GMmmWY093511@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 16 Oct 2010 22:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213938 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 22:48:49 -0000 Author: pjd Date: Sat Oct 16 22:48:48 2010 New Revision: 213938 URL: http://svn.freebsd.org/changeset/base/213938 Log: Clear signal mask before executing a hook. Submitted by: Mikolaj Golub MFC after: 3 days Modified: head/sbin/hastd/hooks.c Modified: head/sbin/hastd/hooks.c ============================================================================== --- head/sbin/hastd/hooks.c Sat Oct 16 20:43:05 2010 (r213937) +++ head/sbin/hastd/hooks.c Sat Oct 16 22:48:48 2010 (r213938) @@ -354,6 +354,7 @@ hook_execv(const char *path, va_list ap) struct hookproc *hp; char *args[64]; unsigned int ii; + sigset_t mask; pid_t pid; assert(hooks_initialized); @@ -382,6 +383,8 @@ hook_execv(const char *path, va_list ap) return; case 0: /* Child. */ descriptors(); + PJDLOG_VERIFY(sigemptyset(&mask) == 0); + PJDLOG_VERIFY(sigprocmask(SIG_SETMASK, &mask, NULL) == 0); execv(path, args); pjdlog_errno(LOG_ERR, "Unable to execute %s", path); exit(EX_SOFTWARE); From owner-svn-src-all@FreeBSD.ORG Sat Oct 16 22:50:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 280EC106566C; Sat, 16 Oct 2010 22:50:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16B108FC12; Sat, 16 Oct 2010 22:50:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GMoCLg093588; Sat, 16 Oct 2010 22:50:12 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GMoCVr093586; Sat, 16 Oct 2010 22:50:12 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201010162250.o9GMoCVr093586@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 16 Oct 2010 22:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213939 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 22:50:13 -0000 Author: pjd Date: Sat Oct 16 22:50:12 2010 New Revision: 213939 URL: http://svn.freebsd.org/changeset/base/213939 Log: Use one fprintf() instead of two. MFC after: 3 days Modified: head/sbin/hastd/pjdlog.c Modified: head/sbin/hastd/pjdlog.c ============================================================================== --- head/sbin/hastd/pjdlog.c Sat Oct 16 22:48:48 2010 (r213938) +++ head/sbin/hastd/pjdlog.c Sat Oct 16 22:50:12 2010 (r213939) @@ -214,8 +214,7 @@ pjdlogv_common(int loglevel, int debugle /* Attach debuglevel if this is debug log. */ if (loglevel == LOG_DEBUG) fprintf(out, "[%d]", debuglevel); - fprintf(out, " "); - fprintf(out, "%s", pjdlog_prefix); + fprintf(out, " %s", pjdlog_prefix); vfprintf(out, fmt, ap); if (error != -1) fprintf(out, ": %s.", strerror(error));