From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 00:18:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D46C2106568B; Sun, 14 Feb 2010 00:18:32 +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 C28858FC13; Sun, 14 Feb 2010 00:18: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 o1E0IWij004242; Sun, 14 Feb 2010 00:18:32 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1E0IWsY004240; Sun, 14 Feb 2010 00:18:32 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201002140018.o1E0IWsY004240@svn.freebsd.org> From: Rick Macklem Date: Sun, 14 Feb 2010 00:18: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: r203849 - head/sys/fs/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 00:18:32 -0000 Author: rmacklem Date: Sun Feb 14 00:18:32 2010 New Revision: 203849 URL: http://svn.freebsd.org/changeset/base/203849 Log: Change the default value for vfs.newnfs.enable_locallocks to 0 for the experimental NFS server, since local locking is known to be broken and the patch to fix it is still a work in progress. MFC after: 5 days Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Sat Feb 13 23:56:19 2010 (r203848) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Sun Feb 14 00:18:32 2010 (r203849) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); struct nfsrv_stablefirst nfsrv_stablefirst; int nfsrv_issuedelegs = 0; -int nfsrv_dolocallocks = 1; +int nfsrv_dolocallocks = 0; struct nfsv4lock nfsv4rootfs_lock; extern int newnfs_numnfsd; From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 05:02:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAE3E1065670; Sun, 14 Feb 2010 05:02:08 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB01C8FC0C; Sun, 14 Feb 2010 05:02: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 o1E5281p068981; Sun, 14 Feb 2010 05:02:08 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1E528ZK068979; Sun, 14 Feb 2010 05:02:08 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201002140502.o1E528ZK068979@svn.freebsd.org> From: Kevin Lo Date: Sun, 14 Feb 2010 05:02: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: r203852 - head/sys/arm/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 05:02:08 -0000 Author: kevlo Date: Sun Feb 14 05:02:08 2010 New Revision: 203852 URL: http://svn.freebsd.org/changeset/base/203852 Log: Correct cpu id for FA526. While I'm here, add cpu id for FA626TE. Modified: head/sys/arm/include/armreg.h Modified: head/sys/arm/include/armreg.h ============================================================================== --- head/sys/arm/include/armreg.h Sun Feb 14 00:43:42 2010 (r203851) +++ head/sys/arm/include/armreg.h Sun Feb 14 05:02:08 2010 (r203852) @@ -151,7 +151,8 @@ #define CPU_ID_MV88FR131 0x56251310 /* Marvell Feroceon 88FR131 Core */ #define CPU_ID_MV88FR571_VD 0x56155710 /* Marvell Feroceon 88FR571-VD Core (ID from datasheet) */ #define CPU_ID_MV88FR571_41 0x41159260 /* Marvell Feroceon 88FR571-VD Core (actual ID from CPU reg) */ -#define CPU_ID_FA526 0x66015260 +#define CPU_ID_FA526 0x66015261 +#define CPU_ID_FA626TE 0x66056261 #define CPU_ID_SA1110 0x6901b110 #define CPU_ID_IXP1200 0x6901c120 #define CPU_ID_80200 0x69052000 From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 11:04:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F04E9106566C; Sun, 14 Feb 2010 11:04:52 +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 E00978FC0A; Sun, 14 Feb 2010 11:04: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 o1EB4qd5051201; Sun, 14 Feb 2010 11:04:52 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EB4qPN051199; Sun, 14 Feb 2010 11:04:52 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201002141104.o1EB4qPN051199@svn.freebsd.org> From: Rui Paulo Date: Sun, 14 Feb 2010 11:04: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: r203859 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 11:04:53 -0000 Author: rpaulo Date: Sun Feb 14 11:04:52 2010 New Revision: 203859 URL: http://svn.freebsd.org/changeset/base/203859 Log: Also build ah_eeprom_v4k.c when ar9280 is selected. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Feb 14 09:48:53 2010 (r203858) +++ head/sys/conf/files Sun Feb 14 11:04:52 2010 (r203859) @@ -555,7 +555,7 @@ dev/ath/ath_hal/ah_eeprom_v14.c \ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ath_hal/ah_eeprom_v4k.c \ - optional ath_hal | ath_ar9285 \ + optional ath_hal | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ath_hal/ah_regdomain.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 12:00:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0BA07106588E; Sun, 14 Feb 2010 12:00:43 +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 EFF558FC27; Sun, 14 Feb 2010 12:00: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 o1EC0gk3063610; Sun, 14 Feb 2010 12:00:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EC0gf8063608; Sun, 14 Feb 2010 12:00:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201002141200.o1EC0gf8063608@svn.freebsd.org> From: Ed Schouten Date: Sun, 14 Feb 2010 12:00: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: r203862 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 12:00:43 -0000 Author: ed Date: Sun Feb 14 12:00:42 2010 New Revision: 203862 URL: http://svn.freebsd.org/changeset/base/203862 Log: Make work without including . According to the last POSIX specification that contained , this header should also typedef time_t properly. Also add a proper comment to the final #endif. Modified: head/sys/sys/timeb.h Modified: head/sys/sys/timeb.h ============================================================================== --- head/sys/sys/timeb.h Sun Feb 14 12:00:23 2010 (r203861) +++ head/sys/sys/timeb.h Sun Feb 14 12:00:42 2010 (r203862) @@ -38,6 +38,13 @@ #ifndef _SYS_TIMEB_H_ #define _SYS_TIMEB_H_ +#include + +#ifndef _TIME_T_DECLARED +typedef __time_t time_t; +#define _TIME_T_DECLARED +#endif + /* The ftime(2) system call structure -- deprecated. */ struct timeb { time_t time; /* seconds since the Epoch */ @@ -54,4 +61,4 @@ int ftime(struct timeb *); __END_DECLS #endif /* _KERNEL */ -#endif +#endif /* !_SYS_TIMEB_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 12:08:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E72D31065710; Sun, 14 Feb 2010 12:08:44 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6C698FC19; Sun, 14 Feb 2010 12:08: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 o1EC8iYg065557; Sun, 14 Feb 2010 12:08:44 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EC8iln065555; Sun, 14 Feb 2010 12:08:44 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002141208.o1EC8iln065555@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 14 Feb 2010 12:08: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: r203865 - head/usr.bin/find X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 12:08:45 -0000 Author: gavin Date: Sun Feb 14 12:08:44 2010 New Revision: 203865 URL: http://svn.freebsd.org/changeset/base/203865 Log: The -newerXB option was being interpreted the same as the -newerXm option as a check for F_TIME2_B was missing. Fix this. PR: bin/138245 Submitted by: "David E. Cross" MFC after: 1 month Modified: head/usr.bin/find/function.c Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Sun Feb 14 12:04:25 2010 (r203864) +++ head/usr.bin/find/function.c Sun Feb 14 12:08:44 2010 (r203865) @@ -1164,6 +1164,8 @@ c_newer(OPTION *option, char ***argvp) new->t_data = sb.st_ctime; else if (option->flags & F_TIME2_A) new->t_data = sb.st_atime; + else if (option->flags & F_TIME2_B) + new->t_data = sb.st_birthtime; else new->t_data = sb.st_mtime; } From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 12:10:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 702B41065670; Sun, 14 Feb 2010 12:10:49 +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 604BC8FC16; Sun, 14 Feb 2010 12: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 o1ECAnMe066058; Sun, 14 Feb 2010 12:10:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ECAnZS066056; Sun, 14 Feb 2010 12:10:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002141210.o1ECAnZS066056@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 14 Feb 2010 12:10: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: r203866 - head/sys/fs/msdosfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 12:10:49 -0000 Author: kib Date: Sun Feb 14 12:10:49 2010 New Revision: 203866 URL: http://svn.freebsd.org/changeset/base/203866 Log: Invalid filesystem might cause the bp to be never read. Noted by: Pedro F. Giffuni Obtanined from: NetBSD MFC after: 1 week Modified: head/sys/fs/msdosfs/msdosfs_fat.c Modified: head/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_fat.c Sun Feb 14 12:08:44 2010 (r203865) +++ head/sys/fs/msdosfs/msdosfs_fat.c Sun Feb 14 12:10:49 2010 (r203866) @@ -944,7 +944,8 @@ fillinusemap(pmp) if (readcn == 0) usemap_free(pmp, cn); } - brelse(bp); + if (bp != NULL) + brelse(bp); return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 12:25:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47C5E106566B; Sun, 14 Feb 2010 12:25:04 +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 36F0D8FC0C; Sun, 14 Feb 2010 12:25: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 o1ECP4Zd069293; Sun, 14 Feb 2010 12:25:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ECP4UR069292; Sun, 14 Feb 2010 12:25:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002141225.o1ECP4UR069292@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 14 Feb 2010 12:25: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: r203868 - head/sbin/newfs_msdos X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 12:25:04 -0000 Author: kib Date: Sun Feb 14 12:25:03 2010 New Revision: 203868 URL: http://svn.freebsd.org/changeset/base/203868 Log: Some cleanups from NetBSD: - C99 initializers. - Change the default volume label from "NO NAME" to "NO_NAME". - Set OEM String to "BSD4.4 " following the unnamed spacing convention in that other OS that suggests "MSWIN4.1" Also, David Naylor's changes for Clang, mostly changing the signess of constants. Submitted by: Pedro F. Giffuni Clang fixes by: David Naylor Reviewed by: bde (with some disagreement about Clang issues) MFC after: 2 weeks Modified: head/sbin/newfs_msdos/newfs_msdos.8 head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/newfs_msdos.8 ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.8 Sun Feb 14 12:24:12 2010 (r203867) +++ head/sbin/newfs_msdos/newfs_msdos.8 Sun Feb 14 12:25:03 2010 (r203868) @@ -116,7 +116,7 @@ The default is .It Fl S Ar sector-size Number of bytes per sector. Acceptable values are powers of 2 -in the range 128 through 32768. +in the range 512 through 32768. .It Fl a Ar FAT-size Number of sectors per FAT. .It Fl b Ar block-size Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Sun Feb 14 12:24:12 2010 (r203867) +++ head/sbin/newfs_msdos/newfs_msdos.c Sun Feb 14 12:25:03 2010 (r203868) @@ -62,12 +62,12 @@ static const char rcsid[] = #define DEFBLK16 2048 /* default block size FAT16 */ #define DEFRDE 512 /* default root directory entries */ #define RESFTE 2 /* reserved FAT entries */ -#define MINCLS12 1 /* minimum FAT12 clusters */ -#define MINCLS16 0x1000 /* minimum FAT16 clusters */ -#define MINCLS32 2 /* minimum FAT32 clusters */ -#define MAXCLS12 0xfed /* maximum FAT12 clusters */ -#define MAXCLS16 0xfff5 /* maximum FAT16 clusters */ -#define MAXCLS32 0xffffff5 /* maximum FAT32 clusters */ +#define MINCLS12 1U /* minimum FAT12 clusters */ +#define MINCLS16 0x1000U /* minimum FAT16 clusters */ +#define MINCLS32 2U /* minimum FAT32 clusters */ +#define MAXCLS12 0xfedU /* maximum FAT12 clusters */ +#define MAXCLS16 0xfff5U /* maximum FAT16 clusters */ +#define MAXCLS32 0xffffff5U /* maximum FAT32 clusters */ #define mincls(fat) ((fat) == 12 ? MINCLS12 : \ (fat) == 16 ? MINCLS16 : \ @@ -165,20 +165,23 @@ struct bpb { #define BPBGAP 0, 0, 0, 0, 0, 0 +#define INIT(a, b, c, d, e, f, g, h, i, j) \ + { .bps = a, .spc = b, .res = c, .nft = d, .rde = e, \ + .sec = f, .mid = g, .spf = h, .spt = i, .hds = j, } static struct { const char *name; struct bpb bpb; } const stdfmt[] = { - {"160", {512, 1, 1, 2, 64, 320, 0xfe, 1, 8, 1, BPBGAP}}, - {"180", {512, 1, 1, 2, 64, 360, 0xfc, 2, 9, 1, BPBGAP}}, - {"320", {512, 2, 1, 2, 112, 640, 0xff, 1, 8, 2, BPBGAP}}, - {"360", {512, 2, 1, 2, 112, 720, 0xfd, 2, 9, 2, BPBGAP}}, - {"640", {512, 2, 1, 2, 112, 1280, 0xfb, 2, 8, 2, BPBGAP}}, - {"720", {512, 2, 1, 2, 112, 1440, 0xf9, 3, 9, 2, BPBGAP}}, - {"1200", {512, 1, 1, 2, 224, 2400, 0xf9, 7, 15, 2, BPBGAP}}, - {"1232", {1024,1, 1, 2, 192, 1232, 0xfe, 2, 8, 2, BPBGAP}}, - {"1440", {512, 1, 1, 2, 224, 2880, 0xf0, 9, 18, 2, BPBGAP}}, - {"2880", {512, 2, 1, 2, 240, 5760, 0xf0, 9, 36, 2, BPBGAP}} + {"160", INIT(512, 1, 1, 2, 64, 320, 0xfe, 1, 8, 1)}, + {"180", INIT(512, 1, 1, 2, 64, 360, 0xfc, 2, 9, 1)}, + {"320", INIT(512, 2, 1, 2, 112, 640, 0xff, 1, 8, 2)}, + {"360", INIT(512, 2, 1, 2, 112, 720, 0xfd, 2, 9, 2)}, + {"640", INIT(512, 2, 1, 2, 112, 1280, 0xfb, 2, 8, 2)}, + {"720", INIT(512, 2, 1, 2, 112, 1440, 0xf9, 3, 9, 2)}, + {"1200", INIT(512, 1, 1, 2, 224, 2400, 0xf9, 7, 15, 2)}, + {"1232", INIT(1024,1, 1, 2, 192, 1232, 0xfe, 2, 8, 2)}, + {"1440", INIT(512, 1, 1, 2, 224, 2880, 0xf0, 9, 18, 2)}, + {"2880", INIT(512, 2, 1, 2, 240, 5760, 0xf0, 9, 36, 2)} }; static const u_int8_t bootcode[] = { @@ -533,7 +536,7 @@ main(int argc, char *argv[]) if (!bpb.res) bpb.res = fat == 32 ? MAX(x, MAX(16384 / bpb.bps, 4)) : x; else if (bpb.res < x) - errx(1, "too few reserved sectors"); + errx(1, "too few reserved sectors (need %d have %d)", x, bpb.res); if (fat != 32 && !bpb.rde) bpb.rde = DEFRDE; rds = howmany(bpb.rde, bpb.bps / sizeof(struct de)); @@ -657,7 +660,7 @@ main(int argc, char *argv[]) ((u_int)tm->tm_hour << 8 | (u_int)tm->tm_min)); mk4(bsx->volid, x); - mklabel(bsx->label, opt_L ? opt_L : "NO NAME"); + mklabel(bsx->label, opt_L ? opt_L : "NO_NAME"); sprintf(buf, "FAT%u", fat); setstr(bsx->type, buf, sizeof(bsx->type)); if (!opt_B) { @@ -666,7 +669,7 @@ main(int argc, char *argv[]) mk1(bs->jmp[0], 0xeb); mk1(bs->jmp[1], x1 - 2); mk1(bs->jmp[2], 0x90); - setstr(bs->oem, opt_O ? opt_O : "BSD 4.4", + setstr(bs->oem, opt_O ? opt_O : "BSD4.4 ", sizeof(bs->oem)); memcpy(img + x1, bootcode, sizeof(bootcode)); mk2(img + MINBPS - 2, DOSMAGIC); From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 12:25:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E13AC1065692; Sun, 14 Feb 2010 12:25:39 +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 CFCB38FC08; Sun, 14 Feb 2010 12:25: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 o1ECPd81069463; Sun, 14 Feb 2010 12:25:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ECPdwB069460; Sun, 14 Feb 2010 12:25:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002141225.o1ECPdwB069460@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 14 Feb 2010 12:25: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: r203869 - head/sbin/newfs_msdos X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 12:25:40 -0000 Author: kib Date: Sun Feb 14 12:25:39 2010 New Revision: 203869 URL: http://svn.freebsd.org/changeset/base/203869 Log: Rename variables to match msdosfs headers. Submitted by: Pedro F. Giffuni Reviewed by: bde MFC after: 2 weeks Modified: head/sbin/newfs_msdos/newfs_msdos.8 head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/newfs_msdos.8 ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.8 Sun Feb 14 12:25:03 2010 (r203868) +++ head/sbin/newfs_msdos/newfs_msdos.8 Sun Feb 14 12:25:39 2010 (r203869) @@ -38,14 +38,14 @@ .Op Fl B Ar boot .Op Fl C Ar create-size .Op Fl F Ar FAT-type -.Op Fl I Ar volid +.Op Fl I Ar VolumeId .Op Fl L Ar label .Op Fl O Ar OEM .Op Fl S Ar sector-size .Op Fl a Ar FAT-size .Op Fl b Ar block-size .Op Fl c Ar cluster-size -.Op Fl e Ar dirents +.Op Fl e Ar DirEnts .Op Fl f Ar format .Op Fl h Ar heads .Op Fl i Ar info @@ -103,7 +103,7 @@ If the file system supports sparse files smaller than the size specified as parameter. .It Fl F Ar FAT-type FAT type (one of 12, 16, or 32). -.It Fl I Ar volid +.It Fl I Ar VolumeID Volume ID, a 32 bit number in decimal or hexadecimal (0x...) format. .It Fl L Ar label Volume label (up to 11 characters). @@ -130,7 +130,7 @@ Acceptable values are powers of 2 in the If the block or cluster size are not specified, the code uses a cluster between 512 bytes and 32K depending on the filesystem size. -.It Fl e Ar dirents +.It Fl e Ar DirEnts Number of root directory entries (FAT12 and FAT16 only). .It Fl f Ar format Specify a standard (floppy disk) format. Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Sun Feb 14 12:25:03 2010 (r203868) +++ head/sbin/newfs_msdos/newfs_msdos.c Sun Feb 14 12:25:39 2010 (r203869) @@ -96,78 +96,78 @@ static const char rcsid[] = #define argtox(arg, lo, msg) argtou(arg, lo, UINT_MAX, msg) struct bs { - u_int8_t jmp[3]; /* bootstrap entry point */ - u_int8_t oem[8]; /* OEM name and version */ + u_int8_t bsJump[3]; /* bootstrap entry point */ + u_int8_t bsOemName[8]; /* OEM name and version */ }; struct bsbpb { - u_int8_t bps[2]; /* bytes per sector */ - u_int8_t spc; /* sectors per cluster */ - u_int8_t res[2]; /* reserved sectors */ - u_int8_t nft; /* number of FATs */ - u_int8_t rde[2]; /* root directory entries */ - u_int8_t sec[2]; /* total sectors */ - u_int8_t mid; /* media descriptor */ - u_int8_t spf[2]; /* sectors per FAT */ - u_int8_t spt[2]; /* sectors per track */ - u_int8_t hds[2]; /* drive heads */ - u_int8_t hid[4]; /* hidden sectors */ - u_int8_t bsec[4]; /* big total sectors */ + u_int8_t bpbBytesPerSec[2]; /* bytes per sector */ + u_int8_t bpbSecPerClust; /* sectors per cluster */ + u_int8_t bpbResSectors[2]; /* reserved sectors */ + u_int8_t bpbFATs; /* number of FATs */ + u_int8_t bpbRootDirEnts[2]; /* root directory entries */ + u_int8_t bpbSectors[2]; /* total sectors */ + u_int8_t bpbMedia; /* media descriptor */ + u_int8_t bpbFATsecs[2]; /* sectors per FAT */ + u_int8_t bpbSecPerTrack[2]; /* sectors per track */ + u_int8_t bpbHeads[2]; /* drive heads */ + u_int8_t bpbHiddenSecs[4]; /* hidden sectors */ + u_int8_t bpbHugeSectors[4]; /* big total sectors */ }; struct bsxbpb { - u_int8_t bspf[4]; /* big sectors per FAT */ - u_int8_t xflg[2]; /* FAT control flags */ - u_int8_t vers[2]; /* file system version */ - u_int8_t rdcl[4]; /* root directory start cluster */ - u_int8_t infs[2]; /* file system info sector */ - u_int8_t bkbs[2]; /* backup boot sector */ - u_int8_t rsvd[12]; /* reserved */ + u_int8_t bpbBigFATsecs[4]; /* big sectors per FAT */ + u_int8_t bpbExtFlags[2]; /* FAT control flags */ + u_int8_t bpbFSVers[2]; /* file system version */ + u_int8_t bpbRootClust[4]; /* root directory start cluster */ + u_int8_t bpbFSInfo[2]; /* file system info sector */ + u_int8_t bpbBackup[2]; /* backup boot sector */ + u_int8_t bpbReserved[12]; /* reserved */ }; struct bsx { - u_int8_t drv; /* drive number */ - u_int8_t rsvd; /* reserved */ - u_int8_t sig; /* extended boot signature */ - u_int8_t volid[4]; /* volume ID number */ - u_int8_t label[11]; /* volume label */ - u_int8_t type[8]; /* file system type */ + u_int8_t exDriveNumber; /* drive number */ + u_int8_t exReserved1; /* reserved */ + u_int8_t exBootSignature; /* extended boot signature */ + u_int8_t exVolumeID[4]; /* volume ID number */ + u_int8_t exVolumeLabel[11]; /* volume label */ + u_int8_t exFileSysType[8]; /* file system type */ }; struct de { - u_int8_t namext[11]; /* name and extension */ - u_int8_t attr; /* attributes */ + u_int8_t deName[11]; /* name and extension */ + u_int8_t deAttributes; /* attributes */ u_int8_t rsvd[10]; /* reserved */ - u_int8_t time[2]; /* creation time */ - u_int8_t date[2]; /* creation date */ - u_int8_t clus[2]; /* starting cluster */ - u_int8_t size[4]; /* size */ + u_int8_t deMTime[2]; /* creation time */ + u_int8_t deMDate[2]; /* creation date */ + u_int8_t deStartCluster[2]; /* starting cluster */ + u_int8_t deFileSize[4]; /* size */ }; struct bpb { - u_int bps; /* bytes per sector */ - u_int spc; /* sectors per cluster */ - u_int res; /* reserved sectors */ - u_int nft; /* number of FATs */ - u_int rde; /* root directory entries */ - u_int sec; /* total sectors */ - u_int mid; /* media descriptor */ - u_int spf; /* sectors per FAT */ - u_int spt; /* sectors per track */ - u_int hds; /* drive heads */ - u_int hid; /* hidden sectors */ - u_int bsec; /* big total sectors */ - u_int bspf; /* big sectors per FAT */ - u_int rdcl; /* root directory start cluster */ - u_int infs; /* file system info sector */ - u_int bkbs; /* backup boot sector */ + u_int bpbBytesPerSec; /* bytes per sector */ + u_int bpbSecPerClust; /* sectors per cluster */ + u_int bpbResSectors; /* reserved sectors */ + u_int bpbFATs; /* number of FATs */ + u_int bpbRootDirEnts; /* root directory entries */ + u_int bpbSectors; /* total sectors */ + u_int bpbMedia; /* media descriptor */ + u_int bpbFATsecs; /* sectors per FAT */ + u_int bpbSecPerTrack; /* sectors per track */ + u_int bpbHeads; /* drive heads */ + u_int bpbHiddenSecs; /* hidden sectors */ + u_int bpbHugeSectors; /* big total sectors */ + u_int bpbBigFATsecs; /* big sectors per FAT */ + u_int bpbRootClust; /* root directory start cluster */ + u_int bpbFSInfo; /* file system info sector */ + u_int bpbBackup; /* backup boot sector */ }; #define BPBGAP 0, 0, 0, 0, 0, 0 #define INIT(a, b, c, d, e, f, g, h, i, j) \ - { .bps = a, .spc = b, .res = c, .nft = d, .rde = e, \ - .sec = f, .mid = g, .spf = h, .spt = i, .hds = j, } + { .bpbBytesPerSec = a, .bpbSecPerClust = b, .bpbResSectors = c, .bpbFATs = d, .bpbRootDirEnts = e, \ + .bpbSectors = f, .bpbMedia = g, .bpbFATsecs = h, .bpbSecPerTrack = i, .bpbHeads = j, } static struct { const char *name; struct bpb bpb; @@ -384,49 +384,49 @@ main(int argc, char *argv[]) memset(&bpb, 0, sizeof(bpb)); if (opt_f) { getstdfmt(opt_f, &bpb); - bpb.bsec = bpb.sec; - bpb.sec = 0; - bpb.bspf = bpb.spf; - bpb.spf = 0; + bpb.bpbHugeSectors = bpb.bpbSectors; + bpb.bpbSectors = 0; + bpb.bpbBigFATsecs = bpb.bpbFATsecs; + bpb.bpbFATsecs = 0; } if (opt_h) - bpb.hds = opt_h; + bpb.bpbHeads = opt_h; if (opt_u) - bpb.spt = opt_u; + bpb.bpbSecPerTrack = opt_u; if (opt_S) - bpb.bps = opt_S; + bpb.bpbBytesPerSec = opt_S; if (opt_s) - bpb.bsec = opt_s; + bpb.bpbHugeSectors = opt_s; if (oflag) - bpb.hid = opt_o; + bpb.bpbHiddenSecs = opt_o; if (!(opt_f || (opt_h && opt_u && opt_S && opt_s && oflag))) { off_t delta; getdiskinfo(fd, fname, dtype, oflag, &bpb); - bpb.bsec -= (opt_ofs / bpb.bps); - delta = bpb.bsec % bpb.spt; + bpb.bpbHugeSectors -= (opt_ofs / bpb.bpbBytesPerSec); + delta = bpb.bpbHugeSectors % bpb.bpbSecPerTrack; if (delta != 0) { warnx("trim %d sectors to adjust to a multiple of %d", - (int)delta, bpb.spt); - bpb.bsec -= delta; + (int)delta, bpb.bpbSecPerTrack); + bpb.bpbHugeSectors -= delta; } - if (bpb.spc == 0) { /* set defaults */ - if (bpb.bsec <= 6000) /* about 3MB -> 512 bytes */ - bpb.spc = 1; - else if (bpb.bsec <= (1<<17)) /* 64M -> 4k */ - bpb.spc = 8; - else if (bpb.bsec <= (1<<19)) /* 256M -> 8k */ - bpb.spc = 16; - else if (bpb.bsec <= (1<<21)) /* 1G -> 16k */ - bpb.spc = 32; + if (bpb.bpbSecPerClust == 0) { /* set defaults */ + if (bpb.bpbHugeSectors <= 6000) /* about 3MB -> 512 bytes */ + bpb.bpbSecPerClust = 1; + else if (bpb.bpbHugeSectors <= (1<<17)) /* 64M -> 4k */ + bpb.bpbSecPerClust = 8; + else if (bpb.bpbHugeSectors <= (1<<19)) /* 256M -> 8k */ + bpb.bpbSecPerClust = 16; + else if (bpb.bpbHugeSectors <= (1<<21)) /* 1G -> 16k */ + bpb.bpbSecPerClust = 32; else - bpb.spc = 64; /* otherwise 32k */ + bpb.bpbSecPerClust = 64; /* otherwise 32k */ } } - if (!powerof2(bpb.bps)) - errx(1, "bytes/sector (%u) is not a power of 2", bpb.bps); - if (bpb.bps < MINBPS) + if (!powerof2(bpb.bpbBytesPerSec)) + errx(1, "bytes/sector (%u) is not a power of 2", bpb.bpbBytesPerSec); + if (bpb.bpbBytesPerSec < MINBPS) errx(1, "bytes/sector (%u) is too small; minimum is %u", - bpb.bps, MINBPS); + bpb.bpbBytesPerSec, MINBPS); if (!(fat = opt_F)) { if (opt_f) fat = 12; @@ -438,44 +438,44 @@ main(int argc, char *argv[]) fat == 32 ? 'e' : opt_i ? 'i' : 'k', fat == 32 ? "32" : "12/16"); if (opt_f && fat == 32) - bpb.rde = 0; + bpb.bpbRootDirEnts = 0; if (opt_b) { if (!powerof2(opt_b)) errx(1, "block size (%u) is not a power of 2", opt_b); - if (opt_b < bpb.bps) + if (opt_b < bpb.bpbBytesPerSec) errx(1, "block size (%u) is too small; minimum is %u", - opt_b, bpb.bps); - if (opt_b > bpb.bps * MAXSPC) + opt_b, bpb.bpbBytesPerSec); + if (opt_b > bpb.bpbBytesPerSec * MAXSPC) errx(1, "block size (%u) is too large; maximum is %u", - opt_b, bpb.bps * MAXSPC); - bpb.spc = opt_b / bpb.bps; + opt_b, bpb.bpbBytesPerSec * MAXSPC); + bpb.bpbSecPerClust = opt_b / bpb.bpbBytesPerSec; } if (opt_c) { if (!powerof2(opt_c)) errx(1, "sectors/cluster (%u) is not a power of 2", opt_c); - bpb.spc = opt_c; + bpb.bpbSecPerClust = opt_c; } if (opt_r) - bpb.res = opt_r; + bpb.bpbResSectors = opt_r; if (opt_n) { if (opt_n > MAXNFT) errx(1, "number of FATs (%u) is too large; maximum is %u", opt_n, MAXNFT); - bpb.nft = opt_n; + bpb.bpbFATs = opt_n; } if (opt_e) - bpb.rde = opt_e; + bpb.bpbRootDirEnts = opt_e; if (mflag) { if (opt_m < 0xf0) errx(1, "illegal media descriptor (%#x)", opt_m); - bpb.mid = opt_m; + bpb.bpbMedia = opt_m; } if (opt_a) - bpb.bspf = opt_a; + bpb.bpbBigFATsecs = opt_a; if (opt_i) - bpb.infs = opt_i; + bpb.bpbFSInfo = opt_i; if (opt_k) - bpb.bkbs = opt_k; + bpb.bpbBackup = opt_k; bss = 1; bname = NULL; fd1 = -1; @@ -488,87 +488,87 @@ main(int argc, char *argv[]) } if ((fd1 = open(bname, O_RDONLY)) == -1 || fstat(fd1, &sb)) err(1, "%s", bname); - if (!S_ISREG(sb.st_mode) || sb.st_size % bpb.bps || - sb.st_size < bpb.bps || sb.st_size > bpb.bps * MAXU16) + if (!S_ISREG(sb.st_mode) || sb.st_size % bpb.bpbBytesPerSec || + sb.st_size < bpb.bpbBytesPerSec || sb.st_size > bpb.bpbBytesPerSec * MAXU16) errx(1, "%s: inappropriate file type or format", bname); - bss = sb.st_size / bpb.bps; + bss = sb.st_size / bpb.bpbBytesPerSec; } - if (!bpb.nft) - bpb.nft = 2; + if (!bpb.bpbFATs) + bpb.bpbFATs = 2; if (!fat) { - if (bpb.bsec < (bpb.res ? bpb.res : bss) + - howmany((RESFTE + (bpb.spc ? MINCLS16 : MAXCLS12 + 1)) * - ((bpb.spc ? 16 : 12) / BPN), bpb.bps * NPB) * - bpb.nft + - howmany(bpb.rde ? bpb.rde : DEFRDE, - bpb.bps / sizeof(struct de)) + - (bpb.spc ? MINCLS16 : MAXCLS12 + 1) * - (bpb.spc ? bpb.spc : howmany(DEFBLK, bpb.bps))) + if (bpb.bpbHugeSectors < (bpb.bpbResSectors ? bpb.bpbResSectors : bss) + + howmany((RESFTE + (bpb.bpbSecPerClust ? MINCLS16 : MAXCLS12 + 1)) * + ((bpb.bpbSecPerClust ? 16 : 12) / BPN), bpb.bpbBytesPerSec * NPB) * + bpb.bpbFATs + + howmany(bpb.bpbRootDirEnts ? bpb.bpbRootDirEnts : DEFRDE, + bpb.bpbBytesPerSec / sizeof(struct de)) + + (bpb.bpbSecPerClust ? MINCLS16 : MAXCLS12 + 1) * + (bpb.bpbSecPerClust ? bpb.bpbSecPerClust : howmany(DEFBLK, bpb.bpbBytesPerSec))) fat = 12; - else if (bpb.rde || bpb.bsec < - (bpb.res ? bpb.res : bss) + - howmany((RESFTE + MAXCLS16) * 2, bpb.bps) * bpb.nft + - howmany(DEFRDE, bpb.bps / sizeof(struct de)) + + else if (bpb.bpbRootDirEnts || bpb.bpbHugeSectors < + (bpb.bpbResSectors ? bpb.bpbResSectors : bss) + + howmany((RESFTE + MAXCLS16) * 2, bpb.bpbBytesPerSec) * bpb.bpbFATs + + howmany(DEFRDE, bpb.bpbBytesPerSec / sizeof(struct de)) + (MAXCLS16 + 1) * - (bpb.spc ? bpb.spc : howmany(8192, bpb.bps))) + (bpb.bpbSecPerClust ? bpb.bpbSecPerClust : howmany(8192, bpb.bpbBytesPerSec))) fat = 16; else fat = 32; } x = bss; if (fat == 32) { - if (!bpb.infs) { - if (x == MAXU16 || x == bpb.bkbs) + if (!bpb.bpbFSInfo) { + if (x == MAXU16 || x == bpb.bpbBackup) errx(1, "no room for info sector"); - bpb.infs = x; + bpb.bpbFSInfo = x; } - if (bpb.infs != MAXU16 && x <= bpb.infs) - x = bpb.infs + 1; - if (!bpb.bkbs) { + if (bpb.bpbFSInfo != MAXU16 && x <= bpb.bpbFSInfo) + x = bpb.bpbFSInfo + 1; + if (!bpb.bpbBackup) { if (x == MAXU16) errx(1, "no room for backup sector"); - bpb.bkbs = x; - } else if (bpb.bkbs != MAXU16 && bpb.bkbs == bpb.infs) + bpb.bpbBackup = x; + } else if (bpb.bpbBackup != MAXU16 && bpb.bpbBackup == bpb.bpbFSInfo) errx(1, "backup sector would overwrite info sector"); - if (bpb.bkbs != MAXU16 && x <= bpb.bkbs) - x = bpb.bkbs + 1; + if (bpb.bpbBackup != MAXU16 && x <= bpb.bpbBackup) + x = bpb.bpbBackup + 1; } - if (!bpb.res) - bpb.res = fat == 32 ? MAX(x, MAX(16384 / bpb.bps, 4)) : x; - else if (bpb.res < x) - errx(1, "too few reserved sectors (need %d have %d)", x, bpb.res); - if (fat != 32 && !bpb.rde) - bpb.rde = DEFRDE; - rds = howmany(bpb.rde, bpb.bps / sizeof(struct de)); - if (!bpb.spc) - for (bpb.spc = howmany(fat == 16 ? DEFBLK16 : DEFBLK, bpb.bps); - bpb.spc < MAXSPC && - bpb.res + + if (!bpb.bpbResSectors) + bpb.bpbResSectors = fat == 32 ? MAX(x, MAX(16384 / bpb.bpbBytesPerSec, 4)) : x; + else if (bpb.bpbResSectors < x) + errx(1, "too few reserved sectors (need %d have %d)", x, bpb.bpbResSectors); + if (fat != 32 && !bpb.bpbRootDirEnts) + bpb.bpbRootDirEnts = DEFRDE; + rds = howmany(bpb.bpbRootDirEnts, bpb.bpbBytesPerSec / sizeof(struct de)); + if (!bpb.bpbSecPerClust) + for (bpb.bpbSecPerClust = howmany(fat == 16 ? DEFBLK16 : DEFBLK, bpb.bpbBytesPerSec); + bpb.bpbSecPerClust < MAXSPC && + bpb.bpbResSectors + howmany((RESFTE + maxcls(fat)) * (fat / BPN), - bpb.bps * NPB) * bpb.nft + + bpb.bpbBytesPerSec * NPB) * bpb.bpbFATs + rds + - (u_int64_t)(maxcls(fat) + 1) * bpb.spc <= bpb.bsec; - bpb.spc <<= 1); - if (fat != 32 && bpb.bspf > MAXU16) + (u_int64_t)(maxcls(fat) + 1) * bpb.bpbSecPerClust <= bpb.bpbHugeSectors; + bpb.bpbSecPerClust <<= 1); + if (fat != 32 && bpb.bpbBigFATsecs > MAXU16) errx(1, "too many sectors/FAT for FAT12/16"); - x1 = bpb.res + rds; - x = bpb.bspf ? bpb.bspf : 1; - if (x1 + (u_int64_t)x * bpb.nft > bpb.bsec) + x1 = bpb.bpbResSectors + rds; + x = bpb.bpbBigFATsecs ? bpb.bpbBigFATsecs : 1; + if (x1 + (u_int64_t)x * bpb.bpbFATs > bpb.bpbHugeSectors) errx(1, "meta data exceeds file system size"); - x1 += x * bpb.nft; - x = (u_int64_t)(bpb.bsec - x1) * bpb.bps * NPB / - (bpb.spc * bpb.bps * NPB + fat / BPN * bpb.nft); + x1 += x * bpb.bpbFATs; + x = (u_int64_t)(bpb.bpbHugeSectors - x1) * bpb.bpbBytesPerSec * NPB / + (bpb.bpbSecPerClust * bpb.bpbBytesPerSec * NPB + fat / BPN * bpb.bpbFATs); x2 = howmany((RESFTE + MIN(x, maxcls(fat))) * (fat / BPN), - bpb.bps * NPB); - if (!bpb.bspf) { - bpb.bspf = x2; - x1 += (bpb.bspf - 1) * bpb.nft; + bpb.bpbBytesPerSec * NPB); + if (!bpb.bpbBigFATsecs) { + bpb.bpbBigFATsecs = x2; + x1 += (bpb.bpbBigFATsecs - 1) * bpb.bpbFATs; } - cls = (bpb.bsec - x1) / bpb.spc; - x = (u_int64_t)bpb.bspf * bpb.bps * NPB / (fat / BPN) - RESFTE; + cls = (bpb.bpbHugeSectors - x1) / bpb.bpbSecPerClust; + x = (u_int64_t)bpb.bpbBigFATsecs * bpb.bpbBytesPerSec * NPB / (fat / BPN) - RESFTE; if (cls > x) cls = x; - if (bpb.bspf < x2) + if (bpb.bpbBigFATsecs < x2) warnx("warning: sectors/FAT limits file system to %u clusters", cls); if (cls < mincls(fat)) @@ -576,79 +576,79 @@ main(int argc, char *argv[]) mincls(fat)); if (cls > maxcls(fat)) { cls = maxcls(fat); - bpb.bsec = x1 + (cls + 1) * bpb.spc - 1; + bpb.bpbHugeSectors = x1 + (cls + 1) * bpb.bpbSecPerClust - 1; warnx("warning: FAT type limits file system to %u sectors", - bpb.bsec); + bpb.bpbHugeSectors); } printf("%s: %u sector%s in %u FAT%u cluster%s " - "(%u bytes/cluster)\n", fname, cls * bpb.spc, - cls * bpb.spc == 1 ? "" : "s", cls, fat, - cls == 1 ? "" : "s", bpb.bps * bpb.spc); - if (!bpb.mid) - bpb.mid = !bpb.hid ? 0xf0 : 0xf8; + "(%u bytes/cluster)\n", fname, cls * bpb.bpbSecPerClust, + cls * bpb.bpbSecPerClust == 1 ? "" : "s", cls, fat, + cls == 1 ? "" : "s", bpb.bpbBytesPerSec * bpb.bpbSecPerClust); + if (!bpb.bpbMedia) + bpb.bpbMedia = !bpb.bpbHiddenSecs ? 0xf0 : 0xf8; if (fat == 32) - bpb.rdcl = RESFTE; - if (bpb.hid + bpb.bsec <= MAXU16) { - bpb.sec = bpb.bsec; - bpb.bsec = 0; + bpb.bpbRootClust = RESFTE; + if (bpb.bpbHiddenSecs + bpb.bpbHugeSectors <= MAXU16) { + bpb.bpbSectors = bpb.bpbHugeSectors; + bpb.bpbHugeSectors = 0; } if (fat != 32) { - bpb.spf = bpb.bspf; - bpb.bspf = 0; + bpb.bpbFATsecs = bpb.bpbBigFATsecs; + bpb.bpbBigFATsecs = 0; } print_bpb(&bpb); if (!opt_N) { gettimeofday(&tv, NULL); now = tv.tv_sec; tm = localtime(&now); - if (!(img = malloc(bpb.bps))) + if (!(img = malloc(bpb.bpbBytesPerSec))) err(1, NULL); - dir = bpb.res + (bpb.spf ? bpb.spf : bpb.bspf) * bpb.nft; - for (lsn = 0; lsn < dir + (fat == 32 ? bpb.spc : rds); lsn++) { + dir = bpb.bpbResSectors + (bpb.bpbFATsecs ? bpb.bpbFATsecs : bpb.bpbBigFATsecs) * bpb.bpbFATs; + for (lsn = 0; lsn < dir + (fat == 32 ? bpb.bpbSecPerClust : rds); lsn++) { x = lsn; if (opt_B && - fat == 32 && bpb.bkbs != MAXU16 && - bss <= bpb.bkbs && x >= bpb.bkbs) { - x -= bpb.bkbs; + fat == 32 && bpb.bpbBackup != MAXU16 && + bss <= bpb.bpbBackup && x >= bpb.bpbBackup) { + x -= bpb.bpbBackup; if (!x && lseek(fd1, opt_ofs, SEEK_SET)) err(1, "%s", bname); } if (opt_B && x < bss) { - if ((n = read(fd1, img, bpb.bps)) == -1) + if ((n = read(fd1, img, bpb.bpbBytesPerSec)) == -1) err(1, "%s", bname); - if ((unsigned)n != bpb.bps) + if ((unsigned)n != bpb.bpbBytesPerSec) errx(1, "%s: can't read sector %u", bname, x); } else - memset(img, 0, bpb.bps); + memset(img, 0, bpb.bpbBytesPerSec); if (!lsn || - (fat == 32 && bpb.bkbs != MAXU16 && lsn == bpb.bkbs)) { + (fat == 32 && bpb.bpbBackup != MAXU16 && lsn == bpb.bpbBackup)) { x1 = sizeof(struct bs); bsbpb = (struct bsbpb *)(img + x1); - mk2(bsbpb->bps, bpb.bps); - mk1(bsbpb->spc, bpb.spc); - mk2(bsbpb->res, bpb.res); - mk1(bsbpb->nft, bpb.nft); - mk2(bsbpb->rde, bpb.rde); - mk2(bsbpb->sec, bpb.sec); - mk1(bsbpb->mid, bpb.mid); - mk2(bsbpb->spf, bpb.spf); - mk2(bsbpb->spt, bpb.spt); - mk2(bsbpb->hds, bpb.hds); - mk4(bsbpb->hid, bpb.hid); - mk4(bsbpb->bsec, bpb.bsec); + mk2(bsbpb->bpbBytesPerSec, bpb.bpbBytesPerSec); + mk1(bsbpb->bpbSecPerClust, bpb.bpbSecPerClust); + mk2(bsbpb->bpbResSectors, bpb.bpbResSectors); + mk1(bsbpb->bpbFATs, bpb.bpbFATs); + mk2(bsbpb->bpbRootDirEnts, bpb.bpbRootDirEnts); + mk2(bsbpb->bpbSectors, bpb.bpbSectors); + mk1(bsbpb->bpbMedia, bpb.bpbMedia); + mk2(bsbpb->bpbFATsecs, bpb.bpbFATsecs); + mk2(bsbpb->bpbSecPerTrack, bpb.bpbSecPerTrack); + mk2(bsbpb->bpbHeads, bpb.bpbHeads); + mk4(bsbpb->bpbHiddenSecs, bpb.bpbHiddenSecs); + mk4(bsbpb->bpbHugeSectors, bpb.bpbHugeSectors); x1 += sizeof(struct bsbpb); if (fat == 32) { bsxbpb = (struct bsxbpb *)(img + x1); - mk4(bsxbpb->bspf, bpb.bspf); - mk2(bsxbpb->xflg, 0); - mk2(bsxbpb->vers, 0); - mk4(bsxbpb->rdcl, bpb.rdcl); - mk2(bsxbpb->infs, bpb.infs); - mk2(bsxbpb->bkbs, bpb.bkbs); + mk4(bsxbpb->bpbBigFATsecs, bpb.bpbBigFATsecs); + mk2(bsxbpb->bpbExtFlags, 0); + mk2(bsxbpb->bpbFSVers, 0); + mk4(bsxbpb->bpbRootClust, bpb.bpbRootClust); + mk2(bsxbpb->bpbFSInfo, bpb.bpbFSInfo); + mk2(bsxbpb->bpbBackup, bpb.bpbBackup); x1 += sizeof(struct bsxbpb); } bsx = (struct bsx *)(img + x1); - mk1(bsx->sig, 0x29); + mk1(bsx->exBootSignature, 0x29); if (Iflag) x = opt_I; else @@ -659,52 +659,52 @@ main(int argc, char *argv[]) ((u_int)(1900 + tm->tm_year) + ((u_int)tm->tm_hour << 8 | (u_int)tm->tm_min)); - mk4(bsx->volid, x); - mklabel(bsx->label, opt_L ? opt_L : "NO_NAME"); + mk4(bsx->exVolumeID, x); + mklabel(bsx->exVolumeLabel, opt_L ? opt_L : "NO_NAME"); sprintf(buf, "FAT%u", fat); - setstr(bsx->type, buf, sizeof(bsx->type)); + setstr(bsx->exFileSysType, buf, sizeof(bsx->exFileSysType)); if (!opt_B) { x1 += sizeof(struct bsx); bs = (struct bs *)img; - mk1(bs->jmp[0], 0xeb); - mk1(bs->jmp[1], x1 - 2); - mk1(bs->jmp[2], 0x90); - setstr(bs->oem, opt_O ? opt_O : "BSD4.4 ", - sizeof(bs->oem)); + mk1(bs->bsJump[0], 0xeb); + mk1(bs->bsJump[1], x1 - 2); + mk1(bs->bsJump[2], 0x90); + setstr(bs->bsOemName, opt_O ? opt_O : "BSD4.4 ", + sizeof(bs->bsOemName)); memcpy(img + x1, bootcode, sizeof(bootcode)); mk2(img + MINBPS - 2, DOSMAGIC); } - } else if (fat == 32 && bpb.infs != MAXU16 && - (lsn == bpb.infs || - (bpb.bkbs != MAXU16 && - lsn == bpb.bkbs + bpb.infs))) { + } else if (fat == 32 && bpb.bpbFSInfo != MAXU16 && + (lsn == bpb.bpbFSInfo || + (bpb.bpbBackup != MAXU16 && + lsn == bpb.bpbBackup + bpb.bpbFSInfo))) { mk4(img, 0x41615252); mk4(img + MINBPS - 28, 0x61417272); mk4(img + MINBPS - 24, 0xffffffff); - mk4(img + MINBPS - 20, bpb.rdcl); + mk4(img + MINBPS - 20, bpb.bpbRootClust); mk2(img + MINBPS - 2, DOSMAGIC); - } else if (lsn >= bpb.res && lsn < dir && - !((lsn - bpb.res) % - (bpb.spf ? bpb.spf : bpb.bspf))) { - mk1(img[0], bpb.mid); + } else if (lsn >= bpb.bpbResSectors && lsn < dir && + !((lsn - bpb.bpbResSectors) % + (bpb.bpbFATsecs ? bpb.bpbFATsecs : bpb.bpbBigFATsecs))) { + mk1(img[0], bpb.bpbMedia); for (x = 1; x < fat * (fat == 32 ? 3 : 2) / 8; x++) mk1(img[x], fat == 32 && x % 4 == 3 ? 0x0f : 0xff); } else if (lsn == dir && opt_L) { de = (struct de *)img; - mklabel(de->namext, opt_L); - mk1(de->attr, 050); + mklabel(de->deName, opt_L); + mk1(de->deAttributes, 050); x = (u_int)tm->tm_hour << 11 | (u_int)tm->tm_min << 5 | (u_int)tm->tm_sec >> 1; - mk2(de->time, x); + mk2(de->deMTime, x); x = (u_int)(tm->tm_year - 80) << 9 | (u_int)(tm->tm_mon + 1) << 5 | (u_int)tm->tm_mday; - mk2(de->date, x); + mk2(de->deMDate, x); } - if ((n = write(fd, img, bpb.bps)) == -1) + if ((n = write(fd, img, bpb.bpbBytesPerSec)) == -1) err(1, "%s", fname); - if ((unsigned)n != bpb.bps) + if ((unsigned)n != bpb.bpbBytesPerSec) errx(1, "%s: can't write sector %u", fname, lsn); } } @@ -797,18 +797,19 @@ getdiskinfo(int fd, const char *fname, c /* Maybe it's a fixed drive */ if (lp == NULL) { + if (bpb->bpbBytesPerSec) + dlp.d_secsize = bpb->bpbBytesPerSec; if (ioctl(fd, DIOCGDINFO, &dlp) == -1) { - if (bpb->bps == 0 && ioctl(fd, DIOCGSECTORSIZE, &dlp.d_secsize) == -1) + if (bpb->bpbBytesPerSec == 0 && ioctl(fd, DIOCGSECTORSIZE, &dlp.d_secsize) == -1) errx(1, "Cannot get sector size, %s", strerror(errno)); - /* XXX Should we use bpb->bps if it's set? */ dlp.d_secperunit = ms / dlp.d_secsize; - if (bpb->spt == 0 && ioctl(fd, DIOCGFWSECTORS, &dlp.d_nsectors) == -1) { + if (bpb->bpbSecPerTrack == 0 && ioctl(fd, DIOCGFWSECTORS, &dlp.d_nsectors) == -1) { warnx("Cannot get number of sectors per track, %s", strerror(errno)); dlp.d_nsectors = 63; } - if (bpb->hds == 0 && ioctl(fd, DIOCGFWHEADS, &dlp.d_ntracks) == -1) { + if (bpb->bpbHeads == 0 && ioctl(fd, DIOCGFWHEADS, &dlp.d_ntracks) == -1) { warnx("Cannot get number of heads, %s", strerror(errno)); if (dlp.d_secperunit <= 63*1*1024) dlp.d_ntracks = 1; @@ -823,16 +824,16 @@ getdiskinfo(int fd, const char *fname, c lp = &dlp; } - if (bpb->bps == 0) - bpb->bps = ckgeom(fname, lp->d_secsize, "bytes/sector"); - if (bpb->spt == 0) - bpb->spt = ckgeom(fname, lp->d_nsectors, "sectors/track"); - if (bpb->hds == 0) - bpb->hds = ckgeom(fname, lp->d_ntracks, "drive heads"); - if (bpb->bsec == 0) - bpb->bsec = lp->d_secperunit; - if (bpb->hid == 0) - bpb->hid = hs; + if (bpb->bpbBytesPerSec == 0) + bpb->bpbBytesPerSec = ckgeom(fname, lp->d_secsize, "bytes/sector"); + if (bpb->bpbSecPerTrack == 0) + bpb->bpbSecPerTrack = ckgeom(fname, lp->d_nsectors, "sectors/track"); + if (bpb->bpbHeads == 0) + bpb->bpbHeads = ckgeom(fname, lp->d_ntracks, "drive heads"); + if (bpb->bpbHugeSectors == 0) + bpb->bpbHugeSectors = lp->d_secperunit; + if (bpb->bpbHiddenSecs == 0) + bpb->bpbHiddenSecs = hs; } /* @@ -841,24 +842,24 @@ getdiskinfo(int fd, const char *fname, c static void print_bpb(struct bpb *bpb) { - printf("bps=%u spc=%u res=%u nft=%u", bpb->bps, bpb->spc, bpb->res, - bpb->nft); - if (bpb->rde) - printf(" rde=%u", bpb->rde); - if (bpb->sec) - printf(" sec=%u", bpb->sec); - printf(" mid=%#x", bpb->mid); - if (bpb->spf) - printf(" spf=%u", bpb->spf); - printf(" spt=%u hds=%u hid=%u", bpb->spt, bpb->hds, bpb->hid); - if (bpb->bsec) - printf(" bsec=%u", bpb->bsec); - if (!bpb->spf) { - printf(" bspf=%u rdcl=%u", bpb->bspf, bpb->rdcl); - printf(" infs="); - printf(bpb->infs == MAXU16 ? "%#x" : "%u", bpb->infs); - printf(" bkbs="); - printf(bpb->bkbs == MAXU16 ? "%#x" : "%u", bpb->bkbs); + printf("BytesPerSec=%u SecPerClust=%u ResSectors=%u FATs=%u", bpb->bpbBytesPerSec, bpb->bpbSecPerClust, bpb->bpbResSectors, + bpb->bpbFATs); + if (bpb->bpbRootDirEnts) + printf(" RootDirEnts=%u", bpb->bpbRootDirEnts); + if (bpb->bpbSectors) + printf(" Sectors=%u", bpb->bpbSectors); + printf(" Media=%#x", bpb->bpbMedia); + if (bpb->bpbFATsecs) + printf(" FATsecs=%u", bpb->bpbFATsecs); + printf(" SecPerTrack=%u Heads=%u HiddenSecs=%u", bpb->bpbSecPerTrack, bpb->bpbHeads, bpb->bpbHiddenSecs); + if (bpb->bpbHugeSectors) + printf(" HugeSectors=%u", bpb->bpbHugeSectors); + if (!bpb->bpbFATsecs) { + printf(" FATsecs=%u RootCluster=%u", bpb->bpbBigFATsecs, bpb->bpbRootClust); + printf(" FSInfo="); + printf(bpb->bpbFSInfo == MAXU16 ? "%#x" : "%u", bpb->bpbFSInfo); + printf(" Backup="); + printf(bpb->bpbBackup == MAXU16 ? "%#x" : "%u", bpb->bpbBackup); } printf("\n"); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 12:27:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD653106566C; Sun, 14 Feb 2010 12:27:51 +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 AD60C8FC12; Sun, 14 Feb 2010 12:27: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 o1ECRptW069957; Sun, 14 Feb 2010 12:27:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ECRo06069955; Sun, 14 Feb 2010 12:27:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141227.o1ECRo06069955@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 12:27: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: r203870 - head/sys/dev/siis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 12:27:51 -0000 Author: mav Date: Sun Feb 14 12:27:49 2010 New Revision: 203870 URL: http://svn.freebsd.org/changeset/base/203870 Log: MFp4: After last running command completed, give commands in timeout state second time. Modified: head/sys/dev/siis/siis.c Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Sun Feb 14 12:25:39 2010 (r203869) +++ head/sys/dev/siis/siis.c Sun Feb 14 12:27:49 2010 (r203870) @@ -1074,6 +1074,28 @@ siis_process_timeout(device_t dev) } } +/* Must be called with channel locked. */ +static void +siis_rearm_timeout(device_t dev) +{ + struct siis_channel *ch = device_get_softc(dev); + int i; + + mtx_assert(&ch->mtx, MA_OWNED); + for (i = 0; i < SIIS_MAX_SLOTS; i++) { + struct siis_slot *slot = &ch->slot[i]; + + /* Do we have a running request on slot? */ + if (slot->state < SIIS_SLOT_RUNNING) + continue; + if ((ch->toslots & (1 << i)) == 0) + continue; + callout_reset(&slot->timeout, + (int)slot->ccb->ccb_h.timeout * hz / 1000, + (timeout_t*)siis_timeout, slot); + } +} + /* Locked by callout mechanism. */ static void siis_timeout(struct siis_slot *slot) @@ -1235,8 +1257,9 @@ siis_end_transaction(struct siis_slot *s siis_issue_read_log(dev); } /* If all the reset of commands are in timeout - abort them. */ - } else if ((ch->rslots & ~ch->toslots) == 0) - siis_process_timeout(dev); + } else if ((ch->rslots & ~ch->toslots) == 0 && + et != SIIS_ERR_TIMEOUT) + siis_rearm_timeout(dev); } static void From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 12:28:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC069106566B; Sun, 14 Feb 2010 12:28:43 +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 CACEC8FC12; Sun, 14 Feb 2010 12:28: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 o1ECShV7070195; Sun, 14 Feb 2010 12:28:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ECShML070187; Sun, 14 Feb 2010 12:28:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002141228.o1ECShML070187@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 14 Feb 2010 12:28: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: r203871 - head/sbin/fsck_msdosfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 12:28:44 -0000 Author: kib Date: Sun Feb 14 12:28:43 2010 New Revision: 203871 URL: http://svn.freebsd.org/changeset/base/203871 Log: License changes from NetBSD. Move to 2 clause license, approved by Wolfgang Solfrank. Submitted by: Pedro F. Giffuni MFC after: 2 weeks Modified: head/sbin/fsck_msdosfs/boot.c head/sbin/fsck_msdosfs/check.c head/sbin/fsck_msdosfs/dir.c head/sbin/fsck_msdosfs/dosfs.h head/sbin/fsck_msdosfs/ext.h head/sbin/fsck_msdosfs/fat.c head/sbin/fsck_msdosfs/fsck_msdosfs.8 head/sbin/fsck_msdosfs/main.c Modified: head/sbin/fsck_msdosfs/boot.c ============================================================================== --- head/sbin/fsck_msdosfs/boot.c Sun Feb 14 12:27:49 2010 (r203870) +++ head/sbin/fsck_msdosfs/boot.c Sun Feb 14 12:28:43 2010 (r203871) @@ -10,13 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Martin Husemann - * and Wolfgang Solfrank. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/sbin/fsck_msdosfs/check.c ============================================================================== --- head/sbin/fsck_msdosfs/check.c Sun Feb 14 12:27:49 2010 (r203870) +++ head/sbin/fsck_msdosfs/check.c Sun Feb 14 12:28:43 2010 (r203871) @@ -10,13 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Martin Husemann - * and Wolfgang Solfrank. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/sbin/fsck_msdosfs/dir.c ============================================================================== --- head/sbin/fsck_msdosfs/dir.c Sun Feb 14 12:27:49 2010 (r203870) +++ head/sbin/fsck_msdosfs/dir.c Sun Feb 14 12:28:43 2010 (r203871) @@ -12,13 +12,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Martin Husemann - * and Wolfgang Solfrank. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/sbin/fsck_msdosfs/dosfs.h ============================================================================== --- head/sbin/fsck_msdosfs/dosfs.h Sun Feb 14 12:27:49 2010 (r203870) +++ head/sbin/fsck_msdosfs/dosfs.h Sun Feb 14 12:28:43 2010 (r203871) @@ -12,13 +12,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Martin Husemann - * and Wolfgang Solfrank. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/sbin/fsck_msdosfs/ext.h ============================================================================== --- head/sbin/fsck_msdosfs/ext.h Sun Feb 14 12:27:49 2010 (r203870) +++ head/sbin/fsck_msdosfs/ext.h Sun Feb 14 12:28:43 2010 (r203871) @@ -10,13 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Martin Husemann - * and Wolfgang Solfrank. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/sbin/fsck_msdosfs/fat.c ============================================================================== --- head/sbin/fsck_msdosfs/fat.c Sun Feb 14 12:27:49 2010 (r203870) +++ head/sbin/fsck_msdosfs/fat.c Sun Feb 14 12:28:43 2010 (r203871) @@ -10,13 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Martin Husemann - * and Wolfgang Solfrank. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/sbin/fsck_msdosfs/fsck_msdosfs.8 ============================================================================== --- head/sbin/fsck_msdosfs/fsck_msdosfs.8 Sun Feb 14 12:27:49 2010 (r203870) +++ head/sbin/fsck_msdosfs/fsck_msdosfs.8 Sun Feb 14 12:28:43 2010 (r203871) @@ -11,13 +11,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by Martin Husemann -.\" and Wolfgang Solfrank. -.\" 4. Neither the name of the University nor the names of its contributors -.\" may be used to endorse or promote products derived from this software -.\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES Modified: head/sbin/fsck_msdosfs/main.c ============================================================================== --- head/sbin/fsck_msdosfs/main.c Sun Feb 14 12:27:49 2010 (r203870) +++ head/sbin/fsck_msdosfs/main.c Sun Feb 14 12:28:43 2010 (r203871) @@ -10,13 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Martin Husemann - * and Wolfgang Solfrank. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 12:30:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DA37106566B; Sun, 14 Feb 2010 12:30: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 4C5758FC0C; Sun, 14 Feb 2010 12:30: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 o1ECUVKN070634; Sun, 14 Feb 2010 12:30:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ECUVPt070627; Sun, 14 Feb 2010 12:30:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002141230.o1ECUVPt070627@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 14 Feb 2010 12:30: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: r203872 - head/sbin/fsck_msdosfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 12:30:31 -0000 Author: kib Date: Sun Feb 14 12:30:30 2010 New Revision: 203872 URL: http://svn.freebsd.org/changeset/base/203872 Log: Bug fixes from NetBSD - fix sign-compare issues. - ANSIfy a couple of functions. - Remove more duplicate #includes. - Memory leak found by Coverity on NetBSD. Submitted by: Pedro F. Giffuni Reviewed by: bde MFC after: 2 weeks Modified: head/sbin/fsck_msdosfs/boot.c head/sbin/fsck_msdosfs/check.c head/sbin/fsck_msdosfs/dir.c head/sbin/fsck_msdosfs/dosfs.h head/sbin/fsck_msdosfs/ext.h head/sbin/fsck_msdosfs/fat.c head/sbin/fsck_msdosfs/main.c Modified: head/sbin/fsck_msdosfs/boot.c ============================================================================== --- head/sbin/fsck_msdosfs/boot.c Sun Feb 14 12:28:43 2010 (r203871) +++ head/sbin/fsck_msdosfs/boot.c Sun Feb 14 12:30:30 2010 (r203872) @@ -33,7 +33,6 @@ static const char rcsid[] = #include #include -#include #include #include @@ -41,16 +40,15 @@ static const char rcsid[] = #include "fsutil.h" int -readboot(dosfs, boot) - int dosfs; - struct bootblock *boot; +readboot(int dosfs, struct bootblock *boot) { u_char block[DOSBOOTBLOCKSIZE]; u_char fsinfo[2 * DOSBOOTBLOCKSIZE]; u_char backup[DOSBOOTBLOCKSIZE]; int ret = FSOK; + int i; - if (read(dosfs, block, sizeof block) < sizeof block) { + if ((size_t)read(dosfs, block, sizeof block) != sizeof block) { perror("could not read boot block"); return FSFATAL; } @@ -154,12 +152,22 @@ readboot(dosfs, boot) } backup[65] = block[65]; /* XXX */ if (memcmp(block + 11, backup + 11, 79)) { - /* Correct? XXX */ - pfatal("backup doesn't compare to primary bootblock"); - if (alwaysno) - pfatal("\n"); - else - return FSFATAL; + /* + * XXX We require a reference that explains + * that these bytes need to match, or should + * drop the check. gdt@NetBSD has observed + * filesystems that work fine under Windows XP + * and NetBSD that do not match, so the + * requirement is suspect. For now, just + * print out useful information and continue. + */ + pfatal("backup (block %d) mismatch with primary bootblock:\n", + boot->Backup); + for (i = 11; i < 11 + 90; i++) { + if (block[i] != backup[i]) + pfatal("\ti=%d\tprimary 0x%02x\tbackup 0x%02x\n", + i, block[i], backup[i]); + } } /* Check backup FSInfo? XXX */ } @@ -223,9 +231,7 @@ readboot(dosfs, boot) } int -writefsinfo(dosfs, boot) - int dosfs; - struct bootblock *boot; +writefsinfo(int dosfs, struct bootblock *boot) { u_char fsinfo[2 * DOSBOOTBLOCKSIZE]; Modified: head/sbin/fsck_msdosfs/check.c ============================================================================== --- head/sbin/fsck_msdosfs/check.c Sun Feb 14 12:28:43 2010 (r203871) +++ head/sbin/fsck_msdosfs/check.c Sun Feb 14 12:30:30 2010 (r203872) @@ -33,7 +33,6 @@ static const char rcsid[] = #include #include -#include #include #include #include @@ -47,7 +46,8 @@ checkfilesys(const char *fname) int dosfs; struct bootblock boot; struct fatEntry *fat = NULL; - int i, finish_dosdirsection=0; + int finish_dosdirsection=0; + u_int i; int mod = 0; int ret = 8; Modified: head/sbin/fsck_msdosfs/dir.c ============================================================================== --- head/sbin/fsck_msdosfs/dir.c Sun Feb 14 12:28:43 2010 (r203871) +++ head/sbin/fsck_msdosfs/dir.c Sun Feb 14 12:30:30 2010 (r203872) @@ -37,7 +37,6 @@ static const char rcsid[] = #include #include #include -#include #include #include @@ -223,12 +222,24 @@ resetDosDirSection(struct bootblock *boo b1 = boot->RootDirEnts * 32; b2 = boot->SecPerClust * boot->BytesPerSec; - if (!(buffer = malloc(b1 > b2 ? b1 : b2)) - || !(delbuf = malloc(b2)) - || !(rootDir = newDosDirEntry())) { - perror("No space for directory"); + if ((buffer = malloc( b1 > b2 ? b1 : b2)) == NULL) { + perror("No space for directory buffer"); return FSFATAL; } + + if ((delbuf = malloc(b2)) == NULL) { + free(buffer); + perror("No space for directory delbuf"); + return FSFATAL; + } + + if ((rootDir = newDosDirEntry()) == NULL) { + free(buffer); + free(delbuf); + perror("No space for directory entry"); + return FSFATAL; + } + memset(rootDir, 0, sizeof *rootDir); if (boot->flags & FAT32) { if (boot->RootCl < CLUST_FIRST || boot->RootCl >= boot->NumClusters) { @@ -360,7 +371,8 @@ removede(int f, struct bootblock *boot, return FSFATAL; start = buffer; } - if (endcl == curcl) + /* startcl is < CLUST_FIRST for !fat32 root */ + if ((endcl == curcl) || (startcl < CLUST_FIRST)) for (; start < end; start += 32) *start = SLOT_DELETED; return FSDIRMOD; @@ -378,7 +390,7 @@ checksize(struct bootblock *boot, struct /* * Check size on ordinary files */ - int32_t physicalSize; + u_int32_t physicalSize; if (dir->head == CLUST_FREE) physicalSize = 0; @@ -637,7 +649,8 @@ readDosDirSection(int f, struct bootbloc dirent.head |= (p[20] << 16) | (p[21] << 24); dirent.size = p[28] | (p[29] << 8) | (p[30] << 16) | (p[31] << 24); if (vallfn) { - strcpy(dirent.lname, longName); + strlcpy(dirent.lname, longName, + sizeof(dirent.lname)); longName[0] = '\0'; shortSum = -1; } @@ -825,6 +838,10 @@ readDosDirSection(int f, struct bootbloc } boot->NumFiles++; } + + if (!(boot->flags & FAT32) && !dir->parent) + break; + if (mod & THISMOD) { last *= 32; if (lseek(f, off, SEEK_SET) != off @@ -840,6 +857,19 @@ readDosDirSection(int f, struct bootbloc invlfn ? invlfn : vallfn, p, invlfn ? invcl : valcl, -1, 0, fullpath(dir), 1); + + /* The root directory of non fat32 filesystems is in a special + * area and may have been modified above without being written out. + */ + if ((mod & FSDIRMOD) && !(boot->flags & FAT32) && !dir->parent) { + last *= 32; + if (lseek(f, off, SEEK_SET) != off + || write(f, buffer, last) != last) { + perror("Unable to write directory"); + return FSFATAL; + } + mod &= ~THISMOD; + } return mod & ~THISMOD; } @@ -929,7 +959,7 @@ reconnect(int dosfs, struct bootblock *b lfoff = lfcl * boot->ClusterSize + boot->ClusterOffset * boot->BytesPerSec; if (lseek(dosfs, lfoff, SEEK_SET) != lfoff - || read(dosfs, lfbuf, boot->ClusterSize) != boot->ClusterSize) { + || (size_t)read(dosfs, lfbuf, boot->ClusterSize) != boot->ClusterSize) { perror("could not read LOST.DIR"); return FSFATAL; } @@ -959,7 +989,7 @@ reconnect(int dosfs, struct bootblock *b p[31] = (u_char)(d.size >> 24); fat[head].flags |= FAT_USED; if (lseek(dosfs, lfoff, SEEK_SET) != lfoff - || write(dosfs, lfbuf, boot->ClusterSize) != boot->ClusterSize) { + || (size_t)write(dosfs, lfbuf, boot->ClusterSize) != boot->ClusterSize) { perror("could not write LOST.DIR"); return FSFATAL; } Modified: head/sbin/fsck_msdosfs/dosfs.h ============================================================================== --- head/sbin/fsck_msdosfs/dosfs.h Sun Feb 14 12:28:43 2010 (r203871) +++ head/sbin/fsck_msdosfs/dosfs.h Sun Feb 14 12:30:30 2010 (r203872) @@ -48,8 +48,13 @@ struct bootblock { u_int FATsmall; /* number of sectors per FAT */ u_int SecPerTrack; /* sectors per track */ u_int Heads; /* number of heads */ - u_int32_t Sectors; /* total number of sectors */ u_int32_t HiddenSecs; /* # of hidden sectors */ + u_int32_t Sectors; /* total number of sectors */ +#define FAT32 1 /* this is a FAT32 file system */ + /* + * Maybe, we should separate out + * various parts of FAT32? XXX + */ u_int32_t HugeSectors; /* # of sectors if bpbSectors == 0 */ u_int FSInfo; /* FSInfo sector */ u_int Backup; /* Backup of Bootblocks */ @@ -59,11 +64,6 @@ struct bootblock { /* and some more calculated values */ u_int flags; /* some flags: */ -#define FAT32 1 /* this is a FAT32 file system */ - /* - * Maybe, we should separate out - * various parts of FAT32? XXX - */ int ValidFat; /* valid fat if FAT32 non-mirrored */ cl_t ClustMask; /* mask for entries in FAT */ cl_t NumClusters; /* # of entries in a FAT */ Modified: head/sbin/fsck_msdosfs/ext.h ============================================================================== --- head/sbin/fsck_msdosfs/ext.h Sun Feb 14 12:28:43 2010 (r203871) +++ head/sbin/fsck_msdosfs/ext.h Sun Feb 14 12:30:30 2010 (r203872) @@ -70,12 +70,12 @@ int checkfilesys(const char *); #define FSDIRMOD 2 /* Some directory was modified */ #define FSFATMOD 4 /* The FAT was modified */ #define FSERROR 8 /* Some unrecovered error remains */ -#define FSFATAL 16 /* Some unrecoverable error occured */ +#define FSFATAL 16 /* Some unrecoverable error occurred */ #define FSDIRTY 32 /* File system is dirty */ #define FSFIXFAT 64 /* Fix file system FAT */ /* - * read a boot block in a machine independend fashion and translate + * read a boot block in a machine independent fashion and translate * it into our struct bootblock. */ int readboot(int, struct bootblock *); @@ -89,13 +89,13 @@ int writefsinfo(int, struct bootblock *) * Read one of the FAT copies and return a pointer to the new * allocated array holding our description of it. */ -int readfat(int, struct bootblock *, int, struct fatEntry **); +int readfat(int, struct bootblock *, u_int, struct fatEntry **); /* * Check two FAT copies for consistency and merge changes into the - * first if neccessary. + * first if necessary. */ -int comparefat(struct bootblock *, struct fatEntry *, struct fatEntry *, int); +int comparefat(struct bootblock *, struct fatEntry *, struct fatEntry *, u_int); /* * Check a FAT Modified: head/sbin/fsck_msdosfs/fat.c ============================================================================== --- head/sbin/fsck_msdosfs/fat.c Sun Feb 14 12:28:43 2010 (r203871) +++ head/sbin/fsck_msdosfs/fat.c Sun Feb 14 12:30:30 2010 (r203872) @@ -40,10 +40,10 @@ static const char rcsid[] = #include "ext.h" #include "fsutil.h" -static int checkclnum(struct bootblock *, int, cl_t, cl_t *); -static int clustdiffer(cl_t, cl_t *, cl_t *, int); +static int checkclnum(struct bootblock *, u_int, cl_t, cl_t *); +static int clustdiffer(cl_t, cl_t *, cl_t *, u_int); static int tryclear(struct bootblock *, struct fatEntry *, cl_t, cl_t *); -static int _readfat(int, struct bootblock *, int, u_char **); +static int _readfat(int, struct bootblock *, u_int, u_char **); /*- * The first 2 FAT entries contain pseudo-cluster numbers with the following @@ -128,7 +128,7 @@ err: * Check a cluster number for valid value */ static int -checkclnum(struct bootblock *boot, int fat, cl_t cl, cl_t *next) +checkclnum(struct bootblock *boot, u_int fat, cl_t cl, cl_t *next) { if (*next >= (CLUST_RSRVD&boot->ClustMask)) *next |= ~boot->ClustMask; @@ -159,7 +159,7 @@ checkclnum(struct bootblock *boot, int f * Read a FAT from disk. Returns 1 if successful, 0 otherwise. */ static int -_readfat(int fs, struct bootblock *boot, int no, u_char **buffer) +_readfat(int fs, struct bootblock *boot, u_int no, u_char **buffer) { off_t off; @@ -177,7 +177,7 @@ _readfat(int fs, struct bootblock *boot, goto err; } - if (read(fs, *buffer, boot->FATsecs * boot->BytesPerSec) + if ((size_t)read(fs, *buffer, boot->FATsecs * boot->BytesPerSec) != boot->FATsecs * boot->BytesPerSec) { perror("Unable to read FAT"); goto err; @@ -194,24 +194,26 @@ _readfat(int fs, struct bootblock *boot, * Read a FAT and decode it into internal format */ int -readfat(int fs, struct bootblock *boot, int no, struct fatEntry **fp) +readfat(int fs, struct bootblock *boot, u_int no, struct fatEntry **fp) { struct fatEntry *fat; u_char *buffer, *p; cl_t cl; int ret = FSOK; + size_t len; boot->NumFree = boot->NumBad = 0; if (!_readfat(fs, boot, no, &buffer)) return FSFATAL; - fat = calloc(boot->NumClusters, sizeof(struct fatEntry)); + fat = malloc(len = boot->NumClusters * sizeof(struct fatEntry)); if (fat == NULL) { perror("No space for FAT"); free(buffer); return FSFATAL; } + (void)memset(fat, 0, len); if (buffer[0] != boot->Media || buffer[1] != 0xff || buffer[2] != 0xff @@ -304,7 +306,11 @@ readfat(int fs, struct bootblock *boot, } free(buffer); - *fp = fat; + if (ret & FSFATAL) { + free(fat); + *fp = NULL; + } else + *fp = fat; return ret; } @@ -324,7 +330,7 @@ rsrvdcltype(cl_t cl) } static int -clustdiffer(cl_t cl, cl_t *cp1, cl_t *cp2, int fatnum) +clustdiffer(cl_t cl, cl_t *cp1, cl_t *cp2, u_int fatnum) { if (*cp1 == CLUST_FREE || *cp1 >= CLUST_RSRVD) { if (*cp2 == CLUST_FREE || *cp2 >= CLUST_RSRVD) { @@ -339,13 +345,13 @@ clustdiffer(cl_t cl, cl_t *cp1, cl_t *cp } return FSFATAL; } - pwarn("Cluster %u is marked %s in FAT 0, %s in FAT %d\n", + pwarn("Cluster %u is marked %s in FAT 0, %s in FAT %u\n", cl, rsrvdcltype(*cp1), rsrvdcltype(*cp2), fatnum); if (ask(0, "Use FAT 0's entry")) { *cp2 = *cp1; return FSFATMOD; } - if (ask(0, "Use FAT %d's entry", fatnum)) { + if (ask(0, "Use FAT %u's entry", fatnum)) { *cp1 = *cp2; return FSFATMOD; } @@ -353,7 +359,7 @@ clustdiffer(cl_t cl, cl_t *cp1, cl_t *cp } pwarn("Cluster %u is marked %s in FAT 0, but continues with cluster %u in FAT %d\n", cl, rsrvdcltype(*cp1), *cp2, fatnum); - if (ask(0, "Use continuation from FAT %d", fatnum)) { + if (ask(0, "Use continuation from FAT %u", fatnum)) { *cp1 = *cp2; return FSFATMOD; } @@ -364,7 +370,7 @@ clustdiffer(cl_t cl, cl_t *cp1, cl_t *cp return FSFATAL; } if (*cp2 == CLUST_FREE || *cp2 >= CLUST_RSRVD) { - pwarn("Cluster %u continues with cluster %u in FAT 0, but is marked %s in FAT %d\n", + pwarn("Cluster %u continues with cluster %u in FAT 0, but is marked %s in FAT %u\n", cl, *cp1, rsrvdcltype(*cp2), fatnum); if (ask(0, "Use continuation from FAT 0")) { *cp2 = *cp1; @@ -376,13 +382,13 @@ clustdiffer(cl_t cl, cl_t *cp1, cl_t *cp } return FSERROR; } - pwarn("Cluster %u continues with cluster %u in FAT 0, but with cluster %u in FAT %d\n", + pwarn("Cluster %u continues with cluster %u in FAT 0, but with cluster %u in FAT %u\n", cl, *cp1, *cp2, fatnum); if (ask(0, "Use continuation from FAT 0")) { *cp2 = *cp1; return FSFATMOD; } - if (ask(0, "Use continuation from FAT %d", fatnum)) { + if (ask(0, "Use continuation from FAT %u", fatnum)) { *cp1 = *cp2; return FSFATMOD; } @@ -394,8 +400,8 @@ clustdiffer(cl_t cl, cl_t *cp1, cl_t *cp * into the first one. */ int -comparefat(struct bootblock *boot, struct fatEntry *first, - struct fatEntry *second, int fatnum) +comparefat(struct bootblock *boot, struct fatEntry *first, + struct fatEntry *second, u_int fatnum) { cl_t cl; int ret = FSOK; @@ -535,8 +541,8 @@ writefat(int fs, struct bootblock *boot, { u_char *buffer, *p; cl_t cl; - int i; - u_int32_t fatsz; + u_int i; + size_t fatsz; off_t off; int ret = FSOK; @@ -626,7 +632,7 @@ writefat(int fs, struct bootblock *boot, off = boot->ResSectors + i * boot->FATsecs; off *= boot->BytesPerSec; if (lseek(fs, off, SEEK_SET) != off - || write(fs, buffer, fatsz) != fatsz) { + || (size_t)write(fs, buffer, fatsz) != fatsz) { perror("Unable to write FAT"); ret = FSFATAL; /* Return immediately? XXX */ } @@ -676,17 +682,6 @@ checklost(int dosfs, struct bootblock *b ret = 1; } } - if (boot->NumFree && fat[boot->FSNext].next != CLUST_FREE) { - pwarn("Next free cluster in FSInfo block (%u) not free\n", - boot->FSNext); - if (ask(1, "Fix")) - for (head = CLUST_FIRST; head < boot->NumClusters; head++) - if (fat[head].next == CLUST_FREE) { - boot->FSNext = head; - ret = 1; - break; - } - } if (ret) mod |= writefsinfo(dosfs, boot); } Modified: head/sbin/fsck_msdosfs/main.c ============================================================================== --- head/sbin/fsck_msdosfs/main.c Sun Feb 14 12:28:43 2010 (r203871) +++ head/sbin/fsck_msdosfs/main.c Sun Feb 14 12:30:30 2010 (r203872) @@ -33,7 +33,6 @@ static const char rcsid[] = #include #include -#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 12:30:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C5331065670; Sun, 14 Feb 2010 12:30:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3BD2B8FC15; Sun, 14 Feb 2010 12:30: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 o1ECUauI070703; Sun, 14 Feb 2010 12:30:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ECUa2f070700; Sun, 14 Feb 2010 12:30:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141230.o1ECUa2f070700@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 12:30: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: r203873 - head/sys/dev/ahci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 12:30:36 -0000 Author: mav Date: Sun Feb 14 12:30:35 2010 New Revision: 203873 URL: http://svn.freebsd.org/changeset/base/203873 Log: MFp4: With FBS enabled, we have no idea what command caused timeout. Implement same logic as in siis(4) - wait for other commands complete or timeout and then give some more time. Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Sun Feb 14 12:30:30 2010 (r203872) +++ head/sys/dev/ahci/ahci.c Sun Feb 14 12:30:35 2010 (r203873) @@ -1663,6 +1663,45 @@ ahci_execute_transaction(struct ahci_slo return; } +/* Must be called with channel locked. */ +static void +ahci_process_timeout(device_t dev) +{ + struct ahci_channel *ch = device_get_softc(dev); + int i; + + mtx_assert(&ch->mtx, MA_OWNED); + /* Handle the rest of commands. */ + for (i = 0; i < ch->numslots; i++) { + /* Do we have a running request on slot? */ + if (ch->slot[i].state < AHCI_SLOT_RUNNING) + continue; + ahci_end_transaction(&ch->slot[i], AHCI_ERR_TIMEOUT); + } +} + +/* Must be called with channel locked. */ +static void +ahci_rearm_timeout(device_t dev) +{ + struct ahci_channel *ch = device_get_softc(dev); + int i; + + mtx_assert(&ch->mtx, MA_OWNED); + for (i = 0; i < ch->numslots; i++) { + struct ahci_slot *slot = &ch->slot[i]; + + /* Do we have a running request on slot? */ + if (slot->state < AHCI_SLOT_RUNNING) + continue; + if ((ch->toslots & (1 << i)) == 0) + continue; + callout_reset(&slot->timeout, + (int)slot->ccb->ccb_h.timeout * hz / 2000, + (timeout_t*)ahci_timeout, slot); + } +} + /* Locked by callout mechanism. */ static void ahci_timeout(struct ahci_slot *slot) @@ -1699,7 +1738,6 @@ ahci_timeout(struct ahci_slot *slot) ATA_INL(ch->r_mem, AHCI_P_SACT), ch->rslots, ATA_INL(ch->r_mem, AHCI_P_TFD), ATA_INL(ch->r_mem, AHCI_P_SERR)); - ch->fatalerr = 1; /* Handle frozen command. */ if (ch->frozen) { union ccb *fccb = ch->frozen; @@ -1711,14 +1749,28 @@ ahci_timeout(struct ahci_slot *slot) } xpt_done(fccb); } - /* Handle command with timeout. */ - ahci_end_transaction(&ch->slot[slot->slot], AHCI_ERR_TIMEOUT); - /* Handle the rest of commands. */ - for (i = 0; i < ch->numslots; i++) { - /* Do we have a running request on slot? */ - if (ch->slot[i].state < AHCI_SLOT_RUNNING) - continue; - ahci_end_transaction(&ch->slot[i], AHCI_ERR_INNOCENT); + if (!ch->fbs_enabled) { + /* Without FBS we know real timeout source. */ + ch->fatalerr = 1; + /* Handle command with timeout. */ + ahci_end_transaction(&ch->slot[slot->slot], AHCI_ERR_TIMEOUT); + /* Handle the rest of commands. */ + for (i = 0; i < ch->numslots; i++) { + /* Do we have a running request on slot? */ + if (ch->slot[i].state < AHCI_SLOT_RUNNING) + continue; + ahci_end_transaction(&ch->slot[i], AHCI_ERR_INNOCENT); + } + } else { + /* With FBS we wait for other commands timeout and pray. */ + if (ch->toslots == 0) + xpt_freeze_simq(ch->sim, 1); + ch->toslots |= (1 << slot->slot); + if ((ch->rslots & ~ch->toslots) == 0) + ahci_process_timeout(dev); + else + device_printf(dev, " ... waiting for slots %08x\n", + ch->rslots & ~ch->toslots); } } @@ -1815,10 +1867,6 @@ ahci_end_transaction(struct ahci_slot *s ccb->ccb_h.status |= CAM_UNCOR_PARITY; break; case AHCI_ERR_TIMEOUT: - /* Do no treat soft-reset timeout as fatal here. */ - if (ccb->ccb_h.func_code != XPT_ATA_IO || - !(ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL)) - ch->fatalerr = 1; if (!ch->readlog) { xpt_freeze_simq(ch->sim, 1); ccb->ccb_h.status &= ~CAM_STATUS_MASK; @@ -1834,6 +1882,11 @@ ahci_end_transaction(struct ahci_slot *s ch->oslots &= ~(1 << slot->slot); ch->rslots &= ~(1 << slot->slot); ch->aslots &= ~(1 << slot->slot); + if (et != AHCI_ERR_TIMEOUT) { + if (ch->toslots == (1 << slot->slot)) + xpt_release_simq(ch->sim, TRUE); + ch->toslots &= ~(1 << slot->slot); + } slot->state = AHCI_SLOT_EMPTY; slot->ccb = NULL; /* Update channel stats. */ @@ -1873,7 +1926,7 @@ ahci_end_transaction(struct ahci_slot *s /* If we have no other active commands, ... */ if (ch->rslots == 0) { /* if there was fatal error - reset port. */ - if (ch->fatalerr) { + if (ch->toslots != 0 || ch->fatalerr) { ahci_reset(dev); } else { /* if we have slots in error, we can reinit port. */ @@ -1885,7 +1938,10 @@ ahci_end_transaction(struct ahci_slot *s if (!ch->readlog && ch->numhslots) ahci_issue_read_log(dev); } - } + /* If all the rest of commands are in timeout - give them chance. */ + } else if ((ch->rslots & ~ch->toslots) == 0 && + et != AHCI_ERR_TIMEOUT) + ahci_rearm_timeout(dev); /* Start PM timer. */ if (ch->numrslots == 0 && ch->pm_level > 3) { callout_schedule(&ch->pm_timer, @@ -2149,7 +2205,10 @@ ahci_reset(device_t dev) ch->hold[i] = NULL; ch->numhslots--; } + if (ch->toslots != 0) + xpt_release_simq(ch->sim, TRUE); ch->eslots = 0; + ch->toslots = 0; ch->fatalerr = 0; /* Tell the XPT about the event */ xpt_async(AC_BUS_RESET, ch->path, NULL); Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Sun Feb 14 12:30:30 2010 (r203872) +++ head/sys/dev/ahci/ahci.h Sun Feb 14 12:30:35 2010 (r203873) @@ -401,6 +401,7 @@ struct ahci_channel { uint32_t rslots; /* Running slots */ uint32_t aslots; /* Slots with atomic commands */ uint32_t eslots; /* Slots in error */ + uint32_t toslots; /* Slots in timeout */ int numrslots; /* Number of running slots */ int numrslotspd[16];/* Number of running slots per dev */ int numtslots; /* Number of tagged slots */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 12:31:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02EFF10656A8; Sun, 14 Feb 2010 12:31:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E58EE8FC32; Sun, 14 Feb 2010 12:31: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 o1ECVSp9070911; Sun, 14 Feb 2010 12:31:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ECVSdR070905; Sun, 14 Feb 2010 12:31:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002141231.o1ECVSdR070905@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 14 Feb 2010 12:31: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: r203874 - head/sbin/fsck_msdosfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 12:31:29 -0000 Author: kib Date: Sun Feb 14 12:31:28 2010 New Revision: 203874 URL: http://svn.freebsd.org/changeset/base/203874 Log: Rename fields to match better the msdosfs headers. This work is still incomplete as some info doesn't really belong to the structs where it is defined. Submitted by: Pedro F. Giffuni Reviewed by: bde MFC after: 2 weeks Modified: head/sbin/fsck_msdosfs/boot.c head/sbin/fsck_msdosfs/check.c head/sbin/fsck_msdosfs/dir.c head/sbin/fsck_msdosfs/dosfs.h head/sbin/fsck_msdosfs/fat.c Modified: head/sbin/fsck_msdosfs/boot.c ============================================================================== --- head/sbin/fsck_msdosfs/boot.c Sun Feb 14 12:30:35 2010 (r203873) +++ head/sbin/fsck_msdosfs/boot.c Sun Feb 14 12:31:28 2010 (r203874) @@ -62,22 +62,22 @@ readboot(int dosfs, struct bootblock *bo boot->ValidFat = -1; /* decode bios parameter block */ - boot->BytesPerSec = block[11] + (block[12] << 8); - boot->SecPerClust = block[13]; - boot->ResSectors = block[14] + (block[15] << 8); - boot->FATs = block[16]; - boot->RootDirEnts = block[17] + (block[18] << 8); - boot->Sectors = block[19] + (block[20] << 8); - boot->Media = block[21]; - boot->FATsmall = block[22] + (block[23] << 8); + boot->bpbBytesPerSec = block[11] + (block[12] << 8); + boot->bpbSecPerClust = block[13]; + boot->bpbResSectors = block[14] + (block[15] << 8); + boot->bpbFATs = block[16]; + boot->bpbRootDirEnts = block[17] + (block[18] << 8); + boot->bpbSectors = block[19] + (block[20] << 8); + boot->bpbMedia = block[21]; + boot->bpbFATsmall = block[22] + (block[23] << 8); boot->SecPerTrack = block[24] + (block[25] << 8); - boot->Heads = block[26] + (block[27] << 8); - boot->HiddenSecs = block[28] + (block[29] << 8) + (block[30] << 16) + (block[31] << 24); - boot->HugeSectors = block[32] + (block[33] << 8) + (block[34] << 16) + (block[35] << 24); + boot->bpbHeads = block[26] + (block[27] << 8); + boot->bpbHiddenSecs = block[28] + (block[29] << 8) + (block[30] << 16) + (block[31] << 24); + boot->bpbHugeSectors = block[32] + (block[33] << 8) + (block[34] << 16) + (block[35] << 24); - boot->FATsecs = boot->FATsmall; + boot->FATsecs = boot->bpbFATsmall; - if (!boot->RootDirEnts) + if (!boot->bpbRootDirEnts) boot->flags |= FAT32; if (boot->flags & FAT32) { boot->FATsecs = block[36] + (block[37] << 8) @@ -92,13 +92,13 @@ readboot(int dosfs, struct bootblock *bo block[43], block[42]); return FSFATAL; } - boot->RootCl = block[44] + (block[45] << 8) + boot->bpbRootClust = block[44] + (block[45] << 8) + (block[46] << 16) + (block[47] << 24); - boot->FSInfo = block[48] + (block[49] << 8); - boot->Backup = block[50] + (block[51] << 8); + boot->bpbFSInfo = block[48] + (block[49] << 8); + boot->bpbBackup = block[50] + (block[51] << 8); - if (lseek(dosfs, boot->FSInfo * boot->BytesPerSec, SEEK_SET) - != boot->FSInfo * boot->BytesPerSec + if (lseek(dosfs, boot->bpbFSInfo * boot->bpbBytesPerSec, SEEK_SET) + != boot->bpbFSInfo * boot->bpbBytesPerSec || read(dosfs, fsinfo, sizeof fsinfo) != sizeof fsinfo) { perror("could not read fsinfo block"); @@ -124,18 +124,18 @@ readboot(int dosfs, struct bootblock *bo fsinfo[0x3fc] = fsinfo[0x3fd] = 0; fsinfo[0x3fe] = 0x55; fsinfo[0x3ff] = 0xaa; - if (lseek(dosfs, boot->FSInfo * boot->BytesPerSec, SEEK_SET) - != boot->FSInfo * boot->BytesPerSec + if (lseek(dosfs, boot->bpbFSInfo * boot->bpbBytesPerSec, SEEK_SET) + != boot->bpbFSInfo * boot->bpbBytesPerSec || write(dosfs, fsinfo, sizeof fsinfo) != sizeof fsinfo) { - perror("Unable to write FSInfo"); + perror("Unable to write bpbFSInfo"); return FSFATAL; } ret = FSBOOTMOD; } else - boot->FSInfo = 0; + boot->bpbFSInfo = 0; } - if (boot->FSInfo) { + if (boot->bpbFSInfo) { boot->FSFree = fsinfo[0x1e8] + (fsinfo[0x1e9] << 8) + (fsinfo[0x1ea] << 16) + (fsinfo[0x1eb] << 24); @@ -144,8 +144,8 @@ readboot(int dosfs, struct bootblock *bo + (fsinfo[0x1ef] << 24); } - if (lseek(dosfs, boot->Backup * boot->BytesPerSec, SEEK_SET) - != boot->Backup * boot->BytesPerSec + if (lseek(dosfs, boot->bpbBackup * boot->bpbBytesPerSec, SEEK_SET) + != boot->bpbBackup * boot->bpbBytesPerSec || read(dosfs, backup, sizeof backup) != sizeof backup) { perror("could not read backup bootblock"); return FSFATAL; @@ -162,36 +162,36 @@ readboot(int dosfs, struct bootblock *bo * print out useful information and continue. */ pfatal("backup (block %d) mismatch with primary bootblock:\n", - boot->Backup); + boot->bpbBackup); for (i = 11; i < 11 + 90; i++) { if (block[i] != backup[i]) pfatal("\ti=%d\tprimary 0x%02x\tbackup 0x%02x\n", i, block[i], backup[i]); } } - /* Check backup FSInfo? XXX */ + /* Check backup bpbFSInfo? XXX */ } - boot->ClusterOffset = (boot->RootDirEnts * 32 + boot->BytesPerSec - 1) - / boot->BytesPerSec - + boot->ResSectors - + boot->FATs * boot->FATsecs - - CLUST_FIRST * boot->SecPerClust; + boot->ClusterOffset = (boot->bpbRootDirEnts * 32 + boot->bpbBytesPerSec - 1) + / boot->bpbBytesPerSec + + boot->bpbResSectors + + boot->bpbFATs * boot->FATsecs + - CLUST_FIRST * boot->bpbSecPerClust; - if (boot->BytesPerSec % DOSBOOTBLOCKSIZE != 0) { - pfatal("Invalid sector size: %u", boot->BytesPerSec); + if (boot->bpbBytesPerSec % DOSBOOTBLOCKSIZE != 0) { + pfatal("Invalid sector size: %u", boot->bpbBytesPerSec); return FSFATAL; } - if (boot->SecPerClust == 0) { - pfatal("Invalid cluster size: %u", boot->SecPerClust); + if (boot->bpbSecPerClust == 0) { + pfatal("Invalid cluster size: %u", boot->bpbSecPerClust); return FSFATAL; } - if (boot->Sectors) { - boot->HugeSectors = 0; - boot->NumSectors = boot->Sectors; + if (boot->bpbSectors) { + boot->bpbHugeSectors = 0; + boot->NumSectors = boot->bpbSectors; } else - boot->NumSectors = boot->HugeSectors; - boot->NumClusters = (boot->NumSectors - boot->ClusterOffset) / boot->SecPerClust; + boot->NumSectors = boot->bpbHugeSectors; + boot->NumClusters = (boot->NumSectors - boot->ClusterOffset) / boot->bpbSecPerClust; if (boot->flags&FAT32) boot->ClustMask = CLUST32_MASK; @@ -207,13 +207,13 @@ readboot(int dosfs, struct bootblock *bo switch (boot->ClustMask) { case CLUST32_MASK: - boot->NumFatEntries = (boot->FATsecs * boot->BytesPerSec) / 4; + boot->NumFatEntries = (boot->FATsecs * boot->bpbBytesPerSec) / 4; break; case CLUST16_MASK: - boot->NumFatEntries = (boot->FATsecs * boot->BytesPerSec) / 2; + boot->NumFatEntries = (boot->FATsecs * boot->bpbBytesPerSec) / 2; break; default: - boot->NumFatEntries = (boot->FATsecs * boot->BytesPerSec * 2) / 3; + boot->NumFatEntries = (boot->FATsecs * boot->bpbBytesPerSec * 2) / 3; break; } @@ -222,7 +222,7 @@ readboot(int dosfs, struct bootblock *bo boot->NumClusters, boot->FATsecs); return FSFATAL; } - boot->ClusterSize = boot->BytesPerSec * boot->SecPerClust; + boot->ClusterSize = boot->bpbBytesPerSec * boot->bpbSecPerClust; boot->NumFiles = 1; boot->NumFree = 0; @@ -235,8 +235,8 @@ writefsinfo(int dosfs, struct bootblock { u_char fsinfo[2 * DOSBOOTBLOCKSIZE]; - if (lseek(dosfs, boot->FSInfo * boot->BytesPerSec, SEEK_SET) - != boot->FSInfo * boot->BytesPerSec + if (lseek(dosfs, boot->bpbFSInfo * boot->bpbBytesPerSec, SEEK_SET) + != boot->bpbFSInfo * boot->bpbBytesPerSec || read(dosfs, fsinfo, sizeof fsinfo) != sizeof fsinfo) { perror("could not read fsinfo block"); return FSFATAL; @@ -249,11 +249,11 @@ writefsinfo(int dosfs, struct bootblock fsinfo[0x1ed] = (u_char)(boot->FSNext >> 8); fsinfo[0x1ee] = (u_char)(boot->FSNext >> 16); fsinfo[0x1ef] = (u_char)(boot->FSNext >> 24); - if (lseek(dosfs, boot->FSInfo * boot->BytesPerSec, SEEK_SET) - != boot->FSInfo * boot->BytesPerSec + if (lseek(dosfs, boot->bpbFSInfo * boot->bpbBytesPerSec, SEEK_SET) + != boot->bpbFSInfo * boot->bpbBytesPerSec || write(dosfs, fsinfo, sizeof fsinfo) != sizeof fsinfo) { - perror("Unable to write FSInfo"); + perror("Unable to write bpbFSInfo"); return FSFATAL; } /* Modified: head/sbin/fsck_msdosfs/check.c ============================================================================== --- head/sbin/fsck_msdosfs/check.c Sun Feb 14 12:30:35 2010 (r203873) +++ head/sbin/fsck_msdosfs/check.c Sun Feb 14 12:31:28 2010 (r203874) @@ -98,7 +98,7 @@ checkfilesys(const char *fname) } if (boot.ValidFat < 0) - for (i = 1; i < (int)boot.FATs; i++) { + for (i = 1; i < (int)boot.bpbFATs; i++) { struct fatEntry *currentFat; mod |= readfat(dosfs, &boot, i, ¤tFat); Modified: head/sbin/fsck_msdosfs/dir.c ============================================================================== --- head/sbin/fsck_msdosfs/dir.c Sun Feb 14 12:30:35 2010 (r203873) +++ head/sbin/fsck_msdosfs/dir.c Sun Feb 14 12:31:28 2010 (r203874) @@ -219,8 +219,8 @@ resetDosDirSection(struct bootblock *boo cl_t cl; int ret = FSOK; - b1 = boot->RootDirEnts * 32; - b2 = boot->SecPerClust * boot->BytesPerSec; + b1 = boot->bpbRootDirEnts * 32; + b2 = boot->bpbSecPerClust * boot->bpbBytesPerSec; if ((buffer = malloc( b1 > b2 ? b1 : b2)) == NULL) { perror("No space for directory buffer"); @@ -242,15 +242,15 @@ resetDosDirSection(struct bootblock *boo memset(rootDir, 0, sizeof *rootDir); if (boot->flags & FAT32) { - if (boot->RootCl < CLUST_FIRST || boot->RootCl >= boot->NumClusters) { + if (boot->bpbRootClust < CLUST_FIRST || boot->bpbRootClust >= boot->NumClusters) { pfatal("Root directory starts with cluster out of range(%u)", - boot->RootCl); + boot->bpbRootClust); return FSFATAL; } - cl = fat[boot->RootCl].next; + cl = fat[boot->bpbRootClust].next; if (cl < CLUST_FIRST || (cl >= CLUST_RSRVD && cl< CLUST_EOFS) - || fat[boot->RootCl].head != boot->RootCl) { + || fat[boot->bpbRootClust].head != boot->bpbRootClust) { if (cl == CLUST_FREE) pwarn("Root directory starts with free cluster\n"); else if (cl >= CLUST_RSRVD) @@ -261,14 +261,14 @@ resetDosDirSection(struct bootblock *boo return FSFATAL; } if (ask(1, "Fix")) { - fat[boot->RootCl].next = CLUST_FREE; + fat[boot->bpbRootClust].next = CLUST_FREE; ret = FSFATMOD; } else ret = FSFATAL; } - fat[boot->RootCl].flags |= FAT_USED; - rootDir->head = boot->RootCl; + fat[boot->bpbRootClust].flags |= FAT_USED; + rootDir->head = boot->bpbRootClust; } return ret; @@ -313,7 +313,7 @@ delete(int f, struct bootblock *boot, st { u_char *s, *e; off_t off; - int clsz = boot->SecPerClust * boot->BytesPerSec; + int clsz = boot->bpbSecPerClust * boot->bpbBytesPerSec; s = delbuf + startoff; e = delbuf + clsz; @@ -323,8 +323,8 @@ delete(int f, struct bootblock *boot, st break; e = delbuf + endoff; } - off = startcl * boot->SecPerClust + boot->ClusterOffset; - off *= boot->BytesPerSec; + off = startcl * boot->bpbSecPerClust + boot->ClusterOffset; + off *= boot->bpbBytesPerSec; if (lseek(f, off, SEEK_SET) != off || read(f, delbuf, clsz) != clsz) { perror("Unable to read directory"); @@ -461,14 +461,14 @@ readDosDirSection(int f, struct bootbloc vallfn = invlfn = empty = NULL; do { if (!(boot->flags & FAT32) && !dir->parent) { - last = boot->RootDirEnts * 32; - off = boot->ResSectors + boot->FATs * boot->FATsecs; + last = boot->bpbRootDirEnts * 32; + off = boot->bpbResSectors + boot->bpbFATs * boot->FATsecs; } else { - last = boot->SecPerClust * boot->BytesPerSec; - off = cl * boot->SecPerClust + boot->ClusterOffset; + last = boot->bpbSecPerClust * boot->bpbBytesPerSec; + off = cl * boot->bpbSecPerClust + boot->ClusterOffset; } - off *= boot->BytesPerSec; + off *= boot->bpbBytesPerSec; if (lseek(f, off, SEEK_SET) != off || read(f, buffer, last) != last) { perror("Unable to read directory"); @@ -957,7 +957,7 @@ reconnect(int dosfs, struct bootblock *b return FSERROR; } lfoff = lfcl * boot->ClusterSize - + boot->ClusterOffset * boot->BytesPerSec; + + boot->ClusterOffset * boot->bpbBytesPerSec; if (lseek(dosfs, lfoff, SEEK_SET) != lfoff || (size_t)read(dosfs, lfbuf, boot->ClusterSize) != boot->ClusterSize) { perror("could not read LOST.DIR"); Modified: head/sbin/fsck_msdosfs/dosfs.h ============================================================================== --- head/sbin/fsck_msdosfs/dosfs.h Sun Feb 14 12:30:35 2010 (r203873) +++ head/sbin/fsck_msdosfs/dosfs.h Sun Feb 14 12:31:28 2010 (r203874) @@ -39,31 +39,31 @@ typedef u_int32_t cl_t; /* type holding * FAT boot block. */ struct bootblock { - u_int BytesPerSec; /* bytes per sector */ - u_int SecPerClust; /* sectors per cluster */ - u_int ResSectors; /* number of reserved sectors */ - u_int FATs; /* number of FATs */ - u_int RootDirEnts; /* number of root directory entries */ - u_int Media; /* media descriptor */ - u_int FATsmall; /* number of sectors per FAT */ + u_int bpbBytesPerSec; /* bytes per sector */ + u_int bpbSecPerClust; /* sectors per cluster */ + u_int bpbResSectors; /* number of reserved sectors */ + u_int bpbFATs; /* number of bpbFATs */ + u_int bpbRootDirEnts; /* number of root directory entries */ + u_int32_t bpbSectors; /* total number of sectors */ + u_int bpbMedia; /* media descriptor */ + u_int bpbFATsmall; /* number of sectors per FAT */ u_int SecPerTrack; /* sectors per track */ - u_int Heads; /* number of heads */ - u_int32_t HiddenSecs; /* # of hidden sectors */ - u_int32_t Sectors; /* total number of sectors */ -#define FAT32 1 /* this is a FAT32 file system */ - /* - * Maybe, we should separate out - * various parts of FAT32? XXX - */ - u_int32_t HugeSectors; /* # of sectors if bpbSectors == 0 */ - u_int FSInfo; /* FSInfo sector */ - u_int Backup; /* Backup of Bootblocks */ - cl_t RootCl; /* Start of Root Directory */ + u_int bpbHeads; /* number of heads */ + u_int32_t bpbHiddenSecs; /* # of hidden sectors */ + u_int32_t bpbHugeSectors; /* # of sectors if bpbbpbSectors == 0 */ + cl_t bpbRootClust; /* Start of Root Directory */ + u_int bpbFSInfo; /* FSInfo sector */ + u_int bpbBackup; /* Backup of Bootblocks */ cl_t FSFree; /* Number of free clusters acc. FSInfo */ cl_t FSNext; /* Next free cluster acc. FSInfo */ /* and some more calculated values */ u_int flags; /* some flags: */ +#define FAT32 1 /* this is a FAT32 file system */ + /* + * Maybe, we should separate out + * various parts of FAT32? XXX + */ int ValidFat; /* valid fat if FAT32 non-mirrored */ cl_t ClustMask; /* mask for entries in FAT */ cl_t NumClusters; /* # of entries in a FAT */ Modified: head/sbin/fsck_msdosfs/fat.c ============================================================================== --- head/sbin/fsck_msdosfs/fat.c Sun Feb 14 12:30:35 2010 (r203873) +++ head/sbin/fsck_msdosfs/fat.c Sun Feb 14 12:31:28 2010 (r203874) @@ -73,10 +73,10 @@ checkdirty(int fs, struct bootblock *boo if (boot->ClustMask != CLUST16_MASK && boot->ClustMask != CLUST32_MASK) return 0; - off = boot->ResSectors; - off *= boot->BytesPerSec; + off = boot->bpbResSectors; + off *= boot->bpbBytesPerSec; - buffer = malloc(boot->BytesPerSec); + buffer = malloc(boot->bpbBytesPerSec); if (buffer == NULL) { perror("No space for FAT"); return 1; @@ -87,7 +87,7 @@ checkdirty(int fs, struct bootblock *boo goto err; } - if (read(fs, buffer, boot->BytesPerSec) != boot->BytesPerSec) { + if (read(fs, buffer, boot->bpbBytesPerSec) != boot->bpbBytesPerSec) { perror("Unable to read FAT"); goto err; } @@ -96,7 +96,7 @@ checkdirty(int fs, struct bootblock *boo * If we don't understand the FAT, then the file system must be * assumed to be unclean. */ - if (buffer[0] != boot->Media || buffer[1] != 0xff) + if (buffer[0] != boot->bpbMedia || buffer[1] != 0xff) goto err; if (boot->ClustMask == CLUST16_MASK) { if ((buffer[2] & 0xf8) != 0xf8 || (buffer[3] & 0x3f) != 0x3f) @@ -163,22 +163,22 @@ _readfat(int fs, struct bootblock *boot, { off_t off; - *buffer = malloc(boot->FATsecs * boot->BytesPerSec); + *buffer = malloc(boot->FATsecs * boot->bpbBytesPerSec); if (*buffer == NULL) { perror("No space for FAT"); return 0; } - off = boot->ResSectors + no * boot->FATsecs; - off *= boot->BytesPerSec; + off = boot->bpbResSectors + no * boot->FATsecs; + off *= boot->bpbBytesPerSec; if (lseek(fs, off, SEEK_SET) != off) { perror("Unable to read FAT"); goto err; } - if ((size_t)read(fs, *buffer, boot->FATsecs * boot->BytesPerSec) - != boot->FATsecs * boot->BytesPerSec) { + if ((size_t)read(fs, *buffer, boot->FATsecs * boot->bpbBytesPerSec) + != boot->FATsecs * boot->bpbBytesPerSec) { perror("Unable to read FAT"); goto err; } @@ -215,7 +215,7 @@ readfat(int fs, struct bootblock *boot, } (void)memset(fat, 0, len); - if (buffer[0] != boot->Media + if (buffer[0] != boot->bpbMedia || buffer[1] != 0xff || buffer[2] != 0xff || (boot->ClustMask == CLUST16_MASK && buffer[3] != 0xff) || (boot->ClustMask == CLUST32_MASK @@ -229,7 +229,7 @@ readfat(int fs, struct bootblock *boot, * file system is dirty if it doesn't reboot cleanly. * Check this special condition before errorring out. */ - if (buffer[0] == boot->Media && buffer[1] == 0xff + if (buffer[0] == boot->bpbMedia && buffer[1] == 0xff && buffer[2] == 0xff && ((boot->ClustMask == CLUST16_MASK && buffer[3] == 0x7f) || (boot->ClustMask == CLUST32_MASK @@ -546,7 +546,7 @@ writefat(int fs, struct bootblock *boot, off_t off; int ret = FSOK; - buffer = malloc(fatsz = boot->FATsecs * boot->BytesPerSec); + buffer = malloc(fatsz = boot->FATsecs * boot->bpbBytesPerSec); if (buffer == NULL) { perror("No space for FAT"); return FSFATAL; @@ -555,7 +555,7 @@ writefat(int fs, struct bootblock *boot, boot->NumFree = 0; p = buffer; if (correct_fat) { - *p++ = (u_char)boot->Media; + *p++ = (u_char)boot->bpbMedia; *p++ = 0xff; *p++ = 0xff; switch (boot->ClustMask) { @@ -628,9 +628,9 @@ writefat(int fs, struct bootblock *boot, break; } } - for (i = 0; i < boot->FATs; i++) { - off = boot->ResSectors + i * boot->FATsecs; - off *= boot->BytesPerSec; + for (i = 0; i < boot->bpbFATs; i++) { + off = boot->bpbResSectors + i * boot->FATsecs; + off *= boot->bpbBytesPerSec; if (lseek(fs, off, SEEK_SET) != off || (size_t)write(fs, buffer, fatsz) != fatsz) { perror("Unable to write FAT"); @@ -672,7 +672,7 @@ checklost(int dosfs, struct bootblock *b } finishlf(); - if (boot->FSInfo) { + if (boot->bpbFSInfo) { ret = 0; if (boot->FSFree != boot->NumFree) { pwarn("Free space in FSInfo block (%d) not correct (%d)\n", From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 13:59:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAC9C106566C; Sun, 14 Feb 2010 13:59:01 +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 CA39C8FC13; Sun, 14 Feb 2010 13:59: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 o1EDx13d090186; Sun, 14 Feb 2010 13:59:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EDx16a090185; Sun, 14 Feb 2010 13:59:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002141359.o1EDx16a090185@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 14 Feb 2010 13:59:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203875 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 13:59:01 -0000 Author: kib Date: Sun Feb 14 13:59:01 2010 New Revision: 203875 URL: http://svn.freebsd.org/changeset/base/203875 Log: Do not leak process lock when current thread is not allowed to see target. Bumped into by: ed MFC after: 3 days Modified: head/sys/kern/kern_event.c Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sun Feb 14 12:31:28 2010 (r203874) +++ head/sys/kern/kern_event.c Sun Feb 14 13:59:01 2010 (r203875) @@ -349,8 +349,10 @@ filt_procattach(struct knote *kn) if (p == NULL) return (ESRCH); - if ((error = p_cansee(curthread, p))) + if ((error = p_cansee(curthread, p))) { + PROC_UNLOCK(p); return (error); + } kn->kn_ptr.p_proc = p; kn->kn_flags |= EV_CLEAR; /* automatically set */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 15:51:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA276106566C; Sun, 14 Feb 2010 15:51:36 +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 9EC768FC0A; Sun, 14 Feb 2010 15:51: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 o1EFpasq014964; Sun, 14 Feb 2010 15:51:36 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EFpa18014962; Sun, 14 Feb 2010 15:51:36 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201002141551.o1EFpa18014962@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 14 Feb 2010 15:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203876 - head/release/picobsd/tinyware/login X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 15:51:36 -0000 Author: luigi Date: Sun Feb 14 15:51:36 2010 New Revision: 203876 URL: http://svn.freebsd.org/changeset/base/203876 Log: a minimal set of changes to adapt to the utmp->utmpx changes. lastlog still not implemented, i am hoping that Ed or someone has some idea on how to fix this, but it is really not important. Modified: head/release/picobsd/tinyware/login/pico-login.c Modified: head/release/picobsd/tinyware/login/pico-login.c ============================================================================== --- head/release/picobsd/tinyware/login/pico-login.c Sun Feb 14 13:59:01 2010 (r203875) +++ head/release/picobsd/tinyware/login/pico-login.c Sun Feb 14 15:51:36 2010 (r203876) @@ -76,7 +76,7 @@ static const char rcsid[] = #include #include #include -#include +#include #ifdef USE_PAM #include @@ -119,7 +119,6 @@ static char **environ_pam; #endif static int auth_traditional(void); -extern void login(struct utmp *); static void usage(void); #define TTYGRPNAME "tty" /* name of group to own ttys */ @@ -152,7 +151,7 @@ main(argc, argv) struct group *gr; struct stat st; struct timeval tp; - struct utmp utmp; + struct utmpx utmp; int rootok, retries, backoff; int ask, ch, cnt, fflag, hflag, pflag, quietlog, rootlogin, rval; int changepass; @@ -164,6 +163,8 @@ main(argc, argv) char tname[sizeof(_PATH_TTY) + 10]; const char *shell = NULL; login_cap_t *lc = NULL; + int UT_HOSTSIZE = sizeof(utmp.ut_host); + int UT_NAMESIZE = sizeof(utmp.ut_user); #ifdef USE_PAM pid_t pid; int e; @@ -508,14 +509,18 @@ main(argc, argv) refused("Permission denied", "ACCESS", 1); #endif /* LOGIN_ACCESS */ +#if 1 + ulog_login(tty, username, hostname); +#else /* Nothing else left to fail -- really log in. */ memset((void *)&utmp, 0, sizeof(utmp)); - (void)time(&utmp.ut_time); - (void)strncpy(utmp.ut_name, username, sizeof(utmp.ut_name)); + (void)gettimeofday(&utmp.ut_tv, NULL); + (void)strncpy(utmp.ut_user, username, sizeof(utmp.ut_user)); if (hostname) (void)strncpy(utmp.ut_host, hostname, sizeof(utmp.ut_host)); (void)strncpy(utmp.ut_line, tty, sizeof(utmp.ut_line)); login(&utmp); +#endif dolastlog(quietlog); @@ -903,7 +908,7 @@ usage() * Allow for authentication style and/or kerberos instance */ -#define NBUFSIZ UT_NAMESIZE + 64 +#define NBUFSIZ 128 // XXX was UT_NAMESIZE + 64 void getloginname() @@ -985,6 +990,7 @@ void dolastlog(quiet) int quiet; { +#if 0 /* XXX not implemented after utmp->utmpx change */ struct lastlog ll; int fd; @@ -1016,6 +1022,7 @@ dolastlog(quiet) } else { syslog(LOG_ERR, "cannot open %s: %m", _PATH_LASTLOG); } +#endif } void From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 15:55:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D7A01065670; Sun, 14 Feb 2010 15:55:30 +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 56D538FC12; Sun, 14 Feb 2010 15:55:30 +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 o1EFtUZs015868; Sun, 14 Feb 2010 15:55:30 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EFtUEx015866; Sun, 14 Feb 2010 15:55:30 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201002141555.o1EFtUEx015866@svn.freebsd.org> From: Luigi Rizzo Date: Sun, 14 Feb 2010 15:55: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: r203877 - head/release/picobsd/build X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 15:55:30 -0000 Author: luigi Date: Sun Feb 14 15:55:30 2010 New Revision: 203877 URL: http://svn.freebsd.org/changeset/base/203877 Log: use log instead of logverbose in three places so the build won't need input to run to completion MFC after: 3 days Modified: head/release/picobsd/build/picobsd Modified: head/release/picobsd/build/picobsd ============================================================================== --- head/release/picobsd/build/picobsd Sun Feb 14 15:51:36 2010 (r203876) +++ head/release/picobsd/build/picobsd Sun Feb 14 15:55:30 2010 (r203877) @@ -889,7 +889,7 @@ fill_floppy_image() { if [ ${mfs_start} -gt 0 -a ${mfs_size} -ge ${imgsize} ] ; then mfs_ofs=$((${mfs_start} + 8192)) log "Preload kernel with file ${c_fs} at ${mfs_ofs}" - logverbose "`ls -l ${c_fs}` to fit in ${mfs_size}" + log "`ls -l ${c_fs}` to fit in ${mfs_size}" dd if=${c_fs} ibs=8192 iseek=1 of=kernel obs=${mfs_ofs} \ oseek=1 conv=notrunc # 2> /dev/null else @@ -944,7 +944,7 @@ fill_floppy_image() { ls -l ${c_img} ${c_label} -f `pwd`/${c_img} - logverbose "after disklabel" + log "after disklabel" ) echo "BUILDDIR ${BUILDDIR}" @@ -958,7 +958,7 @@ fill_floppy_image() { dd if=${b2} iseek=1 ibs=276 2> /dev/null | \ dd of=${BUILDDIR}/${c_img} oseek=1 obs=788 conv=notrunc 2>/dev/null - logverbose "done floppy image" + log "done disk image" # XXX (log "Fixing permissions"; cd ${dst}; chown -R root *) rm -rf ${BUILDDIR}/floppy.tree || true # cleanup # df -ik ${dst} | colrm 70 > .build.reply From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 16:26:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61EDD106566B; Sun, 14 Feb 2010 16:26: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 4E7E08FC16; Sun, 14 Feb 2010 16:26: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 o1EGQWtc022949; Sun, 14 Feb 2010 16:26:32 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EGQWcf022941; Sun, 14 Feb 2010 16:26:32 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201002141626.o1EGQWcf022941@svn.freebsd.org> From: Rui Paulo Date: Sun, 14 Feb 2010 16:26: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: r203882 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 16:26:32 -0000 Author: rpaulo Date: Sun Feb 14 16:26:32 2010 New Revision: 203882 URL: http://svn.freebsd.org/changeset/base/203882 Log: Revert part of the 9285 support because it breaks the 9280 support. I'll try to do the 9285 support without interfering with any other chipset revisions support. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.h head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c head/sys/dev/ath/ath_hal/ar5416/ar9280.c head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sun Feb 14 16:24:10 2010 (r203881) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sun Feb 14 16:26:32 2010 (r203882) @@ -352,7 +352,7 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s } ar5416AniSetup(ah); /* Anti Noise Immunity */ - ar5416InitNfHistBuff(ah, AH5416(ah)->ah_cal.nfCalHist); + ar5416InitNfHistBuff(AH5416(ah)->ah_cal.nfCalHist); HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s: return\n", __func__); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sun Feb 14 16:24:10 2010 (r203881) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sun Feb 14 16:26:32 2010 (r203882) @@ -172,53 +172,8 @@ ar5416InitCal(struct ath_hal *ah, const ichan = ath_hal_checkchannel(ah, chan); HALASSERT(ichan != AH_NULL); - if (AR_SREV_KITE_12_OR_LATER(ah)) { - OS_REG_SET_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE); - if (IEEE80211_IS_CHAN_HT20(chan)) { - OS_REG_CLR_BIT(ah, AR_PHY_CL_CAL_CTL, - AR_PHY_CL_CAL_ENABLE); - OS_REG_SET_BIT(ah, AR_PHY_CL_CAL_CTL, - AR_PHY_PARALLEL_CAL_ENABLE); - OS_REG_SET_BIT(ah, AR_PHY_TURBO, AR_PHY_FC_DYN2040_EN); - OS_REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, - AR_PHY_AGC_CONTROL_FLTR_CAL); - OS_REG_CLR_BIT(ah, AR_PHY_TPCRG1, - AR_PHY_TPCRG1_PD_CAL_ENABLE); - OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, - AR_PHY_AGC_CONTROL_CAL); - /* Poll for offset calibration complete */ - if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, - AR_PHY_AGC_CONTROL_CAL, 0)) { - HALDEBUG(ah, HAL_DEBUG_ANY, - "%s: HT offset calibration failed to " - "complete in 1ms; noisy environment?\n", - __func__); - return AH_FALSE; - } - OS_REG_CLR_BIT(ah, AR_PHY_TURBO, AR_PHY_FC_DYN2040_EN); - OS_REG_CLR_BIT(ah, AR_PHY_CL_CAL_CTL, - AR_PHY_PARALLEL_CAL_ENABLE); - } - OS_REG_CLR_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE); - OS_REG_CLR_BIT(ah, AR_PHY_ADC_CTL, AR_PHY_ADC_CTL_OFF_PWDADC); - OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, - AR_PHY_AGC_CONTROL_FLTR_CAL); - OS_REG_SET_BIT(ah, AR_PHY_TPCRG1, AR_PHY_TPCRG1_PD_CAL_ENABLE); - OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL); - /* Poll for offset calibration complete */ - if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, - AR_PHY_AGC_CONTROL_CAL, 0)) { - HALDEBUG(ah, HAL_DEBUG_ANY, - "%s: offset calibration did not complete in 1ms; " - "noisy environment?\n", __func__); - return AH_FALSE; - } - OS_REG_SET_BIT(ah, AR_PHY_ADC_CTL, AR_PHY_ADC_CTL_OFF_PWDADC); - OS_REG_CLR_BIT(ah, AR_PHY_CL_CAL_CTL, AR_PHY_CL_CAL_ENABLE); - OS_REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, - AR_PHY_AGC_CONTROL_FLTR_CAL); - } else if (AR_SREV_MERLIN_10_OR_LATER(ah)) { + if (AR_SREV_MERLIN_10_OR_LATER(ah)) { /* Enable Rx Filter Cal */ OS_REG_CLR_BIT(ah, AR_PHY_ADC_CTL, AR_PHY_ADC_CTL_OFF_PWDADC); OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, @@ -251,10 +206,9 @@ ar5416InitCal(struct ath_hal *ah, const OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL); /* Poll for offset calibration complete */ - if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, - AR_PHY_AGC_CONTROL_CAL, 0)) { + if (!ath_hal_wait(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_CAL, 0)) { HALDEBUG(ah, HAL_DEBUG_ANY, - "%s: AGC offset calibration did not complete in 1ms; " + "%s: offset calibration did not complete in 1ms; " "noisy environment?\n", __func__); return AH_FALSE; } @@ -612,15 +566,9 @@ ar5416LoadNF(struct ath_hal *ah, const s } void -ar5416InitNfHistBuff(struct ath_hal *ah, struct ar5212NfCalHist *h) +ar5416InitNfHistBuff(struct ar5212NfCalHist *h) { int i, j; - int16_t privNF; - - if (AR_SREV_KITE(ah)) - privNF = AR9285_CCA_MAX_GOOD_VALUE; - else - privNF = AR5416_CCA_MAX_GOOD_VALUE; for (i = 0; i < AR5416_NUM_NF_READINGS; i ++) { h[i].currIndex = 0; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.h Sun Feb 14 16:24:10 2010 (r203881) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.h Sun Feb 14 16:26:32 2010 (r203882) @@ -116,5 +116,5 @@ void ar5416AdcGainCalCollect(struct ath_ void ar5416AdcGainCalibration(struct ath_hal *ah, uint8_t numChains); void ar5416AdcDcCalCollect(struct ath_hal *ah); void ar5416AdcDcCalibration(struct ath_hal *ah, uint8_t numChains); -void ar5416InitNfHistBuff(struct ath_hal *ah, struct ar5212NfCalHist *h); +void ar5416InitNfHistBuff(struct ar5212NfCalHist *h); #endif /* _ATH_AR5416_CAL_H_ */ Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun Feb 14 16:24:10 2010 (r203881) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun Feb 14 16:26:32 2010 (r203882) @@ -23,7 +23,6 @@ #include "ah_devid.h" #include "ah_eeprom_v14.h" -#include "ah_eeprom_v4k.h" #include "ar5416/ar5416.h" #include "ar5416/ar5416reg.h" @@ -60,17 +59,15 @@ static void ar5416InitPLL(struct ath_hal static HAL_BOOL ar5416SetBoardValues(struct ath_hal *, const struct ieee80211_channel *); static HAL_BOOL ar5416SetPowerPerRateTable(struct ath_hal *ah, struct ar5416eeprom *pEepData, - struct ar5416eeprom_4k *pEepData4k, const struct ieee80211_channel *chan, int16_t *ratesArray, uint16_t cfgCtl, uint16_t AntennaReduction, uint16_t twiceMaxRegulatoryPower, uint16_t powerLimit); static HAL_BOOL ar5416SetPowerCalTable(struct ath_hal *ah, struct ar5416eeprom *pEepData, - struct ar5416eeprom_4k *pEepData4k, const struct ieee80211_channel *chan, int16_t *pTxPowerIndexOffset); -static uint16_t ar5416GetMaxEdgePower(struct ath_hal *ah, uint16_t freq, +static uint16_t ar5416GetMaxEdgePower(uint16_t freq, CAL_CTL_EDGES *pRdEdgesPower, HAL_BOOL is2GHz); static void ar5416GetTargetPowers(struct ath_hal *ah, const struct ieee80211_channel *chan, CAL_TARGET_POWER_HT *powInfo, @@ -86,7 +83,6 @@ static int16_t interpolate(uint16_t targ static void ar5416Set11nRegs(struct ath_hal *ah, const struct ieee80211_channel *chan); static void ar5416GetGainBoundariesAndPdadcs(struct ath_hal *ah, const struct ieee80211_channel *chan, CAL_DATA_PER_FREQ *pRawDataSet, - CAL_DATA_PER_FREQ_4K *pRawDataSet4k, uint8_t * bChans, uint16_t availPiers, uint16_t tPdGainOverlap, int16_t *pMinCalPower, uint16_t * pPdGainBoundaries, uint8_t * pPDADCValues, @@ -481,12 +477,7 @@ ar5416InitDMA(struct ath_hal *ah) * reduce the number of usable entries in PCU TXBUF to avoid * wrap around. */ - if (AR_SREV_KITE(ah)) - OS_REG_WRITE(ah, AR_PCU_TXBUF_CTRL, - AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE); - else - OS_REG_WRITE(ah, AR_PCU_TXBUF_CTRL, - AR_PCU_TXBUF_CTRL_USABLE_SIZE); + OS_REG_WRITE(ah, AR_PCU_TXBUF_CTRL, AR_PCU_TXBUF_CTRL_USABLE_SIZE); } static void @@ -810,7 +801,6 @@ ar5416SetTransmitPower(struct ath_hal *a #define N(a) (sizeof (a) / sizeof (a[0])) MODAL_EEP_HEADER *pModal; - MODAL_EEP4K_HEADER *pModal4k; struct ath_hal_5212 *ahp = AH5212(ah); int16_t ratesArray[Ar5416RateSize]; int16_t txPowerIndexOffset = 0; @@ -822,10 +812,8 @@ ar5416SetTransmitPower(struct ath_hal *a uint16_t twiceAntennaReduction; uint16_t twiceMaxRegulatoryPower; int16_t maxPower; - HAL_EEPROM_v14 *ee; - HAL_EEPROM_v4k *ee4k; - struct ar5416eeprom *pEepData; - struct ar5416eeprom_4k *pEepData4k; + HAL_EEPROM_v14 *ee = AH_PRIVATE(ah)->ah_eeprom; + struct ar5416eeprom *pEepData = &ee->ee_base; HALASSERT(AH_PRIVATE(ah)->ah_eeversion >= AR_EEPROM_VER14_1); @@ -835,32 +823,15 @@ ar5416SetTransmitPower(struct ath_hal *a powerLimit = chan->ic_maxregpower * 2; twiceAntennaReduction = chan->ic_maxantgain; twiceMaxRegulatoryPower = AH_MIN(MAX_RATE_POWER, AH_PRIVATE(ah)->ah_powerLimit); - if (AR_SREV_KITE(ah)) { - ee4k = AH_PRIVATE(ah)->ah_eeprom; - pEepData4k = &ee4k->ee_base; - pModal4k = &pEepData4k->modalHeader; - ee = NULL; - pEepData = NULL; - pModal = NULL; - } else { - ee = AH_PRIVATE(ah)->ah_eeprom; - pEepData = &ee->ee_base; - pModal = &pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)]; - ee4k = NULL; - pEepData4k = NULL; - pModal4k = NULL; - } + pModal = &pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)]; HALDEBUG(ah, HAL_DEBUG_RESET, "%s Channel=%u CfgCtl=%u\n", __func__,chan->ic_freq, cfgCtl ); if (IS_EEP_MINOR_V2(ah)) { - if (pModal) - ht40PowerIncForPdadc = pModal->ht40PowerIncForPdadc; - else - ht40PowerIncForPdadc = pModal4k->ht40PowerIncForPdadc; + ht40PowerIncForPdadc = pModal->ht40PowerIncForPdadc; } - - if (!ar5416SetPowerPerRateTable(ah, pEepData, pEepData4k, chan, + + if (!ar5416SetPowerPerRateTable(ah, pEepData, chan, &ratesArray[0],cfgCtl, twiceAntennaReduction, twiceMaxRegulatoryPower, powerLimit)) { @@ -869,8 +840,7 @@ ar5416SetTransmitPower(struct ath_hal *a return AH_FALSE; } - if (!ar5416SetPowerCalTable(ah, pEepData, pEepData4k, chan, - &txPowerIndexOffset)) { + if (!ar5416SetPowerCalTable(ah, pEepData, chan, &txPowerIndexOffset)) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unable to set power table\n", __func__); return AH_FALSE; @@ -898,8 +868,6 @@ ar5416SetTransmitPower(struct ath_hal *a ratesArray[i] = (int16_t)(txPowerIndexOffset + ratesArray[i]); if (ratesArray[i] > AR5416_MAX_RATE_POWER) ratesArray[i] = AR5416_MAX_RATE_POWER; - if (AR_SREV_MERLIN_10_OR_LATER(ah)) - ratesArray[i] -= AR5416_PWR_TABLE_OFFSET_DB * 2; } #ifdef AH_EEPROM_DUMP @@ -979,11 +947,10 @@ ar5416SetTransmitPower(struct ath_hal *a } /* Write the Power subtraction for dynamic chain changing, for per-packet powertx */ - if (pModal) - OS_REG_WRITE(ah, AR_PHY_POWER_TX_SUB, - POW_SM(pModal->pwrDecreaseFor3Chain, 6) - | POW_SM(pModal->pwrDecreaseFor2Chain, 0) - ); + OS_REG_WRITE(ah, AR_PHY_POWER_TX_SUB, + POW_SM(pModal->pwrDecreaseFor3Chain, 6) + | POW_SM(pModal->pwrDecreaseFor2Chain, 0) + ); return AH_TRUE; #undef POW_SM #undef N @@ -1221,43 +1188,24 @@ ar5416InitPLL(struct ath_hal *ah, const static HAL_BOOL ar5416SetBoardValues(struct ath_hal *ah, const struct ieee80211_channel *chan) { - const HAL_EEPROM_v14 *ee; - const HAL_EEPROM_v4k *ee4k; - const struct ar5416eeprom *eep; - const struct ar5416eeprom_4k *eep4k; + const HAL_EEPROM_v14 *ee = AH_PRIVATE(ah)->ah_eeprom; + const struct ar5416eeprom *eep = &ee->ee_base; const MODAL_EEP_HEADER *pModal; - const MODAL_EEP4K_HEADER *pModal4k; - int i, regChainOffset = 0; + int i, regChainOffset; uint8_t txRxAttenLocal; /* workaround for eeprom versions <= 14.2 */ HALASSERT(AH_PRIVATE(ah)->ah_eeversion >= AR_EEPROM_VER14_1); - - if (AR_SREV_KITE(ah)) { - ee4k = AH_PRIVATE(ah)->ah_eeprom; - eep4k = &ee4k->ee_base; - pModal4k = &eep4k->modalHeader; - ee = NULL; - eep = NULL; - pModal = NULL; - } else { - ee = AH_PRIVATE(ah)->ah_eeprom; - eep = &ee->ee_base; - pModal = &eep->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)]; - ee4k = NULL; - eep4k = NULL; - pModal4k = NULL; - } + pModal = &eep->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)]; /* NB: workaround for eeprom versions <= 14.2 */ txRxAttenLocal = IEEE80211_IS_CHAN_2GHZ(chan) ? 23 : 44; - OS_REG_WRITE(ah, AR_PHY_SWITCH_COM, - (pModal) ? pModal->antCtrlCommon : - pModal4k->antCtrlCommon); + OS_REG_WRITE(ah, AR_PHY_SWITCH_COM, pModal->antCtrlCommon); for (i = 0; i < AR5416_MAX_CHAINS; i++) { -// if (AR_SREV_KITE(ah) && i >= 2) break; - if (AR_SREV_MERLIN(ah) && i >= 2) break; - if (AR_SREV_OWL_20_OR_LATER(ah) && + if (AR_SREV_MERLIN(ah)) { + if (i >= 2) break; + } + if (AR_SREV_OWL_20_OR_LATER(ah) && (AH5416(ah)->ah_rx_chainmask == 0x5 || AH5416(ah)->ah_tx_chainmask == 0x5) && i != 0) { /* Regs are swapped from chain 2 to 1 for 5416 2_0 with @@ -1268,15 +1216,12 @@ ar5416SetBoardValues(struct ath_hal *ah, regChainOffset = i * 0x1000; } - OS_REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0 + regChainOffset, - (pModal) ? pModal->antCtrlChain[i] : pModal4k->antCtrlChain[i]); + OS_REG_WRITE(ah, AR_PHY_SWITCH_CHAIN_0 + regChainOffset, pModal->antCtrlChain[i]); OS_REG_WRITE(ah, AR_PHY_TIMING_CTRL4 + regChainOffset, (OS_REG_READ(ah, AR_PHY_TIMING_CTRL4 + regChainOffset) & ~(AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF | AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF)) | - SM((pModal) ? pModal->iqCalICh[i] : pModal4k->iqCalICh[i], - AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | - SM((pModal) ? pModal->iqCalQCh[i] : pModal4k->iqCalQCh[i], - AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); + SM(pModal->iqCalICh[i], AR_PHY_TIMING_CTRL4_IQCORR_Q_I_COFF) | + SM(pModal->iqCalQCh[i], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); /* * Large signal upgrade. @@ -1284,82 +1229,54 @@ ar5416SetBoardValues(struct ath_hal *ah, */ if ((i == 0) || AR_SREV_OWL_20_OR_LATER(ah)) { - int txRxAtten; - if (IS_EEP_MINOR_V3(ah)) { - if (pModal) txRxAtten = pModal->txRxAttenCh[i]; - else txRxAtten = pModal4k->txRxAttenCh[i]; - } else - txRxAtten = txRxAttenLocal; - - if (AR_SREV_MERLIN_10_OR_LATER(ah)) { - OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + regChainOffset, - AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAtten); - OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + regChainOffset, - AR9280_PHY_RXGAIN_TXRX_MARGIN, - (pModal) ? pModal->rxTxMarginCh[i] : pModal4k->rxTxMarginCh[i]); - } else { - OS_REG_WRITE(ah, AR_PHY_RXGAIN + regChainOffset, - (OS_REG_READ(ah, AR_PHY_RXGAIN + regChainOffset) & ~AR_PHY_RXGAIN_TXRX_ATTEN) | - SM(txRxAtten, AR_PHY_RXGAIN_TXRX_ATTEN)); - - OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, - (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & ~AR_PHY_GAIN_2GHZ_RXTX_MARGIN) | - SM((pModal) ? pModal->rxTxMarginCh[i]: - pModal4k->rxTxMarginCh[i], - AR_PHY_GAIN_2GHZ_RXTX_MARGIN)); - } + OS_REG_WRITE(ah, AR_PHY_RXGAIN + regChainOffset, + (OS_REG_READ(ah, AR_PHY_RXGAIN + regChainOffset) & ~AR_PHY_RXGAIN_TXRX_ATTEN) | + SM(IS_EEP_MINOR_V3(ah) ? pModal->txRxAttenCh[i] : txRxAttenLocal, + AR_PHY_RXGAIN_TXRX_ATTEN)); + + OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + regChainOffset, + (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + regChainOffset) & ~AR_PHY_GAIN_2GHZ_RXTX_MARGIN) | + SM(pModal->rxTxMarginCh[i], AR_PHY_GAIN_2GHZ_RXTX_MARGIN)); } } - OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, - (pModal) ? pModal->switchSettling : pModal4k->switchSettling); - OS_REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_ADC, - (pModal) ? pModal->adcDesiredSize : pModal4k->adcDesiredSize); - OS_REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_PGA, - (pModal) ? pModal->pgaDesiredSize : pModal4k->pgaDesiredSize); + OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, pModal->switchSettling); + OS_REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_ADC, pModal->adcDesiredSize); + OS_REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_PGA, pModal->pgaDesiredSize); OS_REG_WRITE(ah, AR_PHY_RF_CTL4, - SM((pModal) ? pModal->txEndToXpaOff : pModal4k->txEndToXpaOff, - AR_PHY_RF_CTL4_TX_END_XPAA_OFF) - | SM((pModal) ? pModal->txEndToXpaOff : pModal4k->txEndToXpaOff, - AR_PHY_RF_CTL4_TX_END_XPAB_OFF) - | SM((pModal) ? pModal->txFrameToXpaOn : pModal4k->txFrameToXpaOn, - AR_PHY_RF_CTL4_FRAME_XPAA_ON) - | SM((pModal) ? pModal->txFrameToXpaOn : pModal4k->txFrameToXpaOn, - AR_PHY_RF_CTL4_FRAME_XPAB_ON)); + SM(pModal->txEndToXpaOff, AR_PHY_RF_CTL4_TX_END_XPAA_OFF) + | SM(pModal->txEndToXpaOff, AR_PHY_RF_CTL4_TX_END_XPAB_OFF) + | SM(pModal->txFrameToXpaOn, AR_PHY_RF_CTL4_FRAME_XPAA_ON) + | SM(pModal->txFrameToXpaOn, AR_PHY_RF_CTL4_FRAME_XPAB_ON)); - OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL3, AR_PHY_TX_END_TO_A2_RX_ON, - (pModal) ? pModal->txEndToRxOn : pModal4k->txEndToRxOn); + OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL3, AR_PHY_TX_END_TO_A2_RX_ON, pModal->txEndToRxOn); if (AR_SREV_MERLIN_10_OR_LATER(ah)) { OS_REG_RMW_FIELD(ah, AR_PHY_CCA, AR9280_PHY_CCA_THRESH62, - (pModal) ? pModal->thresh62 : pModal4k->thresh62); + pModal->thresh62); OS_REG_RMW_FIELD(ah, AR_PHY_EXT_CCA0, AR_PHY_EXT_CCA0_THRESH62, - (pModal) ? pModal->thresh62 : pModal4k->thresh62); + pModal->thresh62); } else { OS_REG_RMW_FIELD(ah, AR_PHY_CCA, AR_PHY_CCA_THRESH62, - (pModal) ? pModal->thresh62 : pModal4k->thresh62); + pModal->thresh62); OS_REG_RMW_FIELD(ah, AR_PHY_EXT_CCA0, AR_PHY_EXT_CCA_THRESH62, - (pModal) ? pModal->thresh62 : pModal4k->thresh62); + pModal->thresh62); } /* Minor Version Specific application */ if (IS_EEP_MINOR_V2(ah)) { - OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, AR_PHY_TX_FRAME_TO_DATA_START, - (pModal) ? pModal->txFrameToDataStart : pModal4k->txFrameToDataStart); - OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, AR_PHY_TX_FRAME_TO_PA_ON, - (pModal) ? pModal->txFrameToPaOn : pModal4k->txFrameToPaOn); + OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, AR_PHY_TX_FRAME_TO_DATA_START, pModal->txFrameToDataStart); + OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, AR_PHY_TX_FRAME_TO_PA_ON, pModal->txFrameToPaOn); } if (IS_EEP_MINOR_V3(ah)) { if (IEEE80211_IS_CHAN_HT40(chan)) { /* Overwrite switch settling with HT40 value */ - OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, - (pModal) ? pModal->swSettleHt40 : pModal4k->swSettleHt40); + OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, pModal->swSettleHt40); } if ((AR_SREV_OWL_20_OR_LATER(ah)) && ( AH5416(ah)->ah_rx_chainmask == 0x5 || AH5416(ah)->ah_tx_chainmask == 0x5)){ - /* NB: no v4k EEPROM */ /* Reg Offsets are swapped for logical mapping */ OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x1000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x1000) & ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) | SM(pModal->bswMargin[2], AR_PHY_GAIN_2GHZ_BSW_MARGIN)); @@ -1370,38 +1287,17 @@ ar5416SetBoardValues(struct ath_hal *ah, OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x2000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x2000) & ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) | SM(pModal->bswAtten[1], AR_PHY_GAIN_2GHZ_BSW_ATTEN)); } else { - if (AR_SREV_MERLIN_10_OR_LATER(ah)) { - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, - AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN, - (pModal) ? pModal->bswMargin[i] : pModal4k->bswMargin[i]); - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, - AR_PHY_GAIN_2GHZ_XATTEN1_DB, - (pModal) ? pModal->bswAtten[i] : pModal4k->bswAtten[i]); - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, - AR_PHY_GAIN_2GHZ_XATTEN2_MARGIN, - (pModal) ? pModal->xatten2Margin[i] : pModal4k->xatten2Margin[i]); - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, - AR_PHY_GAIN_2GHZ_XATTEN2_DB, - (pModal) ? pModal->xatten2Db[i] : pModal4k->xatten2Db[i]); - } else { OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x1000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x1000) & ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) | - SM((pModal) ? pModal->bswMargin[1] : - pModal4k->bswMargin[1], AR_PHY_GAIN_2GHZ_BSW_MARGIN)); + SM(pModal->bswMargin[1], AR_PHY_GAIN_2GHZ_BSW_MARGIN)); OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x1000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x1000) & ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) | - SM((pModal) ? pModal->bswAtten[1] : - pModal4k->bswAtten[1], AR_PHY_GAIN_2GHZ_BSW_ATTEN)); + SM(pModal->bswAtten[1], AR_PHY_GAIN_2GHZ_BSW_ATTEN)); OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x2000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x2000) & ~AR_PHY_GAIN_2GHZ_BSW_MARGIN) | - SM((pModal) ? pModal->bswMargin[2] : - pModal4k->bswMargin[2], AR_PHY_GAIN_2GHZ_BSW_MARGIN)); + SM(pModal->bswMargin[2],AR_PHY_GAIN_2GHZ_BSW_MARGIN)); OS_REG_WRITE(ah, AR_PHY_GAIN_2GHZ + 0x2000, (OS_REG_READ(ah, AR_PHY_GAIN_2GHZ + 0x2000) & ~AR_PHY_GAIN_2GHZ_BSW_ATTEN) | - SM((pModal) ? pModal->bswAtten[2] : - pModal4k->bswAtten[2], AR_PHY_GAIN_2GHZ_BSW_ATTEN)); - } - } - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_BSW_MARGIN, - (pModal) ? pModal->bswMargin[0] : pModal4k->bswMargin[0]); - OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_BSW_ATTEN, - (pModal) ? pModal->bswAtten[0] : pModal4k->bswAtten[0]); + SM(pModal->bswAtten[2], AR_PHY_GAIN_2GHZ_BSW_ATTEN)); + } + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_BSW_MARGIN, pModal->bswMargin[0]); + OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ, AR_PHY_GAIN_2GHZ_BSW_ATTEN, pModal->bswAtten[0]); } return AH_TRUE; } @@ -1416,9 +1312,8 @@ ar5416SetBoardValues(struct ath_hal *ah, * Sets the transmit power in the baseband for the given * operating channel and mode. */ -HAL_BOOL +static HAL_BOOL ar5416SetPowerPerRateTable(struct ath_hal *ah, struct ar5416eeprom *pEepData, - struct ar5416eeprom_4k *pEepData4k, const struct ieee80211_channel *chan, int16_t *ratesArray, uint16_t cfgCtl, uint16_t AntennaReduction, @@ -1436,7 +1331,6 @@ ar5416SetPowerPerRateTable(struct ath_ha int i; int16_t twiceLargestAntenna; CAL_CTL_DATA *rep; - CAL_CTL_DATA_4K *rep4k; CAL_TARGET_POWER_LEG targetPowerOfdm, targetPowerCck = {0, {0, 0, 0, 0}}; CAL_TARGET_POWER_LEG targetPowerOfdmExt = {0, {0, 0, 0, 0}}, targetPowerCckExt = {0, {0, 0, 0, 0}}; CAL_TARGET_POWER_HT targetPowerHt20, targetPowerHt40 = {0, {0, 0, 0, 0}}; @@ -1453,19 +1347,15 @@ ar5416SetPowerPerRateTable(struct ath_ha const uint16_t *pCtlMode; uint16_t numCtlModes, ctlMode, freq; CHAN_CENTERS centers; - int n2gcck, n2g20, n2g40, numctls; ar5416GetChannelCenters(ah, chan, ¢ers); /* Compute TxPower reduction due to Antenna Gain */ - if (pEepData) - twiceLargestAntenna = AH_MAX(AH_MAX( - pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].antennaGainCh[0], - pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].antennaGainCh[1]), - pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].antennaGainCh[2]); - else - twiceLargestAntenna = pEepData4k->modalHeader.antennaGainCh[0]; + twiceLargestAntenna = AH_MAX(AH_MAX( + pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].antennaGainCh[0], + pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].antennaGainCh[1]), + pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].antennaGainCh[2]); #if 0 /* Turn it back on if we need to calculate per chain antenna gain reduction */ /* Use only if the expected gain > 6dbi */ @@ -1500,12 +1390,10 @@ ar5416SetPowerPerRateTable(struct ath_ha case 1: break; case 2: - if (pEepData) - scaledPower -= pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].pwrDecreaseFor2Chain; + scaledPower -= pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].pwrDecreaseFor2Chain; break; case 3: - if (pEepData) - scaledPower -= pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].pwrDecreaseFor3Chain; + scaledPower -= pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].pwrDecreaseFor3Chain; break; default: return AH_FALSE; /* Unsupported number of chains */ @@ -1513,56 +1401,36 @@ ar5416SetPowerPerRateTable(struct ath_ha scaledPower = AH_MAX(0, scaledPower); - n2gcck = (pEepData) ? AR5416_NUM_2G_CCK_TARGET_POWERS : - AR5416_4K_NUM_2G_CCK_TARGET_POWERS; - n2g20 = (pEepData) ? AR5416_NUM_2G_20_TARGET_POWERS : - AR5416_4K_NUM_2G_20_TARGET_POWERS; - n2g40 = (pEepData) ? AR5416_NUM_2G_40_TARGET_POWERS : - AR5416_4K_NUM_2G_40_TARGET_POWERS; - /* Get target powers from EEPROM - our baseline for TX Power */ if (IEEE80211_IS_CHAN_2GHZ(chan)) { /* Setup for CTL modes */ numCtlModes = N(ctlModesFor11g) - SUB_NUM_CTL_MODES_AT_2G_40; /* CTL_11B, CTL_11G, CTL_2GHT20 */ pCtlMode = ctlModesFor11g; - ar5416GetTargetPowersLeg(ah, chan, - (pEepData) ? pEepData->calTargetPowerCck : - pEepData4k->calTargetPowerCck, - n2gcck, &targetPowerCck, 4, AH_FALSE); - ar5416GetTargetPowersLeg(ah, chan, - (pEepData) ? pEepData->calTargetPower2G : - pEepData4k->calTargetPower2G, - n2g20, &targetPowerOfdm, 4, AH_FALSE); - ar5416GetTargetPowers(ah, chan, - (pEepData) ? pEepData->calTargetPower2GHT20 : - pEepData4k->calTargetPower2GHT20, - n2g20, &targetPowerHt20, 8, AH_FALSE); + ar5416GetTargetPowersLeg(ah, chan, pEepData->calTargetPowerCck, + AR5416_NUM_2G_CCK_TARGET_POWERS, &targetPowerCck, 4, AH_FALSE); + ar5416GetTargetPowersLeg(ah, chan, pEepData->calTargetPower2G, + AR5416_NUM_2G_20_TARGET_POWERS, &targetPowerOfdm, 4, AH_FALSE); + ar5416GetTargetPowers(ah, chan, pEepData->calTargetPower2GHT20, + AR5416_NUM_2G_20_TARGET_POWERS, &targetPowerHt20, 8, AH_FALSE); if (IEEE80211_IS_CHAN_HT40(chan)) { numCtlModes = N(ctlModesFor11g); /* All 2G CTL's */ - ar5416GetTargetPowers(ah, chan, - (pEepData) ? pEepData->calTargetPower2GHT40 : - pEepData4k->calTargetPower2GHT40, - n2g40, &targetPowerHt40, 8, AH_TRUE); + ar5416GetTargetPowers(ah, chan, pEepData->calTargetPower2GHT40, + AR5416_NUM_2G_40_TARGET_POWERS, &targetPowerHt40, 8, AH_TRUE); /* Get target powers for extension channels */ - ar5416GetTargetPowersLeg(ah, chan, - (pEepData) ? pEepData->calTargetPowerCck : - pEepData4k->calTargetPowerCck, - n2gcck, &targetPowerCckExt, 4, AH_TRUE); - ar5416GetTargetPowersLeg(ah, chan, - (pEepData) ? pEepData->calTargetPower2G : - pEepData4k->calTargetPower2G, - n2g20, &targetPowerOfdmExt, 4, AH_TRUE); + ar5416GetTargetPowersLeg(ah, chan, pEepData->calTargetPowerCck, + AR5416_NUM_2G_CCK_TARGET_POWERS, &targetPowerCckExt, 4, AH_TRUE); + ar5416GetTargetPowersLeg(ah, chan, pEepData->calTargetPower2G, + AR5416_NUM_2G_20_TARGET_POWERS, &targetPowerOfdmExt, 4, AH_TRUE); } } else { /* Setup for CTL modes */ numCtlModes = N(ctlModesFor11a) - SUB_NUM_CTL_MODES_AT_5G_40; /* CTL_11A, CTL_5GHT20 */ pCtlMode = ctlModesFor11a; - /* NB: v4k EEPROM has no 5Ghz info */ - ar5416GetTargetPowersLeg(ah, chan, pEepData->calTargetPower5G, + ar5416GetTargetPowersLeg(ah, chan, pEepData->calTargetPower5G, AR5416_NUM_5G_20_TARGET_POWERS, &targetPowerOfdm, 4, AH_FALSE); ar5416GetTargetPowers(ah, chan, pEepData->calTargetPower5GHT20, AR5416_NUM_5G_20_TARGET_POWERS, &targetPowerHt20, 8, AH_FALSE); @@ -1586,9 +1454,7 @@ ar5416SetPowerPerRateTable(struct ath_ha * The ctl value is encoded as [7:4] == test group, [3:0] == test mode. * */ - numctls = (pEepData) ? AR5416_NUM_CTLS : AR5416_4K_NUM_CTLS; for (ctlMode = 0; ctlMode < numCtlModes; ctlMode++) { - int ctlIndex; HAL_BOOL isHt40CtlMode = (pCtlMode[ctlMode] == CTL_5GHT40) || (pCtlMode[ctlMode] == CTL_2GHT40); if (isHt40CtlMode) { @@ -1600,33 +1466,17 @@ ar5416SetPowerPerRateTable(struct ath_ha } /* walk through each CTL index stored in EEPROM */ - for (i = 0; i < numctls; i++) { + for (i = 0; (i < AR5416_NUM_CTLS) && pEepData->ctlIndex[i]; i++) { uint16_t twiceMinEdgePower; - CAL_CTL_EDGES *ctlEdge; - - ctlIndex = (pEepData) ? pEepData->ctlIndex[i] : - pEepData4k->ctlIndex[i]; - if (!ctlIndex) - break; /* compare test group from regulatory channel list with test mode from pCtlMode list */ - if ((((cfgCtl & ~CTL_MODE_M) | (pCtlMode[ctlMode] & CTL_MODE_M)) == ctlIndex) || + if ((((cfgCtl & ~CTL_MODE_M) | (pCtlMode[ctlMode] & CTL_MODE_M)) == pEepData->ctlIndex[i]) || (((cfgCtl & ~CTL_MODE_M) | (pCtlMode[ctlMode] & CTL_MODE_M)) == - ((ctlIndex & CTL_MODE_M) | SD_NO_CTL))) { - if (pEepData) { - rep = &(pEepData->ctlData[i]); - ctlEdge = rep->ctlEdges[ - owl_get_ntxchains( - AH5416(ah)->ah_tx_chainmask) - 1]; - } else { - rep4k = &(pEepData4k->ctlData[i]); - ctlEdge = rep4k->ctlEdges[ - owl_get_ntxchains( - AH5416(ah)->ah_tx_chainmask) - 1]; - } - twiceMinEdgePower = ar5416GetMaxEdgePower(ah, - freq, ctlEdge, - IEEE80211_IS_CHAN_2GHZ(chan)); + ((pEepData->ctlIndex[i] & CTL_MODE_M) | SD_NO_CTL))) { + rep = &(pEepData->ctlData[i]); + twiceMinEdgePower = ar5416GetMaxEdgePower(freq, + rep->ctlEdges[owl_get_ntxchains(AH5416(ah)->ah_tx_chainmask) - 1], + IEEE80211_IS_CHAN_2GHZ(chan)); if ((cfgCtl & ~CTL_MODE_M) == SD_NO_CTL) { /* Find the minimum of all CTL edge powers that apply to this channel */ twiceMaxEdgePower = AH_MIN(twiceMaxEdgePower, twiceMinEdgePower); @@ -1740,19 +1590,13 @@ fbin2freq(uint8_t fbin, HAL_BOOL is2GHz) * Find the maximum conformance test limit for the given channel and CTL info */ static uint16_t -ar5416GetMaxEdgePower(struct ath_hal *ah, - uint16_t freq, CAL_CTL_EDGES *pRdEdgesPower, HAL_BOOL is2GHz) +ar5416GetMaxEdgePower(uint16_t freq, CAL_CTL_EDGES *pRdEdgesPower, HAL_BOOL is2GHz) { uint16_t twiceMaxEdgePower = AR5416_MAX_RATE_POWER; - int i, numBand; - - if (AR_SREV_KITE(ah)) - numBand = AR5416_4K_NUM_BAND_EDGES; - else - numBand = AR5416_NUM_BAND_EDGES; + int i; /* Get the edge power */ - for (i = 0; (i < numBand) && (pRdEdgesPower[i].bChannel != AR5416_BCHAN_UNUSED) ; i++) { + for (i = 0; (i < AR5416_NUM_BAND_EDGES) && (pRdEdgesPower[i].bChannel != AR5416_BCHAN_UNUSED) ; i++) { /* * If there's an exact channel match or an inband flag set * on the lower channel use the given rdEdgePower @@ -1899,13 +1743,11 @@ ar5416GetTargetPowersLeg(struct ath_hal * points as well as from the nearest pier(s) to get a power detector * linear voltage to power level table. */ -HAL_BOOL +static HAL_BOOL ar5416SetPowerCalTable(struct ath_hal *ah, struct ar5416eeprom *pEepData, - struct ar5416eeprom_4k *pEepData4k, const struct ieee80211_channel *chan, int16_t *pTxPowerIndexOffset) { - CAL_DATA_PER_FREQ *pRawDataset = NULL; - CAL_DATA_PER_FREQ_4K *pRawDataset4k = NULL; + CAL_DATA_PER_FREQ *pRawDataset; uint8_t *pCalBChans = AH_NULL; uint16_t pdGainOverlap_t2; static uint8_t pdadcValues[AR5416_NUM_PDADC_VALUES]; @@ -1918,28 +1760,17 @@ ar5416SetPowerCalTable(struct ath_hal *a OS_MEMZERO(xpdGainValues, sizeof(xpdGainValues)); - if (pEepData) - xpdMask = pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].xpdGain; - else - xpdMask = pEepData4k->modalHeader.xpdGain; + xpdMask = pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].xpdGain; if (IS_EEP_MINOR_V2(ah)) { - if (pEepData) - pdGainOverlap_t2 = pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].pdGainOverlap; - else - pdGainOverlap_t2 = pEepData4k->modalHeader.pdGainOverlap; + pdGainOverlap_t2 = pEepData->modalHeader[IEEE80211_IS_CHAN_2GHZ(chan)].pdGainOverlap; } else { pdGainOverlap_t2 = (uint16_t)(MS(OS_REG_READ(ah, AR_PHY_TPCRG5), AR_PHY_TPCRG5_PD_GAIN_OVERLAP)); } if (IEEE80211_IS_CHAN_2GHZ(chan)) { - if (pEepData) { - pCalBChans = pEepData->calFreqPier2G; - numPiers = AR5416_NUM_2G_CAL_PIERS; - } else { - pCalBChans = pEepData4k->calFreqPier2G; - numPiers = AR5416_4K_NUM_2G_CAL_PIERS; - } + pCalBChans = pEepData->calFreqPier2G; + numPiers = AR5416_NUM_2G_CAL_PIERS; } else { pCalBChans = pEepData->calFreqPier5G; numPiers = AR5416_NUM_5G_CAL_PIERS; @@ -1965,7 +1796,7 @@ ar5416SetPowerCalTable(struct ath_hal *a SM(xpdGainValues[1], AR_PHY_TPCRG1_PD_GAIN_2) | SM(xpdGainValues[2], AR_PHY_TPCRG1_PD_GAIN_3)); for (i = 0; i < AR5416_MAX_CHAINS; i++) { -// if (AR_SREV_KITE(ah) && i >= AR5416_4K_MAX_CHAINS) break; + if (AR_SREV_OWL_20_OR_LATER(ah) && ( AH5416(ah)->ah_rx_chainmask == 0x5 || AH5416(ah)->ah_tx_chainmask == 0x5) && (i != 0)) { /* Regs are swapped from chain 2 to 1 for 5416 2_0 with @@ -1976,22 +1807,14 @@ ar5416SetPowerCalTable(struct ath_hal *a regChainOffset = i * 0x1000; } - int txMask; - txMask = (pEepData) ? pEepData->baseEepHeader.txMask : - pEepData4k->baseEepHeader.txMask; - - if (txMask & (1 << i)) { + if (pEepData->baseEepHeader.txMask & (1 << i)) { if (IEEE80211_IS_CHAN_2GHZ(chan)) { - if (pEepData) - pRawDataset = pEepData->calPierData2G[i]; - else - pRawDataset4k = pEepData4k->calPierData2G[i]; + pRawDataset = pEepData->calPierData2G[i]; } else { pRawDataset = pEepData->calPierData5G[i]; } - ar5416GetGainBoundariesAndPdadcs(ah, chan, pRawDataset, - pRawDataset4k, + ar5416GetGainBoundariesAndPdadcs(ah, chan, pRawDataset, pCalBChans, numPiers, pdGainOverlap_t2, &tMinCalPower, gainBoundaries, @@ -2003,6 +1826,7 @@ ar5416SetPowerCalTable(struct ath_hal *a * negative or greater than 0. Need to offset the power * values by the amount of minPower for griffin */ + OS_REG_WRITE(ah, AR_PHY_TPCRG5 + regChainOffset, SM(pdGainOverlap_t2, AR_PHY_TPCRG5_PD_GAIN_OVERLAP) | SM(gainBoundaries[0], AR_PHY_TPCRG5_PD_GAIN_BOUNDARY_1) | @@ -2048,10 +1872,8 @@ static void ar5416GetGainBoundariesAndPdadcs(struct ath_hal *ah, const struct ieee80211_channel *chan, CAL_DATA_PER_FREQ *pRawDataSet, - CAL_DATA_PER_FREQ_4K *pRawDataSet4k, uint8_t * bChans, uint16_t availPiers, - uint16_t tPdGainOverlap, int16_t *pMinCalPower, - uint16_t * pPdGainBoundaries, + uint16_t tPdGainOverlap, int16_t *pMinCalPower, uint16_t * pPdGainBoundaries, uint8_t * pPDADCValues, uint16_t numXpdGains) { @@ -2094,35 +1916,17 @@ ar5416GetGainBoundariesAndPdadcs(struct if (match) { /* Directly fill both vpd tables from the matching index */ for (i = 0; i < numXpdGains; i++) { - if (pRawDataSet) { - minPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][0]; - maxPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][4]; - ar5416FillVpdTable(minPwrT4[i], maxPwrT4[i], - pRawDataSet[idxL].pwrPdg[i], - pRawDataSet[idxL].vpdPdg[i], - AR5416_PD_GAIN_ICEPTS, vpdTableI[i]); - } else { - minPwrT4[i] = pRawDataSet4k[idxL].pwrPdg[i][0]; - maxPwrT4[i] = pRawDataSet4k[idxL].pwrPdg[i][4]; - ar5416FillVpdTable(minPwrT4[i], maxPwrT4[i], - pRawDataSet4k[idxL].pwrPdg[i], - pRawDataSet4k[idxL].vpdPdg[i], - AR5416_PD_GAIN_ICEPTS, vpdTableI[i]); - } + minPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][0]; + maxPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][4]; + ar5416FillVpdTable(minPwrT4[i], maxPwrT4[i], pRawDataSet[idxL].pwrPdg[i], + pRawDataSet[idxL].vpdPdg[i], AR5416_PD_GAIN_ICEPTS, vpdTableI[i]); } } else { for (i = 0; i < numXpdGains; i++) { - if (pRawDataSet) { - pVpdL = pRawDataSet[idxL].vpdPdg[i]; - pPwrL = pRawDataSet[idxL].pwrPdg[i]; - pVpdR = pRawDataSet[idxR].vpdPdg[i]; - pPwrR = pRawDataSet[idxR].pwrPdg[i]; - } else { - pVpdL = pRawDataSet4k[idxL].vpdPdg[i]; - pPwrL = pRawDataSet4k[idxL].pwrPdg[i]; - pVpdR = pRawDataSet4k[idxR].vpdPdg[i]; - pPwrR = pRawDataSet4k[idxR].pwrPdg[i]; - } + pVpdL = pRawDataSet[idxL].vpdPdg[i]; + pPwrL = pRawDataSet[idxL].pwrPdg[i]; + pVpdR = pRawDataSet[idxR].vpdPdg[i]; + pPwrR = pRawDataSet[idxR].pwrPdg[i]; /* Start Vpd interpolation from the max of the minimum powers */ minPwrT4[i] = AH_MAX(pPwrL[0], pPwrR[0]); @@ -2170,10 +1974,7 @@ ar5416GetGainBoundariesAndPdadcs(struct /* Find starting index for this pdGain */ if (i == 0) { - if (AR_SREV_MERLIN_10_OR_LATER(ah)) - ss = (int16_t)(0 - (minPwrT4[i] / 2)); - else - ss = 0; /* for the first pdGain, start from index 0 */ + ss = 0; /* for the first pdGain, start from index 0 */ } else { /* need overlap entries extrapolated below. */ ss = (int16_t)((pPdGainBoundaries[i-1] - (minPwrT4[i] / 2)) - tPdGainOverlap + 1 + minDelta); @@ -2189,7 +1990,7 @@ ar5416GetGainBoundariesAndPdadcs(struct ss++; } - sizeCurrVpdTable = (uint8_t)((maxPwrT4[i] - minPwrT4[i]) / 2 + 1); + sizeCurrVpdTable = (uint8_t)((maxPwrT4[i] - minPwrT4[i]) / 2 +1); tgtIndex = (uint8_t)(pPdGainBoundaries[i] + tPdGainOverlap - (minPwrT4[i] / 2)); maxIndex = (tgtIndex < sizeCurrVpdTable) ? tgtIndex : sizeCurrVpdTable; @@ -2338,20 +2139,13 @@ ar5416Set11nRegs(struct ath_hal *ah, con { uint32_t phymode; HAL_HT_MACMODE macmode; /* MAC - 20/40 mode */ - uint32_t dacFifo; if (!IEEE80211_IS_CHAN_HT(chan)) return; - if (AR_SREV_KITE_10_OR_LATER(ah)) - dacFifo = OS_REG_READ(ah, AR_PHY_TURBO) - & AR_PHY_FC_ENABLE_DAC_FIFO; - else - dacFifo = 0; - /* Enable 11n HT, 20 MHz */ phymode = AR_PHY_FC_HT_EN | AR_PHY_FC_SHORT_GI_40 - | AR_PHY_FC_SINGLE_HT_LTF1 | AR_PHY_FC_WALSH | dacFifo; + | AR_PHY_FC_SINGLE_HT_LTF1 | AR_PHY_FC_WALSH; /* Configure baseband for dynamic 20/40 operation */ if (IEEE80211_IS_CHAN_HT40(chan)) { Modified: head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Sun Feb 14 16:24:10 2010 (r203881) +++ head/sys/dev/ath/ath_hal/ar5416/ar9160_attach.c Sun Feb 14 16:26:32 2010 (r203882) @@ -249,7 +249,7 @@ ar9160Attach(uint16_t devid, HAL_SOFTC s OS_REG_WRITE(ah, AR_MISC_MODE, ahp->ah_miscMode); ar9160AniSetup(ah); /* Anti Noise Immunity */ - ar5416InitNfHistBuff(ah, AH5416(ah)->ah_cal.nfCalHist); + ar5416InitNfHistBuff(AH5416(ah)->ah_cal.nfCalHist); HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s: return\n", __func__); Modified: head/sys/dev/ath/ath_hal/ar5416/ar9280.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9280.c Sun Feb 14 16:24:10 2010 (r203881) +++ head/sys/dev/ath/ath_hal/ar5416/ar9280.c Sun Feb 14 16:26:32 2010 (r203882) @@ -277,15 +277,12 @@ ar9280GetNoiseFloor(struct ath_hal *ah, "NF calibrated [ctl] [chain 0] is %d\n", nf); nfarray[0] = nf; - if (!AR_SREV_KITE(ah)) { - nf = MS(OS_REG_READ(ah, AR_PHY_CH1_CCA), - AR9280_PHY_CH1_MINCCA_PWR); - if (nf & 0x100) - nf = 0 - ((nf ^ 0x1ff) + 1); - HALDEBUG(ah, HAL_DEBUG_NFCAL, - "NF calibrated [ctl] [chain 1] is %d\n", nf); - nfarray[1] = nf; - } + nf = MS(OS_REG_READ(ah, AR_PHY_CH1_CCA), AR9280_PHY_CH1_MINCCA_PWR); + if (nf & 0x100) + nf = 0 - ((nf ^ 0x1ff) + 1); + HALDEBUG(ah, HAL_DEBUG_NFCAL, + "NF calibrated [ctl] [chain 1] is %d\n", nf); + nfarray[1] = nf; nf = MS(OS_REG_READ(ah, AR_PHY_EXT_CCA), AR9280_PHY_EXT_MINCCA_PWR); if (nf & 0x100) @@ -294,15 +291,12 @@ ar9280GetNoiseFloor(struct ath_hal *ah, "NF calibrated [ext] [chain 0] is %d\n", nf); nfarray[3] = nf; - if (AR_SREV_KITE(ah)) { - nf = MS(OS_REG_READ(ah, AR_PHY_CH1_EXT_CCA), - AR9280_PHY_CH1_EXT_MINCCA_PWR); - if (nf & 0x100) + nf = MS(OS_REG_READ(ah, AR_PHY_CH1_EXT_CCA), AR9280_PHY_CH1_EXT_MINCCA_PWR); + if (nf & 0x100) nf = 0 - ((nf ^ 0x1ff) + 1); - HALDEBUG(ah, HAL_DEBUG_NFCAL, - "NF calibrated [ext] [chain 1] is %d\n", nf); - nfarray[4] = nf; - } + HALDEBUG(ah, HAL_DEBUG_NFCAL, + "NF calibrated [ext] [chain 1] is %d\n", nf); + nfarray[4] = nf; } /* Modified: head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c Sun Feb 14 16:24:10 2010 (r203881) +++ head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c Sun Feb 14 16:26:32 2010 (r203882) @@ -23,7 +23,6 @@ #include "ah_devid.h" #include "ah_eeprom_v14.h" /* XXX for tx/rx gain */ -#include "ah_eeprom_v4k.h" #include "ar5416/ar9280.h" #include "ar5416/ar5416reg.h" @@ -31,9 +30,6 @@ #include "ar5416/ar9280v1.ini" #include "ar5416/ar9280v2.ini" -#include "ar5416/ar9285.ini" -#include "ar5416/ar9285v2.ini" - static const HAL_PERCAL_DATA ar9280_iq_cal = { /* single sample */ .calName = "IQ", .calType = IQ_MISMATCH_CAL, @@ -123,10 +119,6 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s AH5416(ah)->ah_writeIni = ar9280WriteIni; AH5416(ah)->ah_rx_chainmask = AR9280_DEFAULT_RXCHAINMASK; AH5416(ah)->ah_tx_chainmask = AR9280_DEFAULT_TXCHAINMASK; - if (AR_SREV_KITE(ah)) { - AH5416(ah)->ah_rx_chainmask = AR9285_DEFAULT_RXCHAINMASK; - AH5416(ah)->ah_tx_chainmask = AR9285_DEFAULT_TXCHAINMASK; - } if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) { /* reset chip */ @@ -155,18 +147,7 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s AH_PRIVATE(ah)->ah_ispcie = (val & AR_XSREV_TYPE_HOST_MODE) == 0; /* setup common ini data; rf backends handle remainder */ - /* XXX power consumption higer if clkreq is on */ - if (AR_SREV_KITE_12_OR_LATER(ah)) { - HAL_INI_INIT(&ahp->ah_ini_modes, ar9285Modes_v2, 6); - HAL_INI_INIT(&ahp->ah_ini_common, ar9285Common_v2, 2); - HAL_INI_INIT(&AH5416(ah)->ah_ini_pcieserdes, - ar9285PciePhy_clkreq_always_on_L1_v2, 2); - } else if (AR_SREV_KITE_10_OR_LATER(ah)) { - HAL_INI_INIT(&ahp->ah_ini_modes, ar9285Modes, 6); - HAL_INI_INIT(&ahp->ah_ini_common, ar9285Common, 2); - HAL_INI_INIT(&AH5416(ah)->ah_ini_pcieserdes, - ar9285PciePhy_clkreq_always_on_L1, 2); - } else if (AR_SREV_MERLIN_20_OR_LATER(ah)) { + if (AR_SREV_MERLIN_20_OR_LATER(ah)) { HAL_INI_INIT(&ahp->ah_ini_modes, ar9280Modes_v2, 6); HAL_INI_INIT(&ahp->ah_ini_common, ar9280Common_v2, 2); HAL_INI_INIT(&AH5416(ah)->ah_ini_pcieserdes, @@ -181,10 +162,7 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s } ar5416AttachPCIE(ah); - if (devid == AR9285_DEVID_PCIE) - ecode = ath_hal_v4kEepromAttach(ah); - else - ecode = ath_hal_v14EepromAttach(ah); + ecode = ath_hal_v14EepromAttach(ah); if (ecode != HAL_OK) goto bad; @@ -257,19 +235,7 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s goto bad; /* XXX ? try to continue */ } } - - if (AR_SREV_KITE_12_OR_LATER(ah)) { - switch (ath_hal_eepromGet(ah, AR_EEP_TXGAIN_TYPE, AH_NULL)) { - case AR5416_EEP_TXGAIN_HIGH_POWER: - HAL_INI_INIT(&ahp9280->ah_ini_txgain, - ar9285Modes_high_power_tx_gain_v2, 6); - break; - default: - HAL_INI_INIT(&ahp9280->ah_ini_txgain, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 16:56:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDD6F106566B; Sun, 14 Feb 2010 16:56:24 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AACAD8FC13; Sun, 14 Feb 2010 16: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 o1EGuOg5029528; Sun, 14 Feb 2010 16:56:24 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EGuOpw029514; Sun, 14 Feb 2010 16:56:24 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002141656.o1EGuOpw029514@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 14 Feb 2010 16: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: r203883 - in head/sys/ia64: acpica ia64 include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 16:56:24 -0000 Author: marcel Date: Sun Feb 14 16:56:24 2010 New Revision: 203883 URL: http://svn.freebsd.org/changeset/base/203883 Log: Some code churn: o Eliminate IA64_PHYS_TO_RR6 and change all places where the macro is used by calling either bus_space_map() or pmap_mapdev(). o Implement bus_space_map() in terms of pmap_mapdev() and implement bus_space_unmap() in terms of pmap_unmapdev(). o Have ia64_pib hold the uncached virtual address of the processor interrupt block throughout the kernel's life and access the elements of the PIB through this structure pointer. This is a non-functional change with the exception of using ia64_ld1() and ia64_st8() to write to the PIB. We were still using assignments, for which the compiler generates semaphore reads -- which cause undefined behaviour for uncacheable memory. Note also that the memory barriers in ipi_send() are critical for proper functioning. With all the mapping of uncached memory done by pmap_mapdev(), we can keep track of the translations and wire them in the CPU. This then eliminates the need to reserve a whole region for uncached I/O and it eliminates translation traps for device I/O accesses. Modified: head/sys/ia64/acpica/madt.c head/sys/ia64/ia64/bus_machdep.c head/sys/ia64/ia64/efi.c head/sys/ia64/ia64/interrupt.c head/sys/ia64/ia64/machdep.c head/sys/ia64/ia64/mp_machdep.c head/sys/ia64/ia64/pmap.c head/sys/ia64/ia64/sapic.c head/sys/ia64/include/bus.h head/sys/ia64/include/intr.h head/sys/ia64/include/md_var.h head/sys/ia64/include/pmap.h head/sys/ia64/include/vmparam.h Modified: head/sys/ia64/acpica/madt.c ============================================================================== --- head/sys/ia64/acpica/madt.c Sun Feb 14 16:26:32 2010 (r203882) +++ head/sys/ia64/acpica/madt.c Sun Feb 14 16:56:24 2010 (r203883) @@ -31,8 +31,6 @@ #include -extern u_int64_t ia64_lapic_address; - struct sapic *sapic_create(int, int, u_int64_t); static void @@ -150,7 +148,7 @@ ia64_probe_sapics(void) /* Save the address of the processor interrupt block. */ if (bootverbose) printf("\tLocal APIC address=0x%x\n", table->Address); - ia64_lapic_address = table->Address; + ia64_lapic_addr = table->Address; end = (char *)table + table->Header.Length; p = (char *)(table + 1); @@ -172,7 +170,7 @@ ia64_probe_sapics(void) case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE: { ACPI_MADT_LOCAL_APIC_OVERRIDE *lapic = (ACPI_MADT_LOCAL_APIC_OVERRIDE *)entry; - ia64_lapic_address = lapic->Address; + ia64_lapic_addr = lapic->Address; break; } Modified: head/sys/ia64/ia64/bus_machdep.c ============================================================================== --- head/sys/ia64/ia64/bus_machdep.c Sun Feb 14 16:26:32 2010 (r203882) +++ head/sys/ia64/ia64/bus_machdep.c Sun Feb 14 16:56:24 2010 (r203883) @@ -29,12 +29,33 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include extern u_long ia64_port_base; #define __PIO_ADDR(port) \ (void *)(ia64_port_base | (((port) & 0xfffc) << 10) | ((port) & 0xFFF)) +int +bus_space_map(bus_space_tag_t bst, bus_addr_t addr, bus_size_t size, + int flags __unused, bus_space_handle_t *bshp) +{ + + *bshp = (__predict_false(bst == IA64_BUS_SPACE_IO)) + ? addr : (uintptr_t)pmap_mapdev(addr, size); + return (0); +} + + +void +bus_space_unmap(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t size) +{ + + pmap_unmapdev(bsh, size); +} + uint8_t bus_space_read_io_1(u_long port) { Modified: head/sys/ia64/ia64/efi.c ============================================================================== --- head/sys/ia64/ia64/efi.c Sun Feb 14 16:26:32 2010 (r203882) +++ head/sys/ia64/ia64/efi.c Sun Feb 14 16:56:24 2010 (r203883) @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include extern uint64_t ia64_call_efi_physical(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t); @@ -123,8 +125,8 @@ efi_boot_minimal(uint64_t systbl) md->md_virt = (void *)IA64_PHYS_TO_RR7(md->md_phys); else if (md->md_attr & EFI_MD_ATTR_UC) - md->md_virt = - (void *)IA64_PHYS_TO_RR6(md->md_phys); + md->md_virt = pmap_mapdev(md->md_phys, + md->md_pages * EFI_PAGE_SIZE); } md = efi_md_next(md); } Modified: head/sys/ia64/ia64/interrupt.c ============================================================================== --- head/sys/ia64/ia64/interrupt.c Sun Feb 14 16:26:32 2010 (r203882) +++ head/sys/ia64/ia64/interrupt.c Sun Feb 14 16:56:24 2010 (r203883) @@ -106,7 +106,6 @@ void interrupt(struct trapframe *tf) { struct thread *td; - volatile struct ia64_interrupt_block *ib = IA64_INTERRUPT_BLOCK; uint64_t adj, clk, itc; int64_t delta; u_int vector; @@ -128,7 +127,7 @@ interrupt(struct trapframe *tf) */ if (vector == 0) { PCPU_INC(md.stats.pcs_nextints); - inta = ib->ib_inta; + inta = ia64_ld1(&ia64_pib->ib_inta); if (inta == 15) { PCPU_INC(md.stats.pcs_nstrays); __asm __volatile("mov cr.eoi = r0;; srlz.d"); Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Sun Feb 14 16:26:32 2010 (r203882) +++ head/sys/ia64/ia64/machdep.c Sun Feb 14 16:56:24 2010 (r203883) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -134,6 +135,10 @@ struct fpswa_iface *fpswa_iface; u_int64_t ia64_pal_base; u_int64_t ia64_port_base; +u_int64_t ia64_lapic_addr = PAL_PIB_DEFAULT_ADDR; + +struct ia64_pib *ia64_pib; + static int ia64_sync_icache_needed; char machine[] = MACHINE; @@ -308,6 +313,8 @@ cpu_startup(void *dummy) * information. */ ia64_probe_sapics(); + ia64_pib = pmap_mapdev(ia64_lapic_addr, sizeof(*ia64_pib)); + ia64_mca_init(); /* @@ -677,7 +684,8 @@ ia64_init(void) for (md = efi_md_first(); md != NULL; md = efi_md_next(md)) { switch (md->md_type) { case EFI_MD_TYPE_IOPORT: - ia64_port_base = IA64_PHYS_TO_RR6(md->md_phys); + ia64_port_base = (uintptr_t)pmap_mapdev(md->md_phys, + md->md_pages * EFI_PAGE_SIZE); break; case EFI_MD_TYPE_PALCODE: ia64_pal_base = md->md_phys; Modified: head/sys/ia64/ia64/mp_machdep.c ============================================================================== --- head/sys/ia64/ia64/mp_machdep.c Sun Feb 14 16:26:32 2010 (r203882) +++ head/sys/ia64/ia64/mp_machdep.c Sun Feb 14 16:56:24 2010 (r203883) @@ -68,8 +68,9 @@ MALLOC_DEFINE(M_SMP, "SMP", "SMP related void ia64_ap_startup(void); -#define LID_SAPIC_ID(x) ((int)((x) >> 24) & 0xff) -#define LID_SAPIC_EID(x) ((int)((x) >> 16) & 0xff) +#define LID_SAPIC(x) ((u_int)((x) >> 16)) +#define LID_SAPIC_ID(x) ((u_int)((x) >> 24) & 0xff) +#define LID_SAPIC_EID(x) ((u_int)((x) >> 16) & 0xff) #define LID_SAPIC_SET(id,eid) (((id & 0xff) << 8 | (eid & 0xff)) << 16); #define LID_SAPIC_MASK 0xffff0000UL @@ -114,7 +115,6 @@ ia64_store_mca_state(void* arg) void ia64_ap_startup(void) { - volatile struct ia64_interrupt_block *ib = IA64_INTERRUPT_BLOCK; uint64_t vhpt; int vector; @@ -153,7 +153,7 @@ ia64_ap_startup(void) while (vector != 15) { ia64_srlz_d(); if (vector == 0) - vector = (int)ib->ib_inta; + vector = (int)ia64_ld1(&ia64_pib->ib_inta); ia64_set_eoi(0); ia64_srlz_d(); vector = ia64_get_ivr(); @@ -363,16 +363,18 @@ ipi_all_but_self(int ipi) void ipi_send(struct pcpu *cpu, int ipi) { - volatile uint64_t *pipi; - uint64_t vector; + u_int lid; + uint8_t vector; - pipi = (void *)IA64_PHYS_TO_RR6(ia64_lapic_address | - ((cpu->pc_md.lid & LID_SAPIC_MASK) >> 12)); - vector = (uint64_t)(ipi_vector[ipi] & 0xff); + lid = LID_SAPIC(cpu->pc_md.lid); + vector = ipi_vector[ipi]; KASSERT(vector != 0, ("IPI %d is not assigned a vector", ipi)); - *pipi = vector; - CTR3(KTR_SMP, "ipi_send(%p, %ld), cpuid=%d", pipi, vector, - PCPU_GET(cpuid)); + + ia64_mf(); + ia64_st8(&(ia64_pib->ib_ipi[lid][0]), vector); + ia64_mf_a(); + CTR4(KTR_SMP, "ipi_send(%p, %ld): cpuid=%d, vector=%u", cpu, ipi, + PCPU_GET(cpuid), vector); } SYSINIT(start_aps, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL); Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Sun Feb 14 16:26:32 2010 (r203882) +++ head/sys/ia64/ia64/pmap.c Sun Feb 14 16:56:24 2010 (r203883) @@ -2145,9 +2145,12 @@ pmap_remove_write(vm_page_t m) * NOT real memory. */ void * -pmap_mapdev(vm_offset_t pa, vm_size_t size) +pmap_mapdev(vm_paddr_t pa, vm_size_t size) { - return (void*) IA64_PHYS_TO_RR6(pa); + vm_offset_t va; + + va = pa | IA64_RR_BASE(6); + return ((void *)va); } /* @@ -2156,7 +2159,6 @@ pmap_mapdev(vm_offset_t pa, vm_size_t si void pmap_unmapdev(vm_offset_t va, vm_size_t size) { - return; } /* Modified: head/sys/ia64/ia64/sapic.c ============================================================================== --- head/sys/ia64/ia64/sapic.c Sun Feb 14 16:26:32 2010 (r203882) +++ head/sys/ia64/ia64/sapic.c Sun Feb 14 16:56:24 2010 (r203883) @@ -42,6 +42,9 @@ #include #include +#include +#include + static MALLOC_DEFINE(M_SAPIC, "sapic", "I/O SAPIC devices"); static int sysctl_machdep_apic(SYSCTL_HANDLER_ARGS); @@ -52,8 +55,6 @@ SYSCTL_OID(_machdep, OID_AUTO, apic, CTL struct sapic *ia64_sapics[16]; /* XXX make this resizable */ int ia64_sapic_count; -u_int64_t ia64_lapic_address = PAL_PIB_DEFAULT_ADDR; - struct sapic_rte { u_int64_t rte_vector :8; u_int64_t rte_delivery_mode :3; @@ -165,7 +166,7 @@ sapic_create(u_int id, u_int base, u_int sa->sa_id = id; sa->sa_base = base; - sa->sa_registers = IA64_PHYS_TO_RR6(address); + sa->sa_registers = (uintptr_t)pmap_mapdev(address, 1048576); mtx_init(&sa->sa_mtx, "I/O SAPIC lock", NULL, MTX_SPIN); Modified: head/sys/ia64/include/bus.h ============================================================================== --- head/sys/ia64/include/bus.h Sun Feb 14 16:26:32 2010 (r203882) +++ head/sys/ia64/include/bus.h Sun Feb 14 16:56:24 2010 (r203883) @@ -132,28 +132,14 @@ /* - * Map a region of device bus space into CPU virtual address space. + * Map and unmap a region of device bus space into CPU virtual address space. */ -static __inline int -bus_space_map(bus_space_tag_t bst, bus_addr_t addr, bus_size_t size __unused, - int flags __unused, bus_space_handle_t *bshp) -{ - - *bshp = (__predict_false(bst == IA64_BUS_SPACE_IO)) - ? addr : IA64_PHYS_TO_RR6(addr); - return (0); -} - - -/* - * Unmap a region of device bus space. - */ -static __inline void -bus_space_unmap(bus_space_tag_t bst __unused, bus_space_handle_t bsh __unused, - bus_size_t size __unused) -{ -} +int +bus_space_map(bus_space_tag_t, bus_addr_t, bus_size_t, int, + bus_space_handle_t *); +void +bus_space_unmap(bus_space_tag_t, bus_space_handle_t, bus_size_t size); /* * Get a new handle for a subregion of an already-mapped area of bus space. Modified: head/sys/ia64/include/intr.h ============================================================================== --- head/sys/ia64/include/intr.h Sun Feb 14 16:26:32 2010 (r203882) +++ head/sys/ia64/include/intr.h Sun Feb 14 16:56:24 2010 (r203883) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2007-2010 Marcel Moolenaar * Copyright (c) 1998 Doug Rabson * All rights reserved. * @@ -27,26 +28,23 @@ */ #ifndef _MACHINE_INTR_H_ -#define _MACHINE_INTR_H_ +#define _MACHINE_INTR_H_ /* * Layout of the Processor Interrupt Block. */ -struct ia64_interrupt_block +struct ia64_pib { - u_int64_t ib_ipi[0x20000]; /* 1Mb of IPI interrupts */ - u_int8_t ib_reserved1[0xe0000]; - u_int8_t ib_inta; /* Generate INTA cycle */ - u_int8_t ib_reserved2[7]; - u_int8_t ib_xtp; /* XTP cycle */ - u_int8_t ib_reserved3[7]; - u_int8_t ib_reserved4[0x1fff0]; + uint64_t ib_ipi[65536][2]; /* 64K-way IPIs (1MB area). */ + uint8_t _rsvd1[0xe0000]; + uint8_t ib_inta; /* Generate INTA cycle. */ + uint8_t _rsvd2[7]; + uint8_t ib_xtp; /* External Task Priority. */ + uint8_t _rsvd3[7]; + uint8_t _rsvd4[0x1fff0]; }; -extern u_int64_t ia64_lapic_address; - -#define IA64_INTERRUPT_BLOCK \ - (struct ia64_interrupt_block *)IA64_PHYS_TO_RR6(ia64_lapic_address) +extern struct ia64_pib *ia64_pib; int ia64_setup_intr(const char *name, int irq, driver_filter_t filter, driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep); Modified: head/sys/ia64/include/md_var.h ============================================================================== --- head/sys/ia64/include/md_var.h Sun Feb 14 16:26:32 2010 (r203882) +++ head/sys/ia64/include/md_var.h Sun Feb 14 16:56:24 2010 (r203883) @@ -49,7 +49,7 @@ struct ia64_fdesc { #define IA64_CFM_RRB_FR(x) (((x) >> 25) & 0x7f) #define IA64_CFM_RRB_PR(x) (((x) >> 32) & 0x3f) -/* Concenience function (inline) to adjust backingstore pointers. */ +/* Convenience function (inline) to adjust backingstore pointers. */ static __inline uint64_t ia64_bsp_adjust(uint64_t bsp, int nslots) { @@ -60,22 +60,22 @@ ia64_bsp_adjust(uint64_t bsp, int nslots #ifdef _KERNEL -extern char sigcode[]; -extern char esigcode[]; -extern int szsigcode; -extern long Maxmem; - struct _special; -struct fpreg; -struct reg; struct thread; struct trapframe; +/* + * Return value from ia64_init. Describes stack to switch to. + */ struct ia64_init_return { uint64_t bspstore; uint64_t sp; }; +extern uint64_t ia64_lapic_addr; + +extern long Maxmem; + void busdma_swi(void); int copyout_regstack(struct thread *, uint64_t *, uint64_t *); void cpu_mp_add(u_int, u_int, u_int); Modified: head/sys/ia64/include/pmap.h ============================================================================== --- head/sys/ia64/include/pmap.h Sun Feb 14 16:26:32 2010 (r203882) +++ head/sys/ia64/include/pmap.h Sun Feb 14 16:56:24 2010 (r203883) @@ -132,7 +132,7 @@ vm_paddr_t pmap_kextract(vm_offset_t va) void pmap_kremove(vm_offset_t); void pmap_setdevram(unsigned long long basea, vm_offset_t sizea); int pmap_uses_prom_console(void); -void *pmap_mapdev(vm_offset_t, vm_size_t); +void *pmap_mapdev(vm_paddr_t, vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t); unsigned *pmap_pte(pmap_t, vm_offset_t) __pure2; void pmap_set_opt (unsigned *); Modified: head/sys/ia64/include/vmparam.h ============================================================================== --- head/sys/ia64/include/vmparam.h Sun Feb 14 16:26:32 2010 (r203882) +++ head/sys/ia64/include/vmparam.h Sun Feb 14 16:56:24 2010 (r203883) @@ -132,7 +132,6 @@ #define IA64_RR_BASE(n) (((u_int64_t) (n)) << 61) #define IA64_RR_MASK(x) ((x) & ((1L << 61) - 1)) -#define IA64_PHYS_TO_RR6(x) ((x) | IA64_RR_BASE(6)) #define IA64_PHYS_TO_RR7(x) ((x) | IA64_RR_BASE(7)) /* From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 17:03:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E533106566B; Sun, 14 Feb 2010 17:03:20 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C6B88FC0C; Sun, 14 Feb 2010 17:03: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 o1EH3KkP031093; Sun, 14 Feb 2010 17:03:20 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EH3KFk031091; Sun, 14 Feb 2010 17:03:20 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002141703.o1EH3KFk031091@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 14 Feb 2010 17:03: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: r203884 - head/sys/ia64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 17:03:20 -0000 Author: marcel Date: Sun Feb 14 17:03:20 2010 New Revision: 203884 URL: http://svn.freebsd.org/changeset/base/203884 Log: Some code cleanups: o s/u_int32_t/uint32_t/g o Add multiple-inclusion protection. o Break long lines. Modified: head/sys/ia64/include/pci_cfgreg.h Modified: head/sys/ia64/include/pci_cfgreg.h ============================================================================== --- head/sys/ia64/include/pci_cfgreg.h Sun Feb 14 16:56:24 2010 (r203883) +++ head/sys/ia64/include/pci_cfgreg.h Sun Feb 14 17:03:20 2010 (r203884) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2010 Marcel Moolenaar * Copyright (c) 1997, Stefan Esser * All rights reserved. * @@ -24,9 +25,14 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD$ - * */ -extern int pci_cfgregopen(void); -extern u_int32_t pci_cfgregread(int bus, int slot, int func, int reg, int bytes); -extern void pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes); +#ifndef _MACHINE_PCI_CFGREG_H_ +#define _MACHINE_PCI_CFGREG_H_ + +int pci_cfgregopen(void); +uint32_t pci_cfgregread(int bus, int slot, int func, int reg, int len); +void pci_cfgregwrite(int bus, int slot, int func, int reg, uint32_t data, + int bytes); + +#endif /* _MACHINE_PCI_CFGREG_H_ */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 17:14:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EC071065670; Sun, 14 Feb 2010 17:14:12 +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 F0A4B8FC15; Sun, 14 Feb 2010 17:14: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 o1EHEBhQ033488; Sun, 14 Feb 2010 17:14:11 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EHEBlR033483; Sun, 14 Feb 2010 17:14:11 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201002141714.o1EHEBlR033483@svn.freebsd.org> From: Ed Maste Date: Sun, 14 Feb 2010 17:14: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: r203885 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 17:14:12 -0000 Author: emaste Date: Sun Feb 14 17:14:11 2010 New Revision: 203885 URL: http://svn.freebsd.org/changeset/base/203885 Log: Diff reduction with Adaptec's vendor driver. Driver version 2.1.9 chosen as that Adaptec version roughly corresponds with the current feature set merged to the in-tree driver. Modified: head/sys/dev/aac/aac.c head/sys/dev/aac/aac_cam.c head/sys/dev/aac/aacreg.h head/sys/dev/aac/aacvar.h Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Sun Feb 14 17:03:20 2010 (r203884) +++ head/sys/dev/aac/aac.c Sun Feb 14 17:14:11 2010 (r203885) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); /* * Driver for the Adaptec 'FSA' family of PCI/SCSI RAID adapters. */ -#define AAC_DRIVER_VERSION 0x02000000 #define AAC_DRIVERNAME "aac" #include "opt_aac.h" @@ -2767,10 +2766,8 @@ aac_describe_controller(struct aac_softc } device_printf(sc->aac_dev, "%s, aac driver %d.%d.%d-%d\n", adapter_type, - AAC_DRIVER_VERSION >> 24, - (AAC_DRIVER_VERSION >> 16) & 0xFF, - AAC_DRIVER_VERSION & 0xFF, - AAC_DRIVER_BUILD); + AAC_DRIVER_MAJOR_VERSION, AAC_DRIVER_MINOR_VERSION, + AAC_DRIVER_BUGFIX_LEVEL, AAC_DRIVER_BUILD); aac_release_sync_fib(sc); mtx_unlock(&sc->aac_io_lock); @@ -3255,10 +3252,16 @@ aac_rev_check(struct aac_softc *sc, cadd * Doctor up the response struct. */ rev_check_resp.possiblyCompatible = 1; - rev_check_resp.adapterSWRevision.external.ul = - sc->aac_revision.external.ul; + rev_check_resp.adapterSWRevision.external.comp.major = + AAC_DRIVER_MAJOR_VERSION; + rev_check_resp.adapterSWRevision.external.comp.minor = + AAC_DRIVER_MINOR_VERSION; + rev_check_resp.adapterSWRevision.external.comp.type = + AAC_DRIVER_TYPE; + rev_check_resp.adapterSWRevision.external.comp.dash = + AAC_DRIVER_BUGFIX_LEVEL; rev_check_resp.adapterSWRevision.buildNumber = - sc->aac_revision.buildNumber; + AAC_DRIVER_BUILD; return(copyout((caddr_t)&rev_check_resp, udata, sizeof(struct aac_rev_check_resp))); Modified: head/sys/dev/aac/aac_cam.c ============================================================================== --- head/sys/dev/aac/aac_cam.c Sun Feb 14 17:03:20 2010 (r203884) +++ head/sys/dev/aac/aac_cam.c Sun Feb 14 17:14:11 2010 (r203885) @@ -405,10 +405,10 @@ aac_cam_action(struct cam_sim *sim, unio if (ccb->ccb_h.flags & CAM_DATA_PHYS) { /* Send a 32bit command */ fib->Header.Command = ScsiPortCommand; - srb->sg_map32.SgCount = 1; - srb->sg_map32.SgEntry[0].SgAddress = + srb->sg_map.SgCount = 1; + srb->sg_map.SgEntry[0].SgAddress = (uint32_t)(uintptr_t)csio->data_ptr; - srb->sg_map32.SgEntry[0].SgByteCount = + srb->sg_map.SgEntry[0].SgByteCount = csio->dxfer_len; } else { /* @@ -417,15 +417,15 @@ aac_cam_action(struct cam_sim *sim, unio */ cm->cm_data = (void *)csio->data_ptr; cm->cm_datalen = csio->dxfer_len; - cm->cm_sgtable = &srb->sg_map32; + cm->cm_sgtable = &srb->sg_map; } } else { /* XXX Need to handle multiple s/g elements */ panic("aac_cam: multiple s/g elements"); } } else { - srb->sg_map32.SgCount = 0; - srb->sg_map32.SgEntry[0].SgByteCount = 0; + srb->sg_map.SgCount = 0; + srb->sg_map.SgEntry[0].SgByteCount = 0; srb->data_len = 0; } Modified: head/sys/dev/aac/aacreg.h ============================================================================== --- head/sys/dev/aac/aacreg.h Sun Feb 14 17:03:20 2010 (r203884) +++ head/sys/dev/aac/aacreg.h Sun Feb 14 17:14:11 2010 (r203885) @@ -1374,7 +1374,7 @@ struct aac_srb { u_int32_t retry_limit; u_int32_t cdb_len; u_int8_t cdb[16]; - struct aac_sg_table sg_map32; + struct aac_sg_table sg_map; }; enum { Modified: head/sys/dev/aac/aacvar.h ============================================================================== --- head/sys/dev/aac/aacvar.h Sun Feb 14 17:03:20 2010 (r203884) +++ head/sys/dev/aac/aacvar.h Sun Feb 14 17:14:11 2010 (r203885) @@ -37,6 +37,16 @@ #include #include +#define AAC_TYPE_DEVO 1 +#define AAC_TYPE_ALPHA 2 +#define AAC_TYPE_BETA 3 +#define AAC_TYPE_RELEASE 4 + +#define AAC_DRIVER_MAJOR_VERSION 2 +#define AAC_DRIVER_MINOR_VERSION 1 +#define AAC_DRIVER_BUGFIX_LEVEL 9 +#define AAC_DRIVER_TYPE AAC_TYPE_RELEASE + #ifndef AAC_DRIVER_BUILD # define AAC_DRIVER_BUILD 1 #endif From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 19:53:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84F0610656A5; Sun, 14 Feb 2010 19:53:45 +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 73AED8FC1B; Sun, 14 Feb 2010 19:53: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 o1EJrjOV069214; Sun, 14 Feb 2010 19:53:45 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EJrjRO069212; Sun, 14 Feb 2010 19:53:45 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201002141953.o1EJrjRO069212@svn.freebsd.org> From: Andrew Thompson Date: Sun, 14 Feb 2010 19:53: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: r203896 - head/sys/dev/usb/input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 19:53:45 -0000 Author: thompsa Date: Sun Feb 14 19:53:45 2010 New Revision: 203896 URL: http://svn.freebsd.org/changeset/base/203896 Log: Detect when we are polling from kernel via cngetc() in the boot process and reserve the keypresses so they do not get passed to syscons. Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/input/ukbd.c Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Sun Feb 14 19:53:09 2010 (r203895) +++ head/sys/dev/usb/input/ukbd.c Sun Feb 14 19:53:45 2010 (r203896) @@ -151,6 +151,7 @@ struct ukbd_softc { struct ukbd_data sc_ndata; struct ukbd_data sc_odata; + struct thread *sc_poll_thread; struct usb_device *sc_udev; struct usb_interface *sc_iface; struct usb_xfer *sc_xfer[UKBD_N_TRANSFER]; @@ -174,9 +175,10 @@ struct ukbd_softc { #define UKBD_FLAG_APPLE_SWAP 0x0100 #define UKBD_FLAG_TIMER_RUNNING 0x0200 - int32_t sc_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ - int32_t sc_state; /* shift/lock key state */ - int32_t sc_accents; /* accent key index (> 0) */ + int sc_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ + int sc_state; /* shift/lock key state */ + int sc_accents; /* accent key index (> 0) */ + int sc_poll_tick_last; uint16_t sc_inputs; uint16_t sc_inputhead; @@ -187,6 +189,7 @@ struct ukbd_softc { uint8_t sc_iface_no; uint8_t sc_kbd_id; uint8_t sc_led_id; + uint8_t sc_poll_detected; }; #define KEY_ERROR 0x01 @@ -281,6 +284,9 @@ static int ukbd_ioctl(keyboard_t *, u_lo static int ukbd_enable(keyboard_t *); static int ukbd_disable(keyboard_t *); static void ukbd_interrupt(struct ukbd_softc *); +static int ukbd_is_polling(struct ukbd_softc *); +static int ukbd_polls_other_thread(struct ukbd_softc *); +static void ukbd_event_keyinput(struct ukbd_softc *); static device_probe_t ukbd_probe; static device_attach_t ukbd_attach; @@ -331,8 +337,21 @@ ukbd_do_poll(struct ukbd_softc *sc, uint { DPRINTFN(2, "polling\n"); - if (kdb_active == 0) + /* update stats about last polling event */ + sc->sc_poll_tick_last = ticks; + sc->sc_poll_detected = 1; + + if (kdb_active == 0) { + while (sc->sc_inputs == 0) { + /* make sure the USB code gets a chance to run */ + pause("UKBD", 1); + + /* check if we should wait */ + if (!wait) + break; + } return; /* Only poll if KDB is active */ + } while (sc->sc_inputs == 0) { @@ -366,9 +385,13 @@ ukbd_get_key(struct ukbd_softc *sc, uint /* start transfer, if not already started */ usbd_transfer_start(sc->sc_xfer[UKBD_INTR_DT]); } - if (sc->sc_flags & UKBD_FLAG_POLLING) { + + if (ukbd_polls_other_thread(sc)) + return (-1); + + if (sc->sc_flags & UKBD_FLAG_POLLING) ukbd_do_poll(sc, wait); - } + if (sc->sc_inputs == 0) { c = -1; } else { @@ -389,14 +412,13 @@ ukbd_interrupt(struct ukbd_softc *sc) uint32_t o_mod; uint32_t now = sc->sc_time_ms; uint32_t dtime; - uint32_t c; uint8_t key; uint8_t i; uint8_t j; - if (sc->sc_ndata.keycode[0] == KEY_ERROR) { - goto done; - } + if (sc->sc_ndata.keycode[0] == KEY_ERROR) + return; + n_mod = sc->sc_ndata.modifiers; o_mod = sc->sc_odata.modifiers; if (n_mod != o_mod) { @@ -469,14 +491,22 @@ pfound: ; sc->sc_odata = sc->sc_ndata; - bcopy(sc->sc_ntime, sc->sc_otime, sizeof(sc->sc_otime)); + memcpy(sc->sc_otime, sc->sc_ntime, sizeof(sc->sc_otime)); + + ukbd_event_keyinput(sc); +} + +static void +ukbd_event_keyinput(struct ukbd_softc *sc) +{ + int c; + + if (ukbd_is_polling(sc)) + return; + + if (sc->sc_inputs == 0) + return; - if (sc->sc_inputs == 0) { - goto done; - } - if (sc->sc_flags & UKBD_FLAG_POLLING) { - goto done; - } if (KBD_IS_ACTIVE(&sc->sc_kbd) && KBD_IS_BUSY(&sc->sc_kbd)) { /* let the callback function process the input */ @@ -488,8 +518,6 @@ pfound: ; c = ukbd_read_char(&sc->sc_kbd, 0); } while (c != NOKEY); } -done: - return; } static void @@ -499,12 +527,14 @@ ukbd_timeout(void *arg) mtx_assert(&Giant, MA_OWNED); - if (!(sc->sc_flags & UKBD_FLAG_POLLING)) { - sc->sc_time_ms += 25; /* milliseconds */ - } + sc->sc_time_ms += 25; /* milliseconds */ + ukbd_interrupt(sc); - if (ukbd_any_key_pressed(sc)) { + /* Make sure any leftover key events gets read out */ + ukbd_event_keyinput(sc); + + if (ukbd_any_key_pressed(sc) || (sc->sc_inputs != 0)) { ukbd_start_timer(sc); } else { sc->sc_flags &= ~UKBD_FLAG_TIMER_RUNNING; @@ -837,6 +867,18 @@ ukbd_attach(device_t dev) */ KBD_PROBE_DONE(kbd); + /* + * Set boot protocol if we need the quirk. + */ + if (usb_test_quirk(uaa, UQ_KBD_BOOTPROTO)) { + err = usbd_req_set_protocol(sc->sc_udev, NULL, + sc->sc_iface_index, 0); + if (err != USB_ERR_NORMAL_COMPLETION) { + DPRINTF("set protocol error=%s\n", usbd_errstr(err)); + goto detach; + } + } + /* figure out if there is an ID byte in the data */ err = usbd_req_get_hid_desc(uaa->device, NULL, &hid_ptr, &hid_len, M_TEMP, uaa->info.bIfaceIndex); @@ -880,10 +922,14 @@ ukbd_attach(device_t dev) /* ignore if SETIDLE fails, hence it is not crucial */ err = usbd_req_set_idle(sc->sc_udev, NULL, sc->sc_iface_index, 0, 0); + mtx_lock(&Giant); + ukbd_ioctl(kbd, KDSETLED, (caddr_t)&sc->sc_state); KBD_INIT_DONE(kbd); + mtx_unlock(&Giant); + if (kbd_register(kbd) < 0) { goto detach; } @@ -925,9 +971,8 @@ ukbd_detach(device_t dev) DPRINTF("\n"); - if (sc->sc_flags & UKBD_FLAG_POLLING) { - panic("cannot detach polled keyboard\n"); - } + mtx_lock(&Giant); + sc->sc_flags |= UKBD_FLAG_GONE; usb_callout_stop(&sc->sc_callout); @@ -954,6 +999,8 @@ ukbd_detach(device_t dev) } sc->sc_kbd.kb_flags = 0; + mtx_unlock(&Giant); + usbd_transfer_unsetup(sc->sc_xfer, UKBD_N_TRANSFER); usb_callout_drain(&sc->sc_callout); @@ -969,8 +1016,12 @@ ukbd_resume(device_t dev) { struct ukbd_softc *sc = device_get_softc(dev); + mtx_lock(&Giant); + ukbd_clear_state(&sc->sc_kbd); + mtx_unlock(&Giant); + return (0); } @@ -1076,13 +1127,19 @@ ukbd_check(keyboard_t *kbd) mtx_unlock(&Giant); return (retval); } - ukbd_do_poll(sc, 0); } else { /* XXX the keyboard layer requires Giant */ if (!mtx_owned(&Giant)) return (0); } + /* check if key belongs to this thread */ + if (ukbd_polls_other_thread(sc)) + return (0); + + if (sc->sc_flags & UKBD_FLAG_POLLING) + ukbd_do_poll(sc, 0); + #ifdef UKBD_EMULATE_ATSCANCODE if (sc->sc_buffered_char[0]) { return (1); @@ -1118,6 +1175,10 @@ ukbd_check_char(keyboard_t *kbd) return (0); } + /* check if key belongs to this thread */ + if (ukbd_polls_other_thread(sc)) + return (0); + if ((sc->sc_composed_char > 0) && (!(sc->sc_flags & UKBD_FLAG_COMPOSE))) { return (1); @@ -1156,6 +1217,10 @@ ukbd_read(keyboard_t *kbd, int wait) return (-1); } + /* check if key belongs to this thread */ + if (ukbd_polls_other_thread(sc)) + return (-1); + #ifdef UKBD_EMULATE_ATSCANCODE if (sc->sc_buffered_char[0]) { scancode = sc->sc_buffered_char[0]; @@ -1220,6 +1285,10 @@ ukbd_read_char(keyboard_t *kbd, int wait return (NOKEY); } + /* check if key belongs to this thread */ + if (ukbd_polls_other_thread(sc)) + return (NOKEY); + next_code: /* do we have a composed char to return ? */ @@ -1419,7 +1488,17 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd, * keyboard system must get out of "Giant" first, before the * CPU can proceed here ... */ - return (EINVAL); + switch (cmd) { + case KDGKBMODE: + case KDSKBMODE: + /* workaround for Geli */ + mtx_lock(&Giant); + i = ukbd_ioctl(kbd, cmd, arg); + mtx_unlock(&Giant); + return (i); + default: + return (EINVAL); + } } switch (cmd) { @@ -1445,7 +1524,8 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd, case K_RAW: case K_CODE: if (sc->sc_mode != *(int *)arg) { - ukbd_clear_state(kbd); + if (ukbd_is_polling(sc) == 0) + ukbd_clear_state(kbd); sc->sc_mode = *(int *)arg; } break; @@ -1552,7 +1632,11 @@ ukbd_clear_state(keyboard_t *kbd) struct ukbd_softc *sc = kbd->kb_data; if (!mtx_owned(&Giant)) { - return; /* XXX */ + /* XXX cludge */ + mtx_lock(&Giant); + ukbd_clear_state(kbd); + mtx_unlock(&Giant); + return; } sc->sc_flags &= ~(UKBD_FLAG_COMPOSE | UKBD_FLAG_POLLING); @@ -1563,10 +1647,10 @@ ukbd_clear_state(keyboard_t *kbd) sc->sc_buffered_char[0] = 0; sc->sc_buffered_char[1] = 0; #endif - bzero(&sc->sc_ndata, sizeof(sc->sc_ndata)); - bzero(&sc->sc_odata, sizeof(sc->sc_odata)); - bzero(&sc->sc_ntime, sizeof(sc->sc_ntime)); - bzero(&sc->sc_otime, sizeof(sc->sc_otime)); + memset(&sc->sc_ndata, 0, sizeof(sc->sc_ndata)); + memset(&sc->sc_odata, 0, sizeof(sc->sc_odata)); + memset(&sc->sc_ntime, 0, sizeof(sc->sc_ntime)); + memset(&sc->sc_otime, 0, sizeof(sc->sc_otime)); } /* save the internal state, not used */ @@ -1584,6 +1668,30 @@ ukbd_set_state(keyboard_t *kbd, void *bu } static int +ukbd_is_polling(struct ukbd_softc *sc) +{ + int delta; + + if (sc->sc_flags & UKBD_FLAG_POLLING) + return (1); /* polling */ + + delta = ticks - sc->sc_poll_tick_last; + if ((delta < 0) || (delta >= hz)) { + sc->sc_poll_detected = 0; + return (0); /* not polling */ + } + + return (sc->sc_poll_detected); +} + +static int +ukbd_polls_other_thread(struct ukbd_softc *sc) +{ + return (ukbd_is_polling(sc) && + (sc->sc_poll_thread != curthread)); +} + +static int ukbd_poll(keyboard_t *kbd, int on) { struct ukbd_softc *sc = kbd->kb_data; @@ -1599,8 +1707,10 @@ ukbd_poll(keyboard_t *kbd, int on) if (on) { sc->sc_flags |= UKBD_FLAG_POLLING; + sc->sc_poll_thread = curthread; } else { sc->sc_flags &= ~UKBD_FLAG_POLLING; + ukbd_start_timer(sc); /* start timer */ } return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 19:56:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2B091065692; Sun, 14 Feb 2010 19:56:05 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 924758FC1D; Sun, 14 Feb 2010 19:56: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 o1EJu5k2069896; Sun, 14 Feb 2010 19:56:05 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EJu5DU069893; Sun, 14 Feb 2010 19:56:05 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201002141956.o1EJu5DU069893@svn.freebsd.org> From: Andrew Thompson Date: Sun, 14 Feb 2010 19:56: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: r203899 - head/sys/dev/usb/quirk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 19:56:05 -0000 Author: thompsa Date: Sun Feb 14 19:56:05 2010 New Revision: 203899 URL: http://svn.freebsd.org/changeset/base/203899 Log: Add UQ_KBD_BOOTPROTO quirk needed in r203896 Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/quirk/usb_quirk.h Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Sun Feb 14 19:55:41 2010 (r203898) +++ head/sys/dev/usb/quirk/usb_quirk.c Sun Feb 14 19:56:05 2010 (r203899) @@ -459,6 +459,7 @@ static const char *usb_quirk_str[USB_QUI [UQ_BUS_POWERED] = "UQ_BUS_POWERED", [UQ_HID_IGNORE] = "UQ_HID_IGNORE", [UQ_KBD_IGNORE] = "UQ_KBD_IGNORE", + [UQ_KBD_BOOTPROTO] = "UQ_KBD_BOOTPROTO", [UQ_MS_BAD_CLASS] = "UQ_MS_BAD_CLASS", [UQ_MS_LEADING_BYTE] = "UQ_MS_LEADING_BYTE", [UQ_MS_REVZ] = "UQ_MS_REVZ", Modified: head/sys/dev/usb/quirk/usb_quirk.h ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.h Sun Feb 14 19:55:41 2010 (r203898) +++ head/sys/dev/usb/quirk/usb_quirk.h Sun Feb 14 19:56:05 2010 (r203899) @@ -45,6 +45,7 @@ enum { /* keep in sync with usb_quirk_st UQ_BUS_POWERED, /* device is bus powered, despite claim */ UQ_HID_IGNORE, /* device should be ignored by hid class */ UQ_KBD_IGNORE, /* device should be ignored by kbd class */ + UQ_KBD_BOOTPROTO, /* device should set the boot protocol */ UQ_MS_BAD_CLASS, /* doesn't identify properly */ UQ_MS_LEADING_BYTE, /* mouse sends an unknown leading byte */ UQ_MS_REVZ, /* mouse has Z-axis reversed */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 19:59:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14F8910656D9; Sun, 14 Feb 2010 19:59:20 +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 049C08FC12; Sun, 14 Feb 2010 19:59: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 o1EJxJvO070764; Sun, 14 Feb 2010 19:59:19 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EJxJxQ070762; Sun, 14 Feb 2010 19:59:19 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201002141959.o1EJxJxQ070762@svn.freebsd.org> From: Andrew Thompson Date: Sun, 14 Feb 2010 19:59: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: r203903 - head/sys/dev/usb/serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 19:59:20 -0000 Author: thompsa Date: Sun Feb 14 19:59:19 2010 New Revision: 203903 URL: http://svn.freebsd.org/changeset/base/203903 Log: Make umodem more tolerant for devices which modem descriptors are misplaced. Reported by: Erick Wales Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/serial/umodem.c Modified: head/sys/dev/usb/serial/umodem.c ============================================================================== --- head/sys/dev/usb/serial/umodem.c Sun Feb 14 19:59:06 2010 (r203902) +++ head/sys/dev/usb/serial/umodem.c Sun Feb 14 19:59:19 2010 (r203903) @@ -312,11 +312,16 @@ umodem_attach(device_t dev) 0 - 1, UDESCSUB_CDC_UNION, 0 - 1); if ((cud == NULL) || (cud->bLength < sizeof(*cud))) { - device_printf(dev, "no CM or union descriptor\n"); - goto detach; + device_printf(dev, "Missing descriptor. " + "Assuming data interface is next.\n"); + if (sc->sc_ctrl_iface_no == 0xFF) + goto detach; + else + sc->sc_data_iface_no = + sc->sc_ctrl_iface_no + 1; + } else { + sc->sc_data_iface_no = cud->bSlaveInterface[0]; } - - sc->sc_data_iface_no = cud->bSlaveInterface[0]; } else { sc->sc_data_iface_no = cmd->bDataInterface; } From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 20:05:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 780F11065696; Sun, 14 Feb 2010 20:05:12 +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 676E68FC16; Sun, 14 Feb 2010 20:05: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 o1EK5C8J072256; Sun, 14 Feb 2010 20:05:12 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EK5Ctj072251; Sun, 14 Feb 2010 20:05:12 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201002142005.o1EK5Ctj072251@svn.freebsd.org> From: Andrew Thompson Date: Sun, 14 Feb 2010 20:05: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: r203905 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 20:05:12 -0000 Author: thompsa Date: Sun Feb 14 20:05:12 2010 New Revision: 203905 URL: http://svn.freebsd.org/changeset/base/203905 Log: Add support for the E1752 3G modem and the required eject command. Submitted by: Milan Obuch Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usb_msctest.c head/sys/dev/usb/usb_msctest.h head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Sun Feb 14 20:00:21 2010 (r203904) +++ head/sys/dev/usb/serial/u3g.c Sun Feb 14 20:05:12 2010 (r203905) @@ -92,6 +92,7 @@ SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, #define U3GINIT_CMOTECH 6 /* Requires CMOTECH SCSI command */ #define U3GINIT_WAIT 7 /* Device reappears after a delay */ #define U3GINIT_SAEL_M460 8 /* Requires vendor init */ +#define U3GINIT_HUAWEISCSI 9 /* Requires Huawei SCSI init command */ enum { U3G_BULK_WR, @@ -281,6 +282,7 @@ static const struct usb_device_id u3g_de U3G_DEV(HUAWEI, E220, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, E220BIS, U3GINIT_HUAWEI), U3G_DEV(HUAWEI, MOBILE, U3GINIT_HUAWEI), + U3G_DEV(HUAWEI, E1752, U3GINIT_HUAWEISCSI), U3G_DEV(KYOCERA2, CDMA_MSM_K, 0), U3G_DEV(KYOCERA2, KPC680, 0), U3G_DEV(MERLIN, V620, 0), @@ -649,6 +651,9 @@ u3g_test_autoinst(void *arg, struct usb_ case U3GINIT_HUAWEI: error = u3g_huawei_init(udev); break; + case U3GINIT_HUAWEISCSI: + error = usb_msc_eject(udev, 0, MSC_EJECT_HUAWEI); + break; case U3GINIT_SCSIEJECT: error = usb_msc_eject(udev, 0, MSC_EJECT_STOPUNIT); break; Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Sun Feb 14 20:00:21 2010 (r203904) +++ head/sys/dev/usb/usb_msctest.c Sun Feb 14 20:05:12 2010 (r203905) @@ -94,6 +94,9 @@ static uint8_t scsi_ztestor_eject[] = 0x01, 0x01, 0x01, 0x01, 0x00, 0x00 }; static uint8_t scsi_cmotech_eject[] = { 0xff, 0x52, 0x44, 0x45, 0x56, 0x43, 0x48, 0x47 }; +static uint8_t scsi_huawei_eject[] = { 0x11, 0x06, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; #define BULK_SIZE 64 /* dummy */ #define ERR_CSW_FAILED -1 @@ -611,6 +614,11 @@ usb_msc_eject(struct usb_device *udev, u &scsi_cmotech_eject, sizeof(scsi_cmotech_eject), USB_MS_HZ); break; + case MSC_EJECT_HUAWEI: + err = bbb_command_start(sc, DIR_IN, 0, NULL, 0, + &scsi_huawei_eject, sizeof(scsi_huawei_eject), + USB_MS_HZ); + break; default: printf("usb_msc_eject: unknown eject method (%d)\n", method); break; Modified: head/sys/dev/usb/usb_msctest.h ============================================================================== --- head/sys/dev/usb/usb_msctest.h Sun Feb 14 20:00:21 2010 (r203904) +++ head/sys/dev/usb/usb_msctest.h Sun Feb 14 20:05:12 2010 (r203905) @@ -31,7 +31,8 @@ enum { MSC_EJECT_STOPUNIT, MSC_EJECT_REZERO, MSC_EJECT_ZTESTOR, - MSC_EJECT_CMOTECH + MSC_EJECT_CMOTECH, + MSC_EJECT_HUAWEI, }; int usb_iface_is_cdrom(struct usb_device *udev, Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Feb 14 20:00:21 2010 (r203904) +++ head/sys/dev/usb/usbdevs Sun Feb 14 20:05:12 2010 (r203905) @@ -1723,6 +1723,7 @@ product HUAWEI E143C 0x143c 3G modem 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 E14AC 0x14ac 3G modem /* HUAWEI 3com products */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 14 20:10:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28A261065695; Sun, 14 Feb 2010 20:10:42 +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 180148FC1B; Sun, 14 Feb 2010 20:10: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 o1EKAfkt073534; Sun, 14 Feb 2010 20:10:41 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EKAfhN073531; Sun, 14 Feb 2010 20:10:41 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201002142010.o1EKAfhN073531@svn.freebsd.org> From: Andrew Thompson Date: Sun, 14 Feb 2010 20:10: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: r203906 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 20:10:42 -0000 Author: thompsa Date: Sun Feb 14 20:10:41 2010 New Revision: 203906 URL: http://svn.freebsd.org/changeset/base/203906 Log: Add device ID for the FTDI 4232H. PR: usb/143832 Submitted by: UEMURA Tetsuya Modified: head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Sun Feb 14 20:05:12 2010 (r203905) +++ head/sys/dev/usb/serial/uftdi.c Sun Feb 14 20:10:41 2010 (r203906) @@ -224,6 +224,7 @@ static struct usb_device_id uftdi_devs[] UFTDI_DEV(FTDI, SERIAL_8U100AX, SIO), UFTDI_DEV(FTDI, SERIAL_2232C, 8U232AM), UFTDI_DEV(FTDI, SERIAL_2232D, 8U232AM), + UFTDI_DEV(FTDI, SERIAL_4232H, 8U232AM), UFTDI_DEV(FTDI, SERIAL_8U232AM, 8U232AM), UFTDI_DEV(FTDI, SERIAL_8U232AM4, 8U232AM), UFTDI_DEV(FTDI, SEMC_DSS20, 8U232AM), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Feb 14 20:05:12 2010 (r203905) +++ head/sys/dev/usb/usbdevs Sun Feb 14 20:10:41 2010 (r203906) @@ -1472,6 +1472,7 @@ product FTDI SERIAL_8U232AM 0x6001 8U232 product FTDI SERIAL_8U232AM4 0x6004 8U232AM Serial product FTDI SERIAL_2232C 0x6010 FT2232C Dual port Serial product FTDI SERIAL_2232D 0x9e90 FT2232D Dual port Serial +product FTDI SERIAL_4232H 0x6011 FT4232H Quad port Serial /* Gude Analog- und Digitalsysteme products also uses FTDI's id: */ product FTDI TACTRIX_OPENPORT_13M 0xcc48 OpenPort 1.3 Mitsubishi product FTDI TACTRIX_OPENPORT_13S 0xcc49 OpenPort 1.3 Subaru From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 09:19:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF331106566C; Mon, 15 Feb 2010 09:19:07 +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 B5FF98FC14; Mon, 15 Feb 2010 09:19: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 o1F9J7av055190; Mon, 15 Feb 2010 09:19:07 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1F9J7Ud055189; Mon, 15 Feb 2010 09:19:07 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002150919.o1F9J7Ud055189@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 15 Feb 2010 09:19: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: r203913 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 09:19:08 -0000 Author: pjd Date: Mon Feb 15 09:19:07 2010 New Revision: 203913 URL: http://svn.freebsd.org/changeset/base/203913 Log: Mark various sysctls also as tunables. Reviewed by: rwatson MFC after: 1 week Modified: head/sys/net/netisr.c Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Mon Feb 15 07:41:16 2010 (r203912) +++ head/sys/net/netisr.c Mon Feb 15 09:19:07 2010 (r203913) @@ -156,13 +156,13 @@ SYSCTL_INT(_net_isr, OID_AUTO, direct, C */ static int netisr_maxthreads = -1; /* Max number of threads. */ TUNABLE_INT("net.isr.maxthreads", &netisr_maxthreads); -SYSCTL_INT(_net_isr, OID_AUTO, maxthreads, CTLFLAG_RD, +SYSCTL_INT(_net_isr, OID_AUTO, maxthreads, CTLFLAG_RDTUN, &netisr_maxthreads, 0, "Use at most this many CPUs for netisr processing"); static int netisr_bindthreads = 0; /* Bind threads to CPUs. */ TUNABLE_INT("net.isr.bindthreads", &netisr_bindthreads); -SYSCTL_INT(_net_isr, OID_AUTO, bindthreads, CTLFLAG_RD, +SYSCTL_INT(_net_isr, OID_AUTO, bindthreads, CTLFLAG_RDTUN, &netisr_bindthreads, 0, "Bind netisr threads to CPUs."); /* @@ -173,7 +173,7 @@ SYSCTL_INT(_net_isr, OID_AUTO, bindthrea #define NETISR_DEFAULT_MAXQLIMIT 10240 static u_int netisr_maxqlimit = NETISR_DEFAULT_MAXQLIMIT; TUNABLE_INT("net.isr.maxqlimit", &netisr_maxqlimit); -SYSCTL_INT(_net_isr, OID_AUTO, maxqlimit, CTLFLAG_RD, +SYSCTL_INT(_net_isr, OID_AUTO, maxqlimit, CTLFLAG_RDTUN, &netisr_maxqlimit, 0, "Maximum netisr per-protocol, per-CPU queue depth."); @@ -185,7 +185,7 @@ SYSCTL_INT(_net_isr, OID_AUTO, maxqlimit #define NETISR_DEFAULT_DEFAULTQLIMIT 256 static u_int netisr_defaultqlimit = NETISR_DEFAULT_DEFAULTQLIMIT; TUNABLE_INT("net.isr.defaultqlimit", &netisr_defaultqlimit); -SYSCTL_INT(_net_isr, OID_AUTO, defaultqlimit, CTLFLAG_RD, +SYSCTL_INT(_net_isr, OID_AUTO, defaultqlimit, CTLFLAG_RDTUN, &netisr_defaultqlimit, 0, "Default netisr per-protocol, per-CPU queue limit if not set by protocol"); From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 14:07:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7009A106566C; Mon, 15 Feb 2010 14:07:41 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D9D28FC15; Mon, 15 Feb 2010 14:07: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 o1FE7elk021303; Mon, 15 Feb 2010 14:07:41 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FE7e1m021298; Mon, 15 Feb 2010 14:07:40 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201002151407.o1FE7e1m021298@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 15 Feb 2010 14:07: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: r203916 - in head: bin/rmail sbin/devd sbin/devfs sbin/ffsinfo sbin/gbde sbin/mknod sbin/mount_std sbin/sunlabel X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 14:07:41 -0000 Author: uqs Date: Mon Feb 15 14:07:40 2010 New Revision: 203916 URL: http://svn.freebsd.org/changeset/base/203916 Log: Bump WARNS where possible. Checked by: make universe Approved by: ed (co-mentor) Modified: head/bin/rmail/Makefile head/sbin/devd/Makefile head/sbin/devfs/Makefile head/sbin/ffsinfo/Makefile head/sbin/gbde/Makefile head/sbin/mknod/Makefile head/sbin/mount_std/Makefile head/sbin/sunlabel/Makefile Modified: head/bin/rmail/Makefile ============================================================================== --- head/bin/rmail/Makefile Mon Feb 15 12:17:20 2010 (r203915) +++ head/bin/rmail/Makefile Mon Feb 15 14:07:40 2010 (r203916) @@ -11,7 +11,7 @@ PROG= rmail SRCS= rmail.c MAN= rmail.8 -WARNS?= 0 +WARNS?= 2 CFLAGS+=-I${SENDMAIL_DIR}/include -I. LIBSMDIR= ${.OBJDIR}/../../lib/libsm Modified: head/sbin/devd/Makefile ============================================================================== --- head/sbin/devd/Makefile Mon Feb 15 12:17:20 2010 (r203915) +++ head/sbin/devd/Makefile Mon Feb 15 14:07:40 2010 (r203916) @@ -4,8 +4,7 @@ PROG_CXX=devd SRCS= devd.cc token.l parse.y y.tab.h MAN= devd.8 devd.conf.5 -WARNS= 0 -#WARNS?= 4 +WARNS?= 3 NO_SHARED?=YES Modified: head/sbin/devfs/Makefile ============================================================================== --- head/sbin/devfs/Makefile Mon Feb 15 12:17:20 2010 (r203915) +++ head/sbin/devfs/Makefile Mon Feb 15 14:07:40 2010 (r203916) @@ -3,6 +3,5 @@ PROG= devfs SRCS= devfs.c rule.c MAN= devfs.8 -WARNS?= 5 .include Modified: head/sbin/ffsinfo/Makefile ============================================================================== --- head/sbin/ffsinfo/Makefile Mon Feb 15 12:17:20 2010 (r203915) +++ head/sbin/ffsinfo/Makefile Mon Feb 15 14:07:40 2010 (r203916) @@ -11,7 +11,7 @@ PROG= ffsinfo SRCS= ffsinfo.c debug.c MAN= ffsinfo.8 -WARNS?= 0 +WARNS?= 1 CFLAGS+=-DFS_DEBUG -I${GROWFS} DPADD= ${LIBUFS} LDADD= -lufs Modified: head/sbin/gbde/Makefile ============================================================================== --- head/sbin/gbde/Makefile Mon Feb 15 12:17:20 2010 (r203915) +++ head/sbin/gbde/Makefile Mon Feb 15 14:07:40 2010 (r203916) @@ -9,9 +9,7 @@ SRCS+= g_bde_lock.c # rijndael-fst.c does evil casting things which results in warnings on # 64 bit machines, the test-vectors check out however, so it works right. -.if ${MACHINE_ARCH} == "i386" -WARNS?= 5 -.else +.if ${MACHINE_ARCH} != "i386" WARNS?= 3 .endif Modified: head/sbin/mknod/Makefile ============================================================================== --- head/sbin/mknod/Makefile Mon Feb 15 12:17:20 2010 (r203915) +++ head/sbin/mknod/Makefile Mon Feb 15 14:07:40 2010 (r203916) @@ -2,7 +2,6 @@ # $FreeBSD$ PROG= mknod -WARNS?= 0 MAN= mknod.8 .include Modified: head/sbin/mount_std/Makefile ============================================================================== --- head/sbin/mount_std/Makefile Mon Feb 15 12:17:20 2010 (r203915) +++ head/sbin/mount_std/Makefile Mon Feb 15 14:07:40 2010 (r203916) @@ -11,7 +11,7 @@ MLINKS= mount_std.8 mount_devfs.8 \ MOUNT= ${.CURDIR}/../mount CFLAGS+= -I${MOUNT} -WARNS?= 0 +WARNS?= 3 .PATH: ${MOUNT} Modified: head/sbin/sunlabel/Makefile ============================================================================== --- head/sbin/sunlabel/Makefile Mon Feb 15 12:17:20 2010 (r203915) +++ head/sbin/sunlabel/Makefile Mon Feb 15 14:07:40 2010 (r203916) @@ -11,8 +11,6 @@ LINKS= ${BINDIR}/sunlabel ${BINDIR}/disk MLINKS= sunlabel.8 disklabel.8 .endif -WARNS?= 5 - DPADD= ${LIBGEOM} LDADD= -lgeom From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 14:08:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8780106568F; Mon, 15 Feb 2010 14:08:06 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A68F18FC16; Mon, 15 Feb 2010 14:08: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 o1FE869Z021439; Mon, 15 Feb 2010 14:08:06 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FE862c021436; Mon, 15 Feb 2010 14:08:06 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201002151408.o1FE862c021436@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 15 Feb 2010 14:08: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: r203917 - head/sbin/sysctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 14:08:06 -0000 Author: uqs Date: Mon Feb 15 14:08:06 2010 New Revision: 203917 URL: http://svn.freebsd.org/changeset/base/203917 Log: sysctl(8): make WARNS=3 clean Fixes inspired by work done in DragonflyBSD. PR: bin/140016 Approved by: ed (Co-mentor) Modified: head/sbin/sysctl/Makefile head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/Makefile ============================================================================== --- head/sbin/sysctl/Makefile Mon Feb 15 14:07:40 2010 (r203916) +++ head/sbin/sysctl/Makefile Mon Feb 15 14:08:06 2010 (r203917) @@ -2,7 +2,7 @@ # $FreeBSD$ PROG= sysctl -WARNS?= 0 +WARNS?= 3 MAN= sysctl.8 .include Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Mon Feb 15 14:07:40 2010 (r203916) +++ head/sbin/sysctl/sysctl.c Mon Feb 15 14:08:06 2010 (r203917) @@ -279,7 +279,10 @@ parse(char *string) case CTLTYPE_STRING: break; case CTLTYPE_QUAD: - sscanf(newval, "%qd", &quadval); + quadval = strtoq(newval, &endptr, 0); + if (endptr == newval || *endptr != '\0') + errx(1, "invalid quad integer" + " '%s'", (char *)newval); newval = &quadval; newsize = sizeof(quadval); break; @@ -334,7 +337,7 @@ S_clockinfo(int l2, void *p) struct clockinfo *ci = (struct clockinfo*)p; if (l2 != sizeof(*ci)) { - warnx("S_clockinfo %d != %d", l2, sizeof(*ci)); + warnx("S_clockinfo %d != %zu", l2, sizeof(*ci)); return (1); } printf(hflag ? "{ hz = %'d, tick = %'d, profhz = %'d, stathz = %'d }" : @@ -349,7 +352,7 @@ S_loadavg(int l2, void *p) struct loadavg *tv = (struct loadavg*)p; if (l2 != sizeof(*tv)) { - warnx("S_loadavg %d != %d", l2, sizeof(*tv)); + warnx("S_loadavg %d != %zu", l2, sizeof(*tv)); return (1); } printf(hflag ? "{ %'.2f %'.2f %'.2f }" : "{ %.2f %.2f %.2f }", @@ -367,7 +370,7 @@ S_timeval(int l2, void *p) char *p1, *p2; if (l2 != sizeof(*tv)) { - warnx("S_timeval %d != %d", l2, sizeof(*tv)); + warnx("S_timeval %d != %zu", l2, sizeof(*tv)); return (1); } printf(hflag ? "{ sec = %'jd, usec = %'ld } " : @@ -389,7 +392,7 @@ S_vmtotal(int l2, void *p) int pageKilo = getpagesize() / 1024; if (l2 != sizeof(*v)) { - warnx("S_vmtotal %d != %d", l2, sizeof(*v)); + warnx("S_vmtotal %d != %zu", l2, sizeof(*v)); return (1); } @@ -421,7 +424,7 @@ T_dev_t(int l2, void *p) dev_t *d = (dev_t *)p; if (l2 != sizeof(*d)) { - warnx("T_dev_T %d != %d", l2, sizeof(*d)); + warnx("T_dev_T %d != %zu", l2, sizeof(*d)); return (1); } printf("%s", devname(*d, S_IFCHR)); @@ -518,7 +521,7 @@ oidfmt(int *oid, int len, char *fmt, u_i j = sizeof(buf); i = sysctl(qoid, len + 2, buf, &j, 0, 0); if (i) - err(1, "sysctl fmt %d %d %d", i, j, errno); + err(1, "sysctl fmt %d %zu %d", i, j, errno); if (kind) *kind = *(u_int *)buf; @@ -551,6 +554,9 @@ show_var(int *oid, int nlen) u_int kind; int (*func)(int, void *); + /* Silence GCC. */ + umv = mv = intlen = 0; + bzero(buf, BUFSIZ); bzero(name, BUFSIZ); qoid[0] = 0; @@ -560,7 +566,7 @@ show_var(int *oid, int nlen) j = sizeof(name); i = sysctl(qoid, nlen + 2, name, &j, 0, 0); if (i || !j) - err(1, "sysctl name %d %d %d", i, j, errno); + err(1, "sysctl name %d %zu %d", i, j, errno); if (Nflag) { printf("%s", name); @@ -611,7 +617,7 @@ show_var(int *oid, int nlen) case 'A': if (!nflag) printf("%s%s", name, sep); - printf("%.*s", len, p); + printf("%.*s", (int)len, p); free(oval); return (0); @@ -698,7 +704,7 @@ show_var(int *oid, int nlen) } if (!nflag) printf("%s%s", name, sep); - printf("Format:%s Length:%d Dump:0x", fmt, len); + printf("Format:%s Length:%zu Dump:0x", fmt, len); while (len-- && (xflag || p < val + 16)) printf("%02x", *p++); if (!xflag && len > 16) @@ -734,7 +740,7 @@ sysctl_all(int *oid, int len) if (errno == ENOENT) return (0); else - err(1, "sysctl(getnext) %d %d", j, l2); + err(1, "sysctl(getnext) %d %zu", j, l2); } l2 /= sizeof(int); From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 14:14:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CD231065693; Mon, 15 Feb 2010 14:14:14 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1810E8FC16; Mon, 15 Feb 2010 14:14: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 o1FEEDJV022836; Mon, 15 Feb 2010 14:14:13 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FEEDoT022833; Mon, 15 Feb 2010 14:14:13 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002151414.o1FEEDoT022833@svn.freebsd.org> From: Ruslan Ermilov Date: Mon, 15 Feb 2010 14:14: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: r203918 - in head/lib: libc_r libkse X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 14:14:14 -0000 Author: ru Date: Mon Feb 15 14:14:13 2010 New Revision: 203918 URL: http://svn.freebsd.org/changeset/base/203918 Log: Though these libraries are disconnected from the build and don't currently build, they should be kept. [1] Unbreak their makefiles by removing the support for the long gone DEFAULT_THREAD_LIB knob. (Allows the tools/make_libdeps.sh script to succeed.) According to: davidxu and deischen [1] MFC after: 3 days Modified: head/lib/libc_r/Makefile head/lib/libkse/Makefile Modified: head/lib/libc_r/Makefile ============================================================================== --- head/lib/libc_r/Makefile Mon Feb 15 14:08:06 2010 (r203917) +++ head/lib/libc_r/Makefile Mon Feb 15 14:14:13 2010 (r203918) @@ -10,10 +10,6 @@ .include -.if ${DEFAULT_THREAD_LIB} == "libc_r" && ${SHLIBDIR} == "/usr/lib" -SHLIBDIR= /lib -.endif - LIB=c_r SHLIB_MAJOR= 7 CFLAGS+=-DPTHREAD_KERNEL @@ -32,16 +28,4 @@ PRECIOUSLIB= .include "${.CURDIR}/uthread/Makefile.inc" .include "${.CURDIR}/sys/Makefile.inc" -.if ${DEFAULT_THREAD_LIB} == "libc_r" -.if ${MK_INSTALLLIB} != "no" -SYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a -.endif -.if !defined(NO_PIC) -SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so -.endif -.if ${MK_PROFILE} != "no" -SYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpthread_p.a -.endif -.endif - .include Modified: head/lib/libkse/Makefile ============================================================================== --- head/lib/libkse/Makefile Mon Feb 15 14:08:06 2010 (r203917) +++ head/lib/libkse/Makefile Mon Feb 15 14:14:13 2010 (r203918) @@ -10,15 +10,7 @@ .include -.if ${DEFAULT_THREAD_LIB} == "libkse" || ${MK_LIBTHR} == "no" -LIB=kse -.if ${SHLIBDIR} == "/usr/lib" -SHLIBDIR= /lib -.endif -.else SHLIB=kse -.endif - SHLIB_MAJOR= 4 CFLAGS+=-DPTHREAD_KERNEL CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR}/thread \ @@ -51,16 +43,4 @@ PRECIOUSLIB= .include "${.CURDIR}/sys/Makefile.inc" .include "${.CURDIR}/thread/Makefile.inc" -.if ${DEFAULT_THREAD_LIB} == "libkse" || ${MK_LIBTHR} == "no" -.if ${MK_INSTALLLIB} != "no" -SYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a -.endif -.if !defined(NO_PIC) -SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so -.endif -.if ${MK_PROFILE} != "no" -SYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpthread_p.a -.endif -.endif - .include From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 14:29:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E003106568F; Mon, 15 Feb 2010 14:29:17 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D0008FC13; Mon, 15 Feb 2010 14:29: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 o1FETHX0026202; Mon, 15 Feb 2010 14:29:17 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FETHov026200; Mon, 15 Feb 2010 14:29:17 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002151429.o1FETHov026200@svn.freebsd.org> From: Ruslan Ermilov Date: Mon, 15 Feb 2010 14:29: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: r203919 - head/usr.sbin/arp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 14:29:17 -0000 Author: ru Date: Mon Feb 15 14:29:17 2010 New Revision: 203919 URL: http://svn.freebsd.org/changeset/base/203919 Log: Show when an ARP entry expires. MFC after: 1 week Modified: head/usr.sbin/arp/arp.c Modified: head/usr.sbin/arp/arp.c ============================================================================== --- head/usr.sbin/arp/arp.c Mon Feb 15 14:14:13 2010 (r203918) +++ head/usr.sbin/arp/arp.c Mon Feb 15 14:29:17 2010 (r203919) @@ -101,7 +101,8 @@ static int valid_type(int type); static int nflag; /* no reverse dns lookups */ static char *rifname; -static int expire_time, flags, doing_proxy, proxy_only; +static time_t expire_time; +static int flags, doing_proxy, proxy_only; /* which function we're supposed to do */ #define F_GET 1 @@ -594,6 +595,15 @@ print_entry(struct sockaddr_dl *sdl, printf(" on %s", ifname); if (rtm->rtm_rmx.rmx_expire == 0) printf(" permanent"); + else { + static struct timeval tv; + if (tv.tv_sec == 0) + gettimeofday(&tv, 0); + if ((expire_time = rtm->rtm_rmx.rmx_expire - tv.tv_sec) > 0) + printf(" expires in %d seconds", (int)expire_time); + else + printf(" expired"); + } if (addr->sin_other & SIN_PROXY) printf(" published (proxy only)"); if (rtm->rtm_flags & RTF_ANNOUNCE) From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 14:30:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FBDE1065679; Mon, 15 Feb 2010 14:30:37 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F57C8FC0A; Mon, 15 Feb 2010 14:30: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 o1FEUbOH026515; Mon, 15 Feb 2010 14:30:37 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FEUbfE026512; Mon, 15 Feb 2010 14:30:37 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201002151430.o1FEUbfE026512@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 15 Feb 2010 14:30: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: r203920 - head/games/grdc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 14:30:37 -0000 Author: uqs Date: Mon Feb 15 14:30:37 2010 New Revision: 203920 URL: http://svn.freebsd.org/changeset/base/203920 Log: grdc(6) make WARNS=6 clean and bump accordingly Approved by: ed (Co-mentor) Modified: head/games/grdc/Makefile head/games/grdc/grdc.c Modified: head/games/grdc/Makefile ============================================================================== --- head/games/grdc/Makefile Mon Feb 15 14:29:17 2010 (r203919) +++ head/games/grdc/Makefile Mon Feb 15 14:30:37 2010 (r203920) @@ -1,9 +1,9 @@ # $FreeBSD$ -PROG= grdc -WARNS?= 2 -MAN= grdc.6 -DPADD= ${LIBNCURSES} -LDADD= -lncurses +PROG= grdc +MAN= grdc.6 +WARNS?= 6 +DPADD= ${LIBNCURSES} +LDADD= -lncurses .include Modified: head/games/grdc/grdc.c ============================================================================== --- head/games/grdc/grdc.c Mon Feb 15 14:29:17 2010 (r203919) +++ head/games/grdc/grdc.c Mon Feb 15 14:30:37 2010 (r203920) @@ -48,24 +48,22 @@ void movto(int, int); void sighndl(int); void usage(void); -void sighndl(signo) -int signo; +void +sighndl(int signo) { sigtermed=signo; } int -main(argc, argv) -int argc; -char **argv; -{ -struct timespec ts; -long t, a; -int i, j, s, k; -int n; -int ch; -int scrol; -int t12; +main(int argc, char *argv[]) +{ + struct timespec ts; + long t, a; + int i, j, s, k; + int n; + int ch; + int scrol; + int t12; t12 = scrol = 0; @@ -225,7 +223,7 @@ int t12; void set(int t, int n) { -int i, m; + int i, m; m = 7< Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24DDB1065694; Mon, 15 Feb 2010 14:31:06 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1430C8FC0A; Mon, 15 Feb 2010 14:31: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 o1FEV59J026679; Mon, 15 Feb 2010 14:31:05 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FEV56B026677; Mon, 15 Feb 2010 14:31:05 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201002151431.o1FEV56B026677@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 15 Feb 2010 14:31: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: r203921 - head/games/morse X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 14:31:06 -0000 Author: uqs Date: Mon Feb 15 14:31:05 2010 New Revision: 203921 URL: http://svn.freebsd.org/changeset/base/203921 Log: morse(6) make WARNS=6 clean Approved by: ed (Co-mentor) Modified: head/games/morse/morse.c Modified: head/games/morse/morse.c ============================================================================== --- head/games/morse/morse.c Mon Feb 15 14:30:37 2010 (r203920) +++ head/games/morse/morse.c Mon Feb 15 14:31:05 2010 (r203921) @@ -71,8 +71,8 @@ static const char rcsid[] = #endif struct morsetab { - char inchar; - char *morse; + const char inchar; + const char *morse; }; static const struct morsetab mtab[] = { From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 14:31:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C4A2106566B; Mon, 15 Feb 2010 14:31:31 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A2BC8FC19; Mon, 15 Feb 2010 14:31: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 o1FEVV7a026780; Mon, 15 Feb 2010 14:31:31 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FEVV87026778; Mon, 15 Feb 2010 14:31:31 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201002151431.o1FEVV87026778@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 15 Feb 2010 14:31: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: r203922 - head/games/fortune/fortune X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 14:31:31 -0000 Author: uqs Date: Mon Feb 15 14:31:30 2010 New Revision: 203922 URL: http://svn.freebsd.org/changeset/base/203922 Log: fortune(6) make WARNS=6 clean Fixes taken mostly from DragonflyBSD. Approved by: ed (Co-mentor) Modified: head/games/fortune/fortune/fortune.c Modified: head/games/fortune/fortune/fortune.c ============================================================================== --- head/games/fortune/fortune/fortune.c Mon Feb 15 14:31:05 2010 (r203921) +++ head/games/fortune/fortune/fortune.c Mon Feb 15 14:31:30 2010 (r203922) @@ -89,8 +89,8 @@ typedef struct fd { int fd, datfd; uint32_t pos; FILE *inf; - char *name; - char *path; + const char *name; + const char *path; char *datfile, *posfile; bool read_tbl; bool was_pos_file; @@ -126,14 +126,14 @@ FILEDESC *Fortfile; /* Fortune file to STRFILE Noprob_tbl; /* sum of data for all no prob files */ -char *Fortune_path; +const char *Fortune_path; char **Fortune_path_arr; int add_dir(FILEDESC *); -int add_file __P((int, - char *, char *, FILEDESC **, FILEDESC **, FILEDESC *)); +int add_file(int, const char *, const char *, FILEDESC **, FILEDESC **, + FILEDESC *); void all_forts(FILEDESC *, char *); -char *copy(char *, u_int); +char *copy(const char *, u_int); void display(FILEDESC *); void do_free(void *); void *do_malloc(u_int); @@ -145,13 +145,13 @@ void get_tbl(FILEDESC *); void getargs(int, char *[]); void getpath(void); void init_prob(void); -int is_dir(char *); -int is_fortfile(char *, char **, char **, int); -int is_off_name(char *); +int is_dir(const char *); +int is_fortfile(const char *, char **, char **, int); +int is_off_name(const char *); int max(int, int); FILEDESC * new_fp(void); -char *off_name(char *); +char *off_name(const char *); void open_dat(FILEDESC *); void open_fp(FILEDESC *); FILEDESC * @@ -171,9 +171,7 @@ int maxlen_in_list(FILEDESC *); static regex_t Re_pat; int -main(ac, av) -int ac; -char *av[]; +main(int argc, char *argv[]) { #ifdef OK_TO_WRITE_DISK int fd; @@ -182,7 +180,7 @@ char *av[]; (void) setlocale(LC_ALL, ""); getpath(); - getargs(ac, av); + getargs(argc, argv); if (Match) exit(find_matches() != 0); @@ -225,8 +223,7 @@ char *av[]; } void -display(fp) -FILEDESC *fp; +display(FILEDESC *fp) { char *p; unsigned char ch; @@ -259,7 +256,7 @@ FILEDESC *fp; * Return the length of the fortune. */ int -fortlen() +fortlen(void) { int nchar; char line[BUFSIZ]; @@ -282,14 +279,10 @@ fortlen() * This routine evaluates the arguments on the command line */ void -getargs(argc, argv) -int argc; -char **argv; +getargs(int argc, char *argv[]) { int ignore_case; char *pat; - extern char *optarg; - extern int optind; int ch; ignore_case = FALSE; @@ -372,9 +365,7 @@ char **argv; * Form the file list from the file specifications. */ int -form_file_list(files, file_cnt) -char **files; -int file_cnt; +form_file_list(char **files, int file_cnt) { int i, percent; char *sp; @@ -467,31 +458,30 @@ int file_cnt; * Add a file to the file list. */ int -add_file(percent, file, dir, head, tail, parent) -int percent; -char *file; -char *dir; -FILEDESC **head, **tail; -FILEDESC *parent; +add_file(int percent, const char *file, const char *dir, FILEDESC **head, + FILEDESC **tail, FILEDESC *parent) { FILEDESC *fp; int fd; - char *path, *offensive; + const char *path; + char *tpath, *offensive; bool was_malloc; bool isdir; if (dir == NULL) { path = file; + tpath = NULL; was_malloc = FALSE; } else { - path = do_malloc((unsigned int) (strlen(dir) + strlen(file) + 2)); - (void) strcat(strcat(strcpy(path, dir), "/"), file); + tpath = do_malloc((unsigned int)(strlen(dir) + strlen(file) + 2)); + strcat(strcat(strcpy(tpath, dir), "/"), file); + path = tpath; was_malloc = TRUE; } if ((isdir = is_dir(path)) && parent != NULL) { if (was_malloc) - free(path); + free(tpath); return FALSE; /* don't recurse */ } offensive = NULL; @@ -500,7 +490,7 @@ FILEDESC *parent; offensive = off_name(path); if (Offend) { if (was_malloc) - free(path); + free(tpath); path = offensive; offensive = NULL; was_malloc = TRUE; @@ -522,7 +512,7 @@ over: */ if (All_forts && offensive != NULL) { if (was_malloc) - free(path); + free(tpath); path = offensive; offensive = NULL; was_malloc = TRUE; @@ -549,7 +539,7 @@ over: perror(path); */ if (was_malloc) - free(path); + free(tpath); return FALSE; } @@ -571,7 +561,7 @@ over: "fortune:%s not a fortune file or directory\n", path); if (was_malloc) - free(path); + free(tpath); do_free(fp->datfile); do_free(fp->posfile); free((char *) fp); @@ -610,7 +600,7 @@ over: * Return a pointer to an initialized new FILEDESC. */ FILEDESC * -new_fp() +new_fp(void) { FILEDESC *fp; @@ -635,8 +625,7 @@ new_fp() * Return a pointer to the offensive version of a file of this name. */ char * -off_name(file) -char *file; +off_name(const char *file) { char *new; @@ -649,8 +638,7 @@ char *file; * Is the file an offensive-style name? */ int -is_off_name(file) -char *file; +is_off_name(const char *file) { int len; @@ -664,9 +652,7 @@ char *file; * there are two children to be a parent of. */ void -all_forts(fp, offensive) -FILEDESC *fp; -char *offensive; +all_forts(FILEDESC *fp, char *offensive) { char *sp; FILEDESC *scene, *obscene; @@ -714,8 +700,7 @@ char *offensive; * Add the contents of an entire directory. */ int -add_dir(fp) -FILEDESC *fp; +add_dir(FILEDESC *fp) { DIR *dir; struct dirent *dirent; @@ -753,8 +738,7 @@ FILEDESC *fp; * Return TRUE if the file is a directory, FALSE otherwise. */ int -is_dir(file) -char *file; +is_dir(const char *file) { auto struct stat sbuf; @@ -772,19 +756,18 @@ char *file; */ /* ARGSUSED */ int -is_fortfile(file, datp, posp, check_for_offend) -char *file, **datp, **posp; -int check_for_offend; +is_fortfile(const char *file, char **datp, char **posp, int check_for_offend) { int i; - char *sp; + const char *sp; char *datfile; - static char *suflist[] = { /* list of "illegal" suffixes" */ - "dat", "pos", "c", "h", "p", "i", "f", - "pas", "ftn", "ins.c", "ins,pas", - "ins.ftn", "sml", - NULL - }; + static const char *suflist[] = { + /* list of "illegal" suffixes" */ + "dat", "pos", "c", "h", "p", "i", "f", + "pas", "ftn", "ins.c", "ins,pas", + "ins.ftn", "sml", + NULL + }; DPRINTF(2, (stderr, "is_fortfile(%s) returns ", file)); @@ -853,9 +836,7 @@ int check_for_offend; * Return a malloc()'ed copy of the string */ char * -copy(str, len) -char *str; -unsigned int len; +copy(const char *str, unsigned int len) { char *new, *sp; @@ -872,8 +853,7 @@ unsigned int len; * Do a malloc, checking for NULL return. */ void * -do_malloc(size) -unsigned int size; +do_malloc(unsigned int size) { void *new; @@ -889,8 +869,7 @@ unsigned int size; * Free malloc'ed space, if any. */ void -do_free(ptr) -void *ptr; +do_free(void *ptr) { if (ptr != NULL) free(ptr); @@ -901,7 +880,7 @@ void *ptr; * Initialize the fortune probabilities. */ void -init_prob() +init_prob(void) { FILEDESC *fp, *last = NULL; int percent, num_noprob, frac; @@ -955,8 +934,8 @@ init_prob() last->percent = percent; DPRINTF(1, (stderr, ", residual = %d%%", percent)); } - else - DPRINTF(1, (stderr, + else + DPRINTF(1, (stderr, ", %d%% distributed over remaining fortunes\n", percent)); } @@ -973,7 +952,7 @@ init_prob() * Get the fortune data file's seek pointer for the next fortune. */ void -get_fort() +get_fort(void) { FILEDESC *fp; int choice; @@ -1004,7 +983,7 @@ get_fort() choice = arc4random_uniform(Noprob_tbl.str_numstr); DPRINTF(1, (stderr, "choice = %d (of %u) \n", choice, Noprob_tbl.str_numstr)); - while (choice >= fp->tbl.str_numstr) { + while ((unsigned int)choice >= fp->tbl.str_numstr) { choice -= fp->tbl.str_numstr; fp = fp->next; DPRINTF(1, (stderr, @@ -1036,8 +1015,7 @@ get_fort() * Pick a child from a chosen parent. */ FILEDESC * -pick_child(parent) -FILEDESC *parent; +pick_child(FILEDESC *parent) { FILEDESC *fp; int choice; @@ -1056,7 +1034,7 @@ FILEDESC *parent; choice = arc4random_uniform(parent->tbl.str_numstr); DPRINTF(1, (stderr, " choice = %d (of %u)\n", choice, parent->tbl.str_numstr)); - for (fp = parent->child; choice >= fp->tbl.str_numstr; + for (fp = parent->child; (unsigned)choice >= fp->tbl.str_numstr; fp = fp->next) { choice -= fp->tbl.str_numstr; DPRINTF(1, (stderr, "\tskip %s, %u (choice = %d)\n", @@ -1073,8 +1051,7 @@ FILEDESC *parent; * Sum up all the noprob probabilities, starting with fp. */ void -sum_noprobs(fp) -FILEDESC *fp; +sum_noprobs(FILEDESC *fp) { static bool did_noprobs = FALSE; @@ -1090,8 +1067,7 @@ FILEDESC *fp; } int -max(i, j) -int i, j; +max(int i, int j) { return (i >= j ? i : j); } @@ -1101,8 +1077,7 @@ int i, j; * Assocatiate a FILE * with the given FILEDESC. */ void -open_fp(fp) -FILEDESC *fp; +open_fp(FILEDESC *fp) { if (fp->inf == NULL && (fp->inf = fdopen(fp->fd, "r")) == NULL) { perror(fp->path); @@ -1115,8 +1090,7 @@ FILEDESC *fp; * Open up the dat file if we need to. */ void -open_dat(fp) -FILEDESC *fp; +open_dat(FILEDESC *fp) { if (fp->datfd < 0 && (fp->datfd = open(fp->datfile, 0)) < 0) { perror(fp->datfile); @@ -1130,8 +1104,7 @@ FILEDESC *fp; * return a random number. */ void -get_pos(fp) -FILEDESC *fp; +get_pos(FILEDESC *fp) { #ifdef OK_TO_WRITE_DISK int fd; @@ -1161,8 +1134,7 @@ FILEDESC *fp; * Get the tbl data file the datfile. */ void -get_tbl(fp) -FILEDESC *fp; +get_tbl(FILEDESC *fp) { auto int fd; FILEDESC *child; @@ -1201,8 +1173,7 @@ FILEDESC *fp; * Zero out the fields we care about in a tbl structure. */ void -zero_tbl(tp) -STRFILE *tp; +zero_tbl(STRFILE *tp) { tp->str_numstr = 0; tp->str_longlen = 0; @@ -1214,8 +1185,7 @@ STRFILE *tp; * Merge the tbl data of t2 into t1. */ void -sum_tbl(t1, t2) -STRFILE *t1, *t2; +sum_tbl(STRFILE *t1, STRFILE *t2) { t1->str_numstr += t2->str_numstr; if (t1->str_longlen < t2->str_longlen) @@ -1231,7 +1201,7 @@ STRFILE *t1, *t2; * Print out the file list */ void -print_file_list() +print_file_list(void) { print_list(File_list, 0); } @@ -1241,9 +1211,7 @@ print_file_list() * Print out the actual list, recursively. */ void -print_list(list, lev) -FILEDESC *list; -int lev; +print_list(FILEDESC *list, int lev) { while (list != NULL) { fprintf(stderr, "%*s", lev * 4, ""); @@ -1266,8 +1234,7 @@ int lev; * Convert the pattern to an ignore-case equivalent. */ char * -conv_pat(orig) -char *orig; +conv_pat(char *orig) { char *sp; unsigned int cnt; @@ -1309,7 +1276,7 @@ char *orig; * Find all the fortunes which match the pattern we've been given. */ int -find_matches() +find_matches(void) { Fort_len = maxlen_in_list(File_list); DPRINTF(2, (stderr, "Maximum length is %d\n", Fort_len)); @@ -1327,8 +1294,7 @@ find_matches() * Return the maximum fortune len in the file list. */ int -maxlen_in_list(list) -FILEDESC *list; +maxlen_in_list(FILEDESC *list) { FILEDESC *fp; int len, maxlen; @@ -1341,7 +1307,7 @@ FILEDESC *list; } else { get_tbl(fp); - if (fp->tbl.str_longlen > maxlen) + if (fp->tbl.str_longlen > (unsigned)maxlen) maxlen = fp->tbl.str_longlen; } } @@ -1353,8 +1319,7 @@ FILEDESC *list; * Print out the matches from the files in the list. */ void -matches_in_list(list) -FILEDESC *list; +matches_in_list(FILEDESC *list) { char *sp, *p; FILEDESC *fp; @@ -1405,7 +1370,7 @@ FILEDESC *list; } void -usage() +usage(void) { (void) fprintf(stderr, "fortune [-a"); #ifdef DEBUG @@ -1462,6 +1427,6 @@ getpath(void) exit(1); } free(path); - Fortune_path_arr[0] = FORTDIR; + Fortune_path_arr[0] = strdup(FORTDIR); } } From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 14:32:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E58A71065676; Mon, 15 Feb 2010 14:32:02 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D39CA8FC20; Mon, 15 Feb 2010 14:32: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 o1FEW2Ui026954; Mon, 15 Feb 2010 14:32:02 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FEW01S026940; Mon, 15 Feb 2010 14:32:00 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201002151432.o1FEW01S026940@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 15 Feb 2010 14:32: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: r203923 - in head/games: . bcd caesar fortune/fortune fortune/strfile fortune/unstr grdc number pom ppt random X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 14:32:03 -0000 Author: uqs Date: Mon Feb 15 14:32:00 2010 New Revision: 203923 URL: http://svn.freebsd.org/changeset/base/203923 Log: games: make WARNS=6 the default, remove overrides This also bumps factor, fortune, primes, and random to WARNS=6. Approved by: ed (Co-mentor) Modified: head/games/Makefile.inc head/games/bcd/Makefile head/games/caesar/Makefile head/games/fortune/fortune/Makefile head/games/fortune/strfile/Makefile head/games/fortune/unstr/Makefile head/games/grdc/Makefile head/games/number/Makefile head/games/pom/Makefile head/games/ppt/Makefile head/games/random/Makefile Modified: head/games/Makefile.inc ============================================================================== --- head/games/Makefile.inc Mon Feb 15 14:31:30 2010 (r203922) +++ head/games/Makefile.inc Mon Feb 15 14:32:00 2010 (r203923) @@ -3,3 +3,4 @@ BINDIR?= /usr/games FILESDIR?= ${SHAREDIR}/games +WARNS?= 6 Modified: head/games/bcd/Makefile ============================================================================== --- head/games/bcd/Makefile Mon Feb 15 14:31:30 2010 (r203922) +++ head/games/bcd/Makefile Mon Feb 15 14:32:00 2010 (r203923) @@ -2,7 +2,6 @@ # $FreeBSD$ PROG= bcd -WARNS?= 6 MAN= bcd.6 MLINKS= bcd.6 ppt.6 Modified: head/games/caesar/Makefile ============================================================================== --- head/games/caesar/Makefile Mon Feb 15 14:31:30 2010 (r203922) +++ head/games/caesar/Makefile Mon Feb 15 14:32:00 2010 (r203923) @@ -8,6 +8,4 @@ SCRIPTS=rot13.sh MAN= caesar.6 MLINKS= caesar.6 rot13.6 -WARNS?= 6 - .include Modified: head/games/fortune/fortune/Makefile ============================================================================== --- head/games/fortune/fortune/Makefile Mon Feb 15 14:31:30 2010 (r203922) +++ head/games/fortune/fortune/Makefile Mon Feb 15 14:32:00 2010 (r203923) @@ -3,7 +3,6 @@ PROG= fortune MAN= fortune.6 -WARNS?= 2 CFLAGS+=-DDEBUG -I${.CURDIR}/../strfile .include Modified: head/games/fortune/strfile/Makefile ============================================================================== --- head/games/fortune/strfile/Makefile Mon Feb 15 14:31:30 2010 (r203922) +++ head/games/fortune/strfile/Makefile Mon Feb 15 14:32:00 2010 (r203923) @@ -4,6 +4,5 @@ PROG= strfile MAN= strfile.8 MLINKS= strfile.8 unstr.8 -WARNS?= 6 .include Modified: head/games/fortune/unstr/Makefile ============================================================================== --- head/games/fortune/unstr/Makefile Mon Feb 15 14:31:30 2010 (r203922) +++ head/games/fortune/unstr/Makefile Mon Feb 15 14:32:00 2010 (r203923) @@ -3,7 +3,6 @@ PROG= unstr NO_MAN= -WARNS?= 6 CFLAGS+= -I${.CURDIR}/../strfile .include Modified: head/games/grdc/Makefile ============================================================================== --- head/games/grdc/Makefile Mon Feb 15 14:31:30 2010 (r203922) +++ head/games/grdc/Makefile Mon Feb 15 14:32:00 2010 (r203923) @@ -2,7 +2,6 @@ PROG= grdc MAN= grdc.6 -WARNS?= 6 DPADD= ${LIBNCURSES} LDADD= -lncurses Modified: head/games/number/Makefile ============================================================================== --- head/games/number/Makefile Mon Feb 15 14:31:30 2010 (r203922) +++ head/games/number/Makefile Mon Feb 15 14:32:00 2010 (r203923) @@ -4,6 +4,4 @@ PROG= number MAN= number.6 -WARNS?= 6 - .include Modified: head/games/pom/Makefile ============================================================================== --- head/games/pom/Makefile Mon Feb 15 14:31:30 2010 (r203922) +++ head/games/pom/Makefile Mon Feb 15 14:32:00 2010 (r203923) @@ -6,6 +6,4 @@ MAN= pom.6 DPADD= ${LIBM} LDADD= -lm -WARNS?= 6 - .include Modified: head/games/ppt/Makefile ============================================================================== --- head/games/ppt/Makefile Mon Feb 15 14:31:30 2010 (r203922) +++ head/games/ppt/Makefile Mon Feb 15 14:32:00 2010 (r203923) @@ -4,7 +4,5 @@ PROG= ppt NO_MAN= -WARNS?= 6 - .include Modified: head/games/random/Makefile ============================================================================== --- head/games/random/Makefile Mon Feb 15 14:31:30 2010 (r203922) +++ head/games/random/Makefile Mon Feb 15 14:32:00 2010 (r203923) @@ -4,6 +4,5 @@ PROG= random MAN= random.6 SRCS= random.c randomize_fd.c -WARNS?= 5 .include From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 14:38:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDD101065672; Mon, 15 Feb 2010 14:38:30 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD2B38FC1B; Mon, 15 Feb 2010 14:38:30 +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 o1FEcUXo028467; Mon, 15 Feb 2010 14:38:30 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FEcUxq028465; Mon, 15 Feb 2010 14:38:30 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201002151438.o1FEcUxq028465@svn.freebsd.org> From: Rafal Jaworowski Date: Mon, 15 Feb 2010 14:38: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: r203924 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 14:38:31 -0000 Author: raj Date: Mon Feb 15 14:38:30 2010 New Revision: 203924 URL: http://svn.freebsd.org/changeset/base/203924 Log: Call the proper linkup routine in PowerPC Book-E machdep. Submitted by: attilio MFC after: 1 week Modified: head/sys/powerpc/booke/machdep.c Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Mon Feb 15 14:32:00 2010 (r203923) +++ head/sys/powerpc/booke/machdep.c Mon Feb 15 14:38:30 2010 (r203924) @@ -384,7 +384,7 @@ e500_init(u_int32_t startkernel, u_int32 init_param1(); /* Start initializing proc0 and thread0. */ - proc_linkup(&proc0, &thread0); + proc_linkup0(&proc0, &thread0); thread0.td_frame = &frame0; /* Set up per-cpu data and store the pointer in SPR general 0. */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 15:10:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F47E106566C; Mon, 15 Feb 2010 15:10:22 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C8908FC1B; Mon, 15 Feb 2010 15:10: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 o1FFAMOI035658; Mon, 15 Feb 2010 15:10:22 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FFAMgv035651; Mon, 15 Feb 2010 15:10:22 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201002151510.o1FFAMgv035651@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 15 Feb 2010 15:10: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: r203926 - in head/games/fortune: fortune strfile unstr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 15:10:22 -0000 Author: uqs Date: Mon Feb 15 15:10:21 2010 New Revision: 203926 URL: http://svn.freebsd.org/changeset/base/203926 Log: fortune(6) switch to 3-clause BSDL; style(9) This reduces the diff to other *BSD and makes it possible to actually see the code differences. Approved by: ed (Co-mentor) Modified: head/games/fortune/fortune/fortune.6 head/games/fortune/fortune/fortune.c head/games/fortune/fortune/pathnames.h head/games/fortune/strfile/strfile.8 head/games/fortune/strfile/strfile.c head/games/fortune/strfile/strfile.h head/games/fortune/unstr/unstr.c Modified: head/games/fortune/fortune/fortune.6 ============================================================================== --- head/games/fortune/fortune/fortune.6 Mon Feb 15 15:00:40 2010 (r203925) +++ head/games/fortune/fortune/fortune.6 Mon Feb 15 15:10:21 2010 (r203926) @@ -12,11 +12,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/games/fortune/fortune/fortune.c ============================================================================== --- head/games/fortune/fortune/fortune.c Mon Feb 15 15:00:40 2010 (r203925) +++ head/games/fortune/fortune/fortune.c Mon Feb 15 15:10:21 2010 (r203926) @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -48,41 +44,42 @@ static const char sccsid[] = "@(#)fortun #include __FBSDID("$FreeBSD$"); -# include -# include +#include +#include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include "strfile.h" -# include "pathnames.h" - -# define TRUE 1 -# define FALSE 0 -# define bool short - -# define MINW 6 /* minimum wait if desired */ -# define CPERS 20 /* # of chars for each sec */ -# define SLEN 160 /* # of chars in short fortune */ - -# define POS_UNKNOWN ((uint32_t) -1) /* pos for file unknown */ -# define NO_PROB (-1) /* no prob specified for file */ - -# ifdef DEBUG -# define DPRINTF(l,x) { if (Debug >= l) fprintf x; } -# undef NDEBUG -# else -# define DPRINTF(l,x) -# define NDEBUG 1 -# endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "strfile.h" +#include "pathnames.h" + +#define TRUE 1 +#define FALSE 0 +#define bool short + +#define MINW 6 /* minimum wait if desired */ +#define CPERS 20 /* # of chars for each sec */ +#define SLEN 160 /* # of chars in short fortune */ + +#define POS_UNKNOWN ((uint32_t) -1) /* pos for file unknown */ +#define NO_PROB (-1) /* no prob specified for file */ + +#ifdef DEBUG +#define DPRINTF(l,x) { if (Debug >= l) fprintf x; } +#undef NDEBUG +#else +#define DPRINTF(l,x) +#define NDEBUG 1 +#endif typedef struct fd { int percent; @@ -102,7 +99,7 @@ typedef struct fd { bool Found_one; /* did we find a match? */ bool Find_files = FALSE; /* just find a list of proper fortune files */ -bool Fortunes_only = FALSE; /* check only "fortunes" files */ +bool Fortunes_only = FALSE; /* check only "fortunes" files */ bool Wait = FALSE; /* wait desired after fortune */ bool Short_only = FALSE; /* short fortune desired */ bool Long_only = FALSE; /* long fortune desired */ @@ -173,9 +170,9 @@ static regex_t Re_pat; int main(int argc, char *argv[]) { -#ifdef OK_TO_WRITE_DISK +#ifdef OK_TO_WRITE_DISK int fd; -#endif /* OK_TO_WRITE_DISK */ +#endif /* OK_TO_WRITE_DISK */ (void) setlocale(LC_ALL, ""); @@ -193,33 +190,33 @@ main(int argc, char *argv[]) display(Fortfile); -#ifdef OK_TO_WRITE_DISK +#ifdef OK_TO_WRITE_DISK if ((fd = creat(Fortfile->posfile, 0666)) < 0) { perror(Fortfile->posfile); exit(1); } -#ifdef LOCK_EX +#ifdef LOCK_EX /* * if we can, we exclusive lock, but since it isn't very * important, we just punt if we don't have easy locking * available. */ (void) flock(fd, LOCK_EX); -#endif /* LOCK_EX */ +#endif /* LOCK_EX */ write(fd, (char *) &Fortfile->pos, sizeof Fortfile->pos); if (!Fortfile->was_pos_file) (void) chmod(Fortfile->path, 0666); -#ifdef LOCK_EX +#ifdef LOCK_EX (void) flock(fd, LOCK_UN); -#endif /* LOCK_EX */ -#endif /* OK_TO_WRITE_DISK */ +#endif /* LOCK_EX */ +#endif /* OK_TO_WRITE_DISK */ if (Wait) { if (Fort_len == 0) (void) fortlen(); sleep((unsigned int) max(Fort_len / CPERS, MINW)); } - exit(0); - /* NOTREACHED */ + + return (0); } void @@ -230,7 +227,7 @@ display(FILEDESC *fp) char line[BUFSIZ]; open_fp(fp); - (void) fseeko(fp->inf, Seekpts[0], 0); + fseeko(fp->inf, Seekpts[0], SEEK_SET); for (Fort_len = 0; fgets(line, sizeof line, fp->inf) != NULL && !STR_ENDSTRING(line, fp->tbl); Fort_len++) { if (fp->tbl.str_flags & STR_ROTATED) @@ -265,14 +262,15 @@ fortlen(void) nchar = (int)(Seekpts[1] - Seekpts[0]); else { open_fp(Fortfile); - (void) fseeko(Fortfile->inf, Seekpts[0], 0); + fseeko(Fortfile->inf, Seekpts[0], SEEK_SET); nchar = 0; while (fgets(line, sizeof line, Fortfile->inf) != NULL && !STR_ENDSTRING(line, Fortfile->tbl)) nchar += strlen(line); } Fort_len = nchar; - return nchar; + + return (nchar); } /* @@ -288,7 +286,7 @@ getargs(int argc, char *argv[]) ignore_case = FALSE; pat = NULL; -# ifdef DEBUG +#ifdef DEBUG while ((ch = getopt(argc, argv, "aDefilm:osw")) != -1) #else while ((ch = getopt(argc, argv, "aefilm:osw")) != -1) @@ -297,11 +295,11 @@ getargs(int argc, char *argv[]) case 'a': /* any fortune */ All_forts++; break; -# ifdef DEBUG +#ifdef DEBUG case 'D': Debug++; break; -# endif /* DEBUG */ +#endif /* DEBUG */ case 'e': Equal_probs++; /* scatter un-allocted prob equally */ break; @@ -355,7 +353,7 @@ getargs(int argc, char *argv[]) error = regcomp(&Re_pat, pat, REG_BASIC); if (error) { fprintf(stderr, "regcomp(%s) fails\n", pat); - exit (1); + exit(1); } } } @@ -377,7 +375,7 @@ form_file_list(char **files, int file_cn pstr = Fortune_path_arr; i = 0; while (*pstr) { - i += add_file(NO_PROB, *pstr++, NULL, + i += add_file(NO_PROB, *pstr++, NULL, &File_list, &File_tail, NULL); } Fortunes_only = FALSE; @@ -385,7 +383,7 @@ form_file_list(char **files, int file_cn fprintf(stderr, "No fortunes found in %s.\n", Fortune_path); } - return i != 0; + return (i != 0); } else { pstr = Fortune_path_arr; i = 0; @@ -397,7 +395,7 @@ form_file_list(char **files, int file_cn fprintf(stderr, "No fortunes found in %s.\n", Fortune_path); } - return i != 0; + return (i != 0); } } for (i = 0; i < file_cnt; i++) { @@ -410,11 +408,11 @@ form_file_list(char **files, int file_cn percent = percent * 10 + *sp - '0'; if (percent > 100) { fprintf(stderr, "percentages must be <= 100\n"); - return FALSE; + return (FALSE); } if (*sp == '.') { fprintf(stderr, "percentages must be integers\n"); - return FALSE; + return (FALSE); } /* * If the number isn't followed by a '%', then @@ -428,7 +426,7 @@ form_file_list(char **files, int file_cn else if (*++sp == '\0') { if (++i >= file_cnt) { fprintf(stderr, "percentages must precede files\n"); - return FALSE; + return (FALSE); } sp = files[i]; } @@ -437,20 +435,21 @@ form_file_list(char **files, int file_cn pstr = Fortune_path_arr; i = 0; while (*pstr) { - i += add_file(NO_PROB, *pstr++, NULL, + i += add_file(NO_PROB, *pstr++, NULL, &File_list, &File_tail, NULL); } if (!i) { fprintf(stderr, "No fortunes found in %s.\n", Fortune_path); - return FALSE; + return (FALSE); } - } else if (!add_file(percent, sp, NULL, &File_list, + } else if (!add_file(percent, sp, NULL, &File_list, &File_tail, NULL)) { - return FALSE; + return (FALSE); } } - return TRUE; + + return (TRUE); } /* @@ -482,7 +481,7 @@ add_file(int percent, const char *file, if ((isdir = is_dir(path)) && parent != NULL) { if (was_malloc) free(tpath); - return FALSE; /* don't recurse */ + return (FALSE); /* don't recurse */ } offensive = NULL; if (!isdir && parent == NULL && (All_forts || Offend) && @@ -501,7 +500,7 @@ add_file(int percent, const char *file, DPRINTF(1, (stderr, "adding file \"%s\"\n", path)); over: - if ((fd = open(path, 0)) < 0) { + if ((fd = open(path, O_RDONLY)) < 0) { /* * This is a sneak. If the user said -a, and if the * file we're given isn't a file, we check to see if @@ -525,14 +524,14 @@ over: char **pstr = Fortune_path_arr; while (*pstr) { - i += add_file(percent, file, *pstr++, + i += add_file(percent, file, *pstr++, head, tail, parent); } if (!i) { fprintf(stderr, "No '%s' found in %s.\n", file, Fortune_path); } - return i != 0; + return (i != 0); } /* if (parent == NULL) @@ -540,7 +539,7 @@ over: */ if (was_malloc) free(tpath); - return FALSE; + return (FALSE); } DPRINTF(2, (stderr, "path = \"%s\"\n", path)); @@ -564,9 +563,9 @@ over: free(tpath); do_free(fp->datfile); do_free(fp->posfile); - free((char *) fp); + free(fp); do_free(offensive); - return FALSE; + return (FALSE); } /* * If the user said -a, we need to make this node a pointer to @@ -588,11 +587,11 @@ over: fp->next = *head; *head = fp; } -#ifdef OK_TO_WRITE_DISK +#ifdef OK_TO_WRITE_DISK fp->was_pos_file = (access(fp->posfile, W_OK) >= 0); -#endif /* OK_TO_WRITE_DISK */ +#endif /* OK_TO_WRITE_DISK */ - return TRUE; + return (TRUE); } /* @@ -604,7 +603,7 @@ new_fp(void) { FILEDESC *fp; - fp = (FILEDESC *) do_malloc(sizeof *fp); + fp = do_malloc(sizeof(*fp)); fp->datfd = -1; fp->pos = POS_UNKNOWN; fp->inf = NULL; @@ -617,7 +616,8 @@ new_fp(void) fp->parent = NULL; fp->datfile = NULL; fp->posfile = NULL; - return fp; + + return (fp); } /* @@ -630,7 +630,8 @@ off_name(const char *file) char *new; new = copy(file, (unsigned int) (strlen(file) + 2)); - return strcat(new, "-o"); + + return (strcat(new, "-o")); } /* @@ -643,6 +644,7 @@ is_off_name(const char *file) int len; len = strlen(file); + return (len >= 3 && file[len - 2] == '-' && file[len - 1] == 'o'); } @@ -657,13 +659,13 @@ all_forts(FILEDESC *fp, char *offensive) char *sp; FILEDESC *scene, *obscene; int fd; - auto char *datfile, *posfile; + char *datfile, *posfile; if (fp->child != NULL) /* this is a directory, not a file */ return; if (!is_fortfile(offensive, &datfile, &posfile, FALSE)) return; - if ((fd = open(offensive, 0)) < 0) + if ((fd = open(offensive, O_RDONLY)) < 0) return; DPRINTF(1, (stderr, "adding \"%s\" because of -a\n", offensive)); scene = new_fp(); @@ -690,9 +692,9 @@ all_forts(FILEDESC *fp, char *offensive) obscene->datfile = datfile; obscene->posfile = posfile; obscene->read_tbl = FALSE; -#ifdef OK_TO_WRITE_DISK +#ifdef OK_TO_WRITE_DISK obscene->was_pos_file = (access(obscene->posfile, W_OK) >= 0); -#endif /* OK_TO_WRITE_DISK */ +#endif /* OK_TO_WRITE_DISK */ } /* @@ -704,14 +706,14 @@ add_dir(FILEDESC *fp) { DIR *dir; struct dirent *dirent; - auto FILEDESC *tailp; - auto char *name; + FILEDESC *tailp; + char *name; (void) close(fp->fd); fp->fd = -1; if ((dir = opendir(fp->path)) == NULL) { perror(fp->path); - return FALSE; + return (FALSE); } tailp = NULL; DPRINTF(1, (stderr, "adding dir \"%s\"\n", fp->path)); @@ -728,9 +730,10 @@ add_dir(FILEDESC *fp) if (fp->num_children == 0) { (void) fprintf(stderr, "fortune: %s: No fortune files in directory.\n", fp->path); - return FALSE; + return (FALSE); } - return TRUE; + + return (TRUE); } /* @@ -740,10 +743,11 @@ add_dir(FILEDESC *fp) int is_dir(const char *file) { - auto struct stat sbuf; + struct stat sbuf; if (stat(file, &sbuf) < 0) - return FALSE; + return (FALSE); + return (sbuf.st_mode & S_IFDIR); } @@ -779,7 +783,7 @@ is_fortfile(const char *file, char **dat i = strlen(file); if (Offend ^ (file[i - 2] == '-' && file[i - 1] == 'o')) { DPRINTF(2, (stderr, "FALSE (offending file)\n")); - return FALSE; + return (FALSE); } } @@ -789,18 +793,18 @@ is_fortfile(const char *file, char **dat sp++; if (*sp == '.') { DPRINTF(2, (stderr, "FALSE (file starts with '.')\n")); - return FALSE; + return (FALSE); } if (Fortunes_only && strncmp(sp, "fortunes", 8) != 0) { DPRINTF(2, (stderr, "FALSE (check fortunes only)\n")); - return FALSE; + return (FALSE); } if ((sp = rindex(sp, '.')) != NULL) { sp++; for (i = 0; suflist[i] != NULL; i++) if (strcmp(sp, suflist[i]) == 0) { DPRINTF(2, (stderr, "FALSE (file has suffix \".%s\")\n", sp)); - return FALSE; + return (FALSE); } } @@ -813,22 +817,23 @@ is_fortfile(const char *file, char **dat DPRINTF(0, (stderr, "Warning: file \"%s\" unreadable\n", datfile)); #endif free(datfile); - return FALSE; + return (FALSE); } if (datp != NULL) *datp = datfile; else free(datfile); if (posp != NULL) { -#ifdef OK_TO_WRITE_DISK +#ifdef OK_TO_WRITE_DISK *posp = copy(file, (unsigned int) (strlen(file) + 4)); /* +4 for ".dat" */ (void) strcat(*posp, ".pos"); #else *posp = NULL; -#endif /* OK_TO_WRITE_DISK */ +#endif /* OK_TO_WRITE_DISK */ } DPRINTF(2, (stderr, "TRUE\n")); - return TRUE; + + return (TRUE); } /* @@ -838,14 +843,15 @@ is_fortfile(const char *file, char **dat char * copy(const char *str, unsigned int len) { - char *new, *sp; + char *new, *sp; new = do_malloc(len + 1); sp = new; do { *sp++ = *str; } while (*str++); - return new; + + return (new); } /* @@ -855,13 +861,14 @@ copy(const char *str, unsigned int len) void * do_malloc(unsigned int size) { - void *new; + void *new; if ((new = malloc(size)) == NULL) { (void) fprintf(stderr, "fortune: out of memory.\n"); exit(1); } - return new; + + return (new); } /* @@ -898,8 +905,7 @@ init_prob(void) num_noprob++; if (Equal_probs) last = fp; - } - else + } else percent += fp->percent; DPRINTF(1, (stderr, "summing probabilities:%d%% with %d NO_PROB's", percent, num_noprob)); @@ -907,14 +913,12 @@ init_prob(void) (void) fprintf(stderr, "fortune: probabilities sum to %d%% > 100%%!\n", percent); exit(1); - } - else if (percent < 100 && num_noprob == 0) { + } else if (percent < 100 && num_noprob == 0) { (void) fprintf(stderr, "fortune: no place to put residual probability (%d%% < 100%%)\n", percent); exit(1); - } - else if (percent == 100 && num_noprob != 0) { + } else if (percent == 100 && num_noprob != 0) { (void) fprintf(stderr, "fortune: no probability left to put in residual files (100%%)\n"); exit(1); @@ -935,7 +939,7 @@ init_prob(void) DPRINTF(1, (stderr, ", residual = %d%%", percent)); } else - DPRINTF(1, (stderr, + DPRINTF(1, (stderr, ", %d%% distributed over remaining fortunes\n", percent)); } @@ -1003,8 +1007,8 @@ get_fort(void) Fortfile = fp; get_pos(fp); open_dat(fp); - (void) lseek(fp->datfd, - (off_t) (sizeof fp->tbl + fp->pos * sizeof Seekpts[0]), 0); + lseek(fp->datfd, + (off_t) (sizeof fp->tbl + fp->pos * sizeof Seekpts[0]), SEEK_SET); read(fp->datfd, Seekpts, sizeof Seekpts); Seekpts[0] = be64toh(Seekpts[0]); Seekpts[1] = be64toh(Seekpts[1]); @@ -1027,7 +1031,7 @@ pick_child(FILEDESC *parent) for (fp = parent->child; choice--; fp = fp->next) continue; DPRINTF(1, (stderr, " using %s\n", fp->name)); - return fp; + return (fp); } else { get_tbl(parent); @@ -1042,7 +1046,7 @@ pick_child(FILEDESC *parent) } DPRINTF(1, (stderr, " using %s, %u\n", fp->name, fp->tbl.str_numstr)); - return fp; + return (fp); } } @@ -1092,7 +1096,7 @@ open_fp(FILEDESC *fp) void open_dat(FILEDESC *fp) { - if (fp->datfd < 0 && (fp->datfd = open(fp->datfile, 0)) < 0) { + if (fp->datfd < 0 && (fp->datfd = open(fp->datfile, O_RDONLY)) < 0) { perror(fp->datfile); exit(1); } @@ -1106,14 +1110,14 @@ open_dat(FILEDESC *fp) void get_pos(FILEDESC *fp) { -#ifdef OK_TO_WRITE_DISK +#ifdef OK_TO_WRITE_DISK int fd; #endif /* OK_TO_WRITE_DISK */ assert(fp->read_tbl); if (fp->pos == POS_UNKNOWN) { -#ifdef OK_TO_WRITE_DISK - if ((fd = open(fp->posfile, 0)) < 0 || +#ifdef OK_TO_WRITE_DISK + if ((fd = open(fp->posfile, O_RDONLY)) < 0 || read(fd, &fp->pos, sizeof fp->pos) != sizeof fp->pos) fp->pos = arc4random_uniform(fp->tbl.str_numstr); else if (fp->pos >= fp->tbl.str_numstr) @@ -1136,13 +1140,13 @@ get_pos(FILEDESC *fp) void get_tbl(FILEDESC *fp) { - auto int fd; + int fd; FILEDESC *child; if (fp->read_tbl) return; if (fp->child == NULL) { - if ((fd = open(fp->datfile, 0)) < 0) { + if ((fd = open(fp->datfile, O_RDONLY)) < 0) { perror(fp->datfile); exit(1); } @@ -1268,7 +1272,8 @@ conv_pat(char *orig) *sp++ = *orig; } *sp = '\0'; - return new; + + return (new); } /* @@ -1285,8 +1290,8 @@ find_matches(void) Found_one = FALSE; matches_in_list(File_list); - return Found_one; - /* NOTREACHED */ + + return (Found_one); } /* @@ -1307,11 +1312,12 @@ maxlen_in_list(FILEDESC *list) } else { get_tbl(fp); - if (fp->tbl.str_longlen > (unsigned)maxlen) + if (fp->tbl.str_longlen > (unsigned int)maxlen) maxlen = fp->tbl.str_longlen; } } - return maxlen; + + return (maxlen); } /* @@ -1323,8 +1329,8 @@ matches_in_list(FILEDESC *list) { char *sp, *p; FILEDESC *fp; - int in_file; - unsigned char ch; + int in_file; + unsigned char ch; for (fp = list; fp != NULL; fp = fp->next) { if (fp->child != NULL) { Modified: head/games/fortune/fortune/pathnames.h ============================================================================== --- head/games/fortune/fortune/pathnames.h Mon Feb 15 15:00:40 2010 (r203925) +++ head/games/fortune/fortune/pathnames.h Mon Feb 15 15:10:21 2010 (r203926) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,6 +27,7 @@ * SUCH DAMAGE. * * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 + * $FreeBSD$ */ #define FORTDIR "/usr/share/games/fortune" Modified: head/games/fortune/strfile/strfile.8 ============================================================================== --- head/games/fortune/strfile/strfile.8 Mon Feb 15 15:00:40 2010 (r203925) +++ head/games/fortune/strfile/strfile.8 Mon Feb 15 15:10:21 2010 (r203926) @@ -13,11 +13,7 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the University of -.\" California, Berkeley and its contributors. -.\" 4. Neither the name of the University nor the names of its contributors +.\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" Modified: head/games/fortune/strfile/strfile.c ============================================================================== --- head/games/fortune/strfile/strfile.c Mon Feb 15 15:00:40 2010 (r203925) +++ head/games/fortune/strfile/strfile.c Mon Feb 15 15:10:21 2010 (r203926) @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -48,16 +44,18 @@ static const char sccsid[] = "@(#)strfil #include __FBSDID("$FreeBSD$"); -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include "strfile.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "strfile.h" /* * This program takes a file composed of strings separated by @@ -83,26 +81,19 @@ __FBSDID("$FreeBSD$"); * Added ordering options. */ -# define TRUE 1 -# define FALSE 0 - -# define STORING_PTRS (Oflag || Rflag) -# define CHUNKSIZE 512 +#define STORING_PTRS (Oflag || Rflag) +#define CHUNKSIZE 512 -# define ALLOC(ptr,sz) { \ +#define ALLOC(ptr, sz) do { \ if (ptr == NULL) \ - ptr = malloc(CHUNKSIZE * sizeof *ptr); \ + ptr = malloc(CHUNKSIZE * sizeof(*ptr)); \ else if (((sz) + 1) % CHUNKSIZE == 0) \ - ptr = realloc(ptr, ((sz) + CHUNKSIZE) * sizeof *ptr); \ + ptr = realloc(ptr, ((sz) + CHUNKSIZE) * sizeof(*ptr)); \ if (ptr == NULL) { \ fprintf(stderr, "out of space\n"); \ exit(1); \ } \ - } - -#ifdef NO_VOID -# define void char -#endif + } while (0) typedef struct { int first; @@ -113,12 +104,12 @@ static char *Infile = NULL, /* input f Outfile[MAXPATHLEN] = "", /* output file name */ Delimch = '%'; /* delimiting character */ -static int Cflag = FALSE; /* embedded comments */ -static int Sflag = FALSE; /* silent run flag */ -static int Oflag = FALSE; /* ordering flag */ -static int Iflag = FALSE; /* ignore case flag */ -static int Rflag = FALSE; /* randomize order flag */ -static int Xflag = FALSE; /* set rotated bit */ +static int Cflag = false; /* embedded comments */ +static int Sflag = false; /* silent run flag */ +static int Oflag = false; /* ordering flag */ +static int Iflag = false; /* ignore case flag */ +static int Rflag = false; /* randomize order flag */ +static int Xflag = false; /* set rotated bit */ static uint32_t Num_pts = 0; /* number of pointers/strings */ static off_t *Seekpts; @@ -129,13 +120,13 @@ static STRFILE Tbl; /* statistics tab static STR *Firstch; /* first chars of each string */ -static void add_offset(FILE *, off_t); -static int cmp_str(const void *, const void *); -static int stable_collate_range_cmp(int, int); -static void do_order(void); -static void getargs(int, char **); -static void randomize(void); -static void usage(void); +static void add_offset(FILE *, off_t); +static int cmp_str(const void *, const void *); +static int stable_collate_range_cmp(int, int); +static void do_order(void); +static void getargs(int, char **); +static void randomize(void); +static void usage(void); /* * main: @@ -149,17 +140,16 @@ static void usage(void); int main(int ac, char *av[]) { - char *sp, dc; - FILE *inf, *outf; - off_t last_off, pos, *p; - size_t length; - int first; - uint32_t cnt; - char *nsp; - STR *fp; - static char string[257]; + char *sp, *nsp, dc; + FILE *inf, *outf; + off_t last_off, pos, *p; + size_t length; + int first; + uint32_t cnt; + STR *fp; + static char string[257]; - (void) setlocale(LC_ALL, ""); + setlocale(LC_ALL, ""); getargs(ac, av); /* evalute arguments */ dc = Delimch; @@ -173,7 +163,7 @@ main(int ac, char *av[]) exit(1); } if (!STORING_PTRS) - (void) fseek(outf, (long) sizeof Tbl, 0); + fseek(outf, (long)sizeof(Tbl), SEEK_SET); /* * Write the strings onto the file @@ -212,7 +202,7 @@ main(int ac, char *av[]) else fp->first = *nsp; fp->pos = Seekpts[Num_pts - 1]; - first = FALSE; + first = false; } } while (sp != NULL); @@ -220,7 +210,7 @@ main(int ac, char *av[]) * write the tables in */ - (void) fclose(inf); + fclose(inf); Tbl.str_numstr = Num_pts - 1; if (Cflag) @@ -252,13 +242,13 @@ main(int ac, char *av[]) Tbl.str_longlen = htobe32(Tbl.str_longlen); Tbl.str_shortlen = htobe32(Tbl.str_shortlen); Tbl.str_flags = htobe32(Tbl.str_flags); - (void) fwrite((char *) &Tbl, sizeof Tbl, 1, outf); + fwrite((char *)&Tbl, sizeof(Tbl), 1, outf); if (STORING_PTRS) { for (p = Seekpts, cnt = Num_pts; cnt--; ++p) *p = htobe64(*p); - (void) fwrite(Seekpts, sizeof *Seekpts, (size_t) Num_pts, outf); + fwrite(Seekpts, sizeof(*Seekpts), (size_t)Num_pts, outf); } - (void) fclose(outf); + fclose(outf); exit(0); } @@ -268,7 +258,7 @@ main(int ac, char *av[]) void getargs(int argc, char **argv) { - int ch; + int ch; while ((ch = getopt(argc, argv, "Cc:iorsx")) != -1) switch(ch) { @@ -306,22 +296,22 @@ getargs(int argc, char **argv) if (*argv) { Infile = *argv; if (*++argv) - (void) strcpy(Outfile, *argv); + strcpy(Outfile, *argv); } if (!Infile) { puts("No input file name"); usage(); } if (*Outfile == '\0') { - (void) strcpy(Outfile, Infile); - (void) strcat(Outfile, ".dat"); + strcpy(Outfile, Infile); + strcat(Outfile, ".dat"); } } void usage(void) { - (void) fprintf(stderr, + fprintf(stderr, "strfile [-Ciorsx] [-c char] source_file [output_file]\n"); exit(1); } @@ -337,7 +327,7 @@ add_offset(FILE *fp, off_t off) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 17:41:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A169B1065676; Mon, 15 Feb 2010 17:41:59 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90FD68FC18; Mon, 15 Feb 2010 17:41: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 o1FHfxDP069144; Mon, 15 Feb 2010 17:41:59 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FHfxsI069142; Mon, 15 Feb 2010 17:41:59 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201002151741.o1FHfxsI069142@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 15 Feb 2010 17: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: r203929 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 17:41:59 -0000 Author: trasz Date: Mon Feb 15 17:41:59 2010 New Revision: 203929 URL: http://svn.freebsd.org/changeset/base/203929 Log: Some rewording and language fixes. PR: docs/136918, docs/134074 Submitted by: Ben Kaduk , Haven Hash Modified: head/share/man/man9/locking.9 Modified: head/share/man/man9/locking.9 ============================================================================== --- head/share/man/man9/locking.9 Mon Feb 15 16:41:30 2010 (r203928) +++ head/share/man/man9/locking.9 Mon Feb 15 17:41:59 2010 (r203929) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2010 +.Dd February 15, 2010 .Dt LOCKING 9 .Os .Sh NAME @@ -106,7 +106,7 @@ Mostly reader locks are similar to locks but optimized for very infrequent write locking. .Em Read-mostly locks implement full priority propagation by tracking shared owners -using a lock user supplied +using a caller-supplied .Em tracker data structure. .Pp @@ -272,24 +272,18 @@ holding mutex, or to try to allocate mem read-write lock. .Pp As a special case, it is possible to call -.Fn sleep 9 +.Fn sleep or -.Fn mtx_sleep 9 -while holding a mutex. -It will atomically drop the mutex and reacquire it -as part of waking up. -This is often however a bad -idea because it generally relies on you having -such a good knowledge of all the call graph above you -and what assumptions it is making that there are a lot -of ways to make hard-to-find mistakes. -For example you must re-test all the assumptions you made before, -all the way up the call graph to where you got the lock. -You can not just assume that mtx_sleep can be inserted anywhere. -If any caller above you has any mutex or -rwlock, your sleep, will cause a panic. -If the sleep only happens rarely it may be years before the -bad code path is found. +.Fn mtx_sleep +while holding a single mutex. +It will atomically drop that mutex and reacquire it as part of waking up. +This is often a bad idea because it generally relies on the programmer having +good knowledge of all of the call graph above the place where +.Fn mtx_sleep +is being called and assumptions the calling code has made. +Because the lock gets dropped during sleep, one one must re-test all +the assumptions that were made before, all the way up the call graph to the +place where the lock was acquired. .Pp It is an error to do any operation that could result in any kind of sleep when running inside an interrupt filter. @@ -315,11 +309,11 @@ Recursion is defined per lock. Lock order is important. .Pp .Em *2 -readers can recurse though writers can not. +Readers can recurse though writers can not. Lock order is important. .Pp .Em *3 -There are calls atomically release this primitive when going to sleep +There are calls that atomically release this primitive when going to sleep and reacquire it on wakeup (e.g. .Fn mtx_sleep , .Fn rw_sleep @@ -330,7 +324,7 @@ and .Em *4 Though one can sleep holding an sx lock, one can also use .Fn sx_sleep -which atomically release this primitive when going to sleep and +which will atomically release this primitive when going to sleep and reacquire it on wakeup. .Ss Context mode table The next table shows what can be used in different contexts. @@ -345,6 +339,7 @@ At this time this is a rather easy to re .It syscall: Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok Ta \&ok .El .Sh SEE ALSO +.Xr witness 4 , .Xr condvar 9 , .Xr lock 9 , .Xr mtx_pool 9 , @@ -354,7 +349,6 @@ At this time this is a rather easy to re .Xr sema 9 , .Xr sleep 9 , .Xr sx 9 , -.Xr witness 9 , .Xr LOCK_PROFILING 9 .Sh HISTORY These From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 17:49:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 946931065672; Mon, 15 Feb 2010 17:49:49 +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 825EE8FC0C; Mon, 15 Feb 2010 17: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 o1FHnnMs070901; Mon, 15 Feb 2010 17:49:49 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FHnnjS070890; Mon, 15 Feb 2010 17:49:49 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201002151749.o1FHnnjS070890@svn.freebsd.org> From: Rui Paulo Date: Mon, 15 Feb 2010 17: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: r203930 - in head/sys: conf dev/ath/ath_hal dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 17:49:49 -0000 Author: rpaulo Date: Mon Feb 15 17:49:49 2010 New Revision: 203930 URL: http://svn.freebsd.org/changeset/base/203930 Log: Bring back AR9285 support. This fixes most of the issues and should be pretty usable. MFC after: 1 month Added: head/sys/dev/ath/ath_hal/ar5416/ar9285.c (contents, props changed) head/sys/dev/ath/ath_hal/ar5416/ar9285.h (contents, props changed) head/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c (contents, props changed) head/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar5416/ar9280.h head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Feb 15 17:41:59 2010 (r203929) +++ head/sys/conf/files Mon Feb 15 17:49:49 2010 (r203930) @@ -555,7 +555,7 @@ dev/ath/ath_hal/ah_eeprom_v14.c \ optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ath_hal/ah_eeprom_v4k.c \ - optional ath_hal | ath_ar9280 | ath_ar9285 \ + optional ath_hal | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ath_hal/ah_regdomain.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" @@ -713,9 +713,14 @@ dev/ath/ath_hal/ar5416/ar5416_xmit.c \ # ar9160 (depends on ar5416) dev/ath/ath_hal/ar5416/ar9160_attach.c optional ath_hal | ath_ar9160 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" -# ar9280/ar9285 (depends on ar5416) +# ar9280 (depends on ar5416) dev/ath/ath_hal/ar5416/ar9280_attach.c optional ath_hal | ath_ar9280 | \ - ath_ar9285 \ + ath_ar9285 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +# ar9285 (depends on ar5416 and ar9280) +dev/ath/ath_hal/ar5416/ar9285_attach.c optional ath_hal | ath_ar9285 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +dev/ath/ath_hal/ar5416/ar9285_reset.c optional ath_hal | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # rf backends dev/ath/ath_hal/ar5212/ar2316.c optional ath_rf2316 \ @@ -736,6 +741,8 @@ dev/ath/ath_hal/ar5416/ar2133.c optional compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" dev/ath/ath_hal/ar5416/ar9280.c optional ath_hal | ath_ar9280 | ath_ar9285 \ compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" +dev/ath/ath_hal/ar5416/ar9285.c optional ath_hal | ath_ar9285 \ + compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal" # ath rate control algorithms dev/ath/ath_rate/amrr/amrr.c optional ath_rate_amrr \ compile-with "${NORMAL_C} -I$S/dev/ath" Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Mon Feb 15 17:41:59 2010 (r203929) +++ head/sys/dev/ath/ath_hal/ah.h Mon Feb 15 17:49:49 2010 (r203930) @@ -638,7 +638,11 @@ struct ath_hal { HAL_BOOL longCal, HAL_BOOL *isCalDone); HAL_BOOL __ahdecl(*ah_resetCalValid)(struct ath_hal *, const struct ieee80211_channel *); + HAL_BOOL __ahdecl(*ah_setTxPower)(struct ath_hal *, + const struct ieee80211_channel *, uint16_t *); HAL_BOOL __ahdecl(*ah_setTxPowerLimit)(struct ath_hal *, uint32_t); + HAL_BOOL __ahdecl(*ah_setBoardValues)(struct ath_hal *, + const struct ieee80211_channel *); /* Transmit functions */ HAL_BOOL __ahdecl(*ah_updateTxTrigLevel)(struct ath_hal*, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Feb 15 17:41:59 2010 (r203929) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Mon Feb 15 17:49:49 2010 (r203930) @@ -21,6 +21,7 @@ #include "ar5212/ar5212.h" #include "ar5416_cal.h" +#include "ah_eeprom_v14.h" /* for CAL_TARGET_POWER_* */ #define AR5416_MAGIC 0x20065416 @@ -179,12 +180,27 @@ extern HAL_RFGAIN ar5416GetRfgain(struct extern HAL_BOOL ar5416Disable(struct ath_hal *ah); extern HAL_BOOL ar5416ChipReset(struct ath_hal *ah, const struct ieee80211_channel *); +extern HAL_BOOL ar5416SetBoardValues(struct ath_hal *, + const struct ieee80211_channel *); extern HAL_BOOL ar5416SetResetReg(struct ath_hal *, uint32_t type); extern HAL_BOOL ar5416SetTxPowerLimit(struct ath_hal *ah, uint32_t limit); +extern HAL_BOOL ar5416SetTransmitPower(struct ath_hal *, + const struct ieee80211_channel *, uint16_t *); extern HAL_BOOL ar5416GetChipPowerLimits(struct ath_hal *ah, struct ieee80211_channel *chan); extern void ar5416GetChannelCenters(struct ath_hal *, const struct ieee80211_channel *chan, CHAN_CENTERS *centers); +extern void ar5416GetTargetPowers(struct ath_hal *ah, + const struct ieee80211_channel *chan, + CAL_TARGET_POWER_HT *powInfo, + uint16_t numChannels, CAL_TARGET_POWER_HT *pNewPower, + uint16_t numRates, HAL_BOOL isHt40Target); +extern void ar5416GetTargetPowersLeg(struct ath_hal *ah, + const struct ieee80211_channel *chan, + CAL_TARGET_POWER_LEG *powInfo, + uint16_t numChannels, CAL_TARGET_POWER_LEG *pNewPower, + uint16_t numRates, HAL_BOOL isExtTarget); + extern HAL_BOOL ar5416StopTxDma(struct ath_hal *ah, u_int q); extern HAL_BOOL ar5416SetupTxDesc(struct ath_hal *ah, struct ath_desc *ds, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Feb 15 17:41:59 2010 (r203929) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Mon Feb 15 17:49:49 2010 (r203930) @@ -89,6 +89,8 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_perCalibrationN = ar5416PerCalibrationN, ah->ah_resetCalValid = ar5416ResetCalValid, ah->ah_setTxPowerLimit = ar5416SetTxPowerLimit; + ah->ah_setTxPower = ar5416SetTransmitPower; + ah->ah_setBoardValues = ar5416SetBoardValues; /* Transmit functions */ ah->ah_stopTxDma = ar5416StopTxDma; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon Feb 15 17:41:59 2010 (r203929) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon Feb 15 17:49:49 2010 (r203930) @@ -45,9 +45,6 @@ static void ar5416InitIMR(struct ath_hal static void ar5416InitQoS(struct ath_hal *ah); static void ar5416InitUserSettings(struct ath_hal *ah); -static HAL_BOOL ar5416SetTransmitPower(struct ath_hal *ah, - const struct ieee80211_channel *chan, uint16_t *rfXpdGain); - #if 0 static HAL_BOOL ar5416ChannelChange(struct ath_hal *, const struct ieee80211_channel *); #endif @@ -56,7 +53,6 @@ static void ar5416SetDeltaSlope(struct a static HAL_BOOL ar5416SetResetPowerOn(struct ath_hal *ah); static HAL_BOOL ar5416SetReset(struct ath_hal *ah, int type); static void ar5416InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan); -static HAL_BOOL ar5416SetBoardValues(struct ath_hal *, const struct ieee80211_channel *); static HAL_BOOL ar5416SetPowerPerRateTable(struct ath_hal *ah, struct ar5416eeprom *pEepData, const struct ieee80211_channel *chan, int16_t *ratesArray, @@ -69,14 +65,6 @@ static HAL_BOOL ar5416SetPowerCalTable(s int16_t *pTxPowerIndexOffset); static uint16_t ar5416GetMaxEdgePower(uint16_t freq, CAL_CTL_EDGES *pRdEdgesPower, HAL_BOOL is2GHz); -static void ar5416GetTargetPowers(struct ath_hal *ah, - const struct ieee80211_channel *chan, CAL_TARGET_POWER_HT *powInfo, - uint16_t numChannels, CAL_TARGET_POWER_HT *pNewPower, - uint16_t numRates, HAL_BOOL isHt40Target); -static void ar5416GetTargetPowersLeg(struct ath_hal *ah, - const struct ieee80211_channel *chan, CAL_TARGET_POWER_LEG *powInfo, - uint16_t numChannels, CAL_TARGET_POWER_LEG *pNewPower, - uint16_t numRates, HAL_BOOL isExtTarget); static int16_t interpolate(uint16_t target, uint16_t srcLeft, uint16_t srcRight, int16_t targetLeft, int16_t targetRight); @@ -224,7 +212,7 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO OS_REG_WRITE(ah, AR_SELFGEN_MASK, AH5416(ah)->ah_tx_chainmask); /* Setup the transmit power values. */ - if (!ar5416SetTransmitPower(ah, chan, rfXpdGain)) { + if (!ah->ah_setTxPower(ah, chan, rfXpdGain)) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: error init'ing transmit power\n", __func__); FAIL(HAL_EIO); @@ -245,7 +233,7 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO AH5416(ah)->ah_spurMitigate(ah, chan); /* Setup board specific options for EEPROM version 3 */ - if (!ar5416SetBoardValues(ah, chan)) { + if (!ah->ah_setBoardValues(ah, chan)) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: error setting board options\n", __func__); FAIL(HAL_EIO); @@ -793,7 +781,7 @@ typedef enum Ar5416_Rates { * Set the transmit power in the baseband for the given * operating channel and mode. */ -static HAL_BOOL +HAL_BOOL ar5416SetTransmitPower(struct ath_hal *ah, const struct ieee80211_channel *chan, uint16_t *rfXpdGain) { @@ -1185,7 +1173,7 @@ ar5416InitPLL(struct ath_hal *ah, const * Read EEPROM header info and program the device for correct operation * given the channel value. */ -static HAL_BOOL +HAL_BOOL ar5416SetBoardValues(struct ath_hal *ah, const struct ieee80211_channel *chan) { const HAL_EEPROM_v14 *ee = AH_PRIVATE(ah)->ah_eeprom; @@ -1622,7 +1610,7 @@ ar5416GetMaxEdgePower(uint16_t freq, CAL * Return the rates of target power for the given target power table * channel, and number of channels */ -static void +void ar5416GetTargetPowers(struct ath_hal *ah, const struct ieee80211_channel *chan, CAL_TARGET_POWER_HT *powInfo, uint16_t numChannels, CAL_TARGET_POWER_HT *pNewPower, uint16_t numRates, @@ -1681,7 +1669,7 @@ ar5416GetTargetPowers(struct ath_hal *ah * Return the four rates of target power for the given target power table * channel, and number of channels */ -static void +void ar5416GetTargetPowersLeg(struct ath_hal *ah, const struct ieee80211_channel *chan, CAL_TARGET_POWER_LEG *powInfo, uint16_t numChannels, Modified: head/sys/dev/ath/ath_hal/ar5416/ar9280.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9280.h Mon Feb 15 17:41:59 2010 (r203929) +++ head/sys/dev/ath/ath_hal/ar5416/ar9280.h Mon Feb 15 17:49:49 2010 (r203930) @@ -39,4 +39,7 @@ HAL_BOOL ar9280RfAttach(struct ath_hal * struct ath_hal; HAL_BOOL ar9280SetAntennaSwitch(struct ath_hal *, HAL_ANT_SETTING); +void ar9280SpurMitigate(struct ath_hal *, + const struct ieee80211_channel *); + #endif /* _ATH_AR9280_H_ */ Modified: head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c Mon Feb 15 17:41:59 2010 (r203929) +++ head/sys/dev/ath/ath_hal/ar5416/ar9280_attach.c Mon Feb 15 17:49:49 2010 (r203930) @@ -64,8 +64,6 @@ static void ar9280ConfigPCIE(struct ath_ static HAL_BOOL ar9280FillCapabilityInfo(struct ath_hal *ah); static void ar9280WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan); -static void ar9280SpurMitigate(struct ath_hal *ah, - const struct ieee80211_channel *chan); static void ar9280AniSetup(struct ath_hal *ah) @@ -360,7 +358,7 @@ ar9280WriteIni(struct ath_hal *ah, const #define AR_SPUR_FEEQ_BOUND_HT40 19 #define AR_SPUR_FEEQ_BOUND_HT20 10 -static void +void ar9280SpurMitigate(struct ath_hal *ah, const struct ieee80211_channel *chan) { static const int pilot_mask_reg[4] = { AR_PHY_TIMING7, AR_PHY_TIMING8, Added: head/sys/dev/ath/ath_hal/ar5416/ar9285.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar5416/ar9285.c Mon Feb 15 17:49:49 2010 (r203930) @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2008-2009 Sam Leffler, Errno Consulting + * Copyright (c) 2008 Atheros Communications, Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ +#include "opt_ah.h" + +#include "ah.h" +#include "ah_internal.h" + +#include "ah_eeprom_v14.h" + +#include "ar5416/ar9280.h" +#include "ar5416/ar9285.h" +#include "ar5416/ar5416reg.h" +#include "ar5416/ar5416phy.h" + +static void +ar9285GetNoiseFloor(struct ath_hal *ah, int16_t nfarray[]) +{ + int16_t nf; + + nf = MS(OS_REG_READ(ah, AR_PHY_CCA), AR9280_PHY_MINCCA_PWR); + if (nf & 0x100) + nf = 0 - ((nf ^ 0x1ff) + 1); + HALDEBUG(ah, HAL_DEBUG_NFCAL, + "NF calibrated [ctl] [chain 0] is %d\n", nf); + nfarray[0] = nf; + + nfarray[1] = 0; + + nf = MS(OS_REG_READ(ah, AR_PHY_EXT_CCA), AR9280_PHY_EXT_MINCCA_PWR); + if (nf & 0x100) + nf = 0 - ((nf ^ 0x1ff) + 1); + HALDEBUG(ah, HAL_DEBUG_NFCAL, + "NF calibrated [ext] [chain 0] is %d\n", nf); + nfarray[3] = nf; + + nfarray[4] = 0; +} + +HAL_BOOL +ar9285RfAttach(struct ath_hal *ah, HAL_STATUS *status) +{ + if (ar9280RfAttach(ah, status) == AH_FALSE) + return AH_FALSE; + + AH_PRIVATE(ah)->ah_getNoiseFloor = ar9285GetNoiseFloor; + + return AH_TRUE; +} Added: head/sys/dev/ath/ath_hal/ar5416/ar9285.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar5416/ar9285.h Mon Feb 15 17:49:49 2010 (r203930) @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2008-2009 Sam Leffler, Errno Consulting + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ +#ifndef _ATH_AR9285_H_ +#define _ATH_AR9285_H_ + +#include "ar5416/ar5416.h" + +struct ath_hal_9285 { + struct ath_hal_5416 ah_5416; + + HAL_INI_ARRAY ah_ini_txgain; + HAL_INI_ARRAY ah_ini_rxgain; +}; +#define AH9285(_ah) ((struct ath_hal_9285 *)(_ah)) + +#define AR9285_DEFAULT_RXCHAINMASK 1 +#define AR9285_DEFAULT_TXCHAINMASK 1 + + +HAL_BOOL ar9285SetAntennaSwitch(struct ath_hal *, HAL_ANT_SETTING); +HAL_BOOL ar9285RfAttach(struct ath_hal *, HAL_STATUS *); + +extern HAL_BOOL ar9285SetTransmitPower(struct ath_hal *, + const struct ieee80211_channel *, uint16_t *); +extern HAL_BOOL ar9285SetBoardValues(struct ath_hal *, + const struct ieee80211_channel *); + +#endif /* _ATH_AR9285_H_ */ Added: head/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar5416/ar9285_attach.c Mon Feb 15 17:49:49 2010 (r203930) @@ -0,0 +1,395 @@ +/* + * Copyright (c) 2008-2009 Sam Leffler, Errno Consulting + * Copyright (c) 2008 Atheros Communications, Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ +#include "opt_ah.h" + +#include "ah.h" +#include "ah_internal.h" +#include "ah_devid.h" + +#include "ah_eeprom_v4k.h" /* XXX for tx/rx gain */ + +#include "ar5416/ar9280.h" +#include "ar5416/ar9285.h" +#include "ar5416/ar5416reg.h" +#include "ar5416/ar5416phy.h" + +#include "ar5416/ar9285.ini" +#include "ar5416/ar9285v2.ini" +#include "ar5416/ar9280v2.ini" /* XXX ini for tx/rx gain */ + +static const HAL_PERCAL_DATA ar9280_iq_cal = { /* single sample */ + .calName = "IQ", .calType = IQ_MISMATCH_CAL, + .calNumSamples = MIN_CAL_SAMPLES, + .calCountMax = PER_MAX_LOG_COUNT, + .calCollect = ar5416IQCalCollect, + .calPostProc = ar5416IQCalibration +}; +static const HAL_PERCAL_DATA ar9280_adc_gain_cal = { /* single sample */ + .calName = "ADC Gain", .calType = ADC_GAIN_CAL, + .calNumSamples = MIN_CAL_SAMPLES, + .calCountMax = PER_MIN_LOG_COUNT, + .calCollect = ar5416AdcGainCalCollect, + .calPostProc = ar5416AdcGainCalibration +}; +static const HAL_PERCAL_DATA ar9280_adc_dc_cal = { /* single sample */ + .calName = "ADC DC", .calType = ADC_DC_CAL, + .calNumSamples = MIN_CAL_SAMPLES, + .calCountMax = PER_MIN_LOG_COUNT, + .calCollect = ar5416AdcDcCalCollect, + .calPostProc = ar5416AdcDcCalibration +}; +static const HAL_PERCAL_DATA ar9280_adc_init_dc_cal = { + .calName = "ADC Init DC", .calType = ADC_DC_INIT_CAL, + .calNumSamples = MIN_CAL_SAMPLES, + .calCountMax = INIT_LOG_COUNT, + .calCollect = ar5416AdcDcCalCollect, + .calPostProc = ar5416AdcDcCalibration +}; + +static void ar9285ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore); +static HAL_BOOL ar9285FillCapabilityInfo(struct ath_hal *ah); +static void ar9285WriteIni(struct ath_hal *ah, + const struct ieee80211_channel *chan); + +static void +ar9285AniSetup(struct ath_hal *ah) +{ + /* NB: disable ANI for reliable RIFS rx */ + ar5212AniAttach(ah, AH_NULL, AH_NULL, AH_FALSE); +} + +/* + * Attach for an AR9285 part. + */ +static struct ath_hal * +ar9285Attach(uint16_t devid, HAL_SOFTC sc, + HAL_BUS_TAG st, HAL_BUS_HANDLE sh, HAL_STATUS *status) +{ + struct ath_hal_9285 *ahp9285; + struct ath_hal_5212 *ahp; + struct ath_hal *ah; + uint32_t val; + HAL_STATUS ecode; + HAL_BOOL rfStatus; + + HALDEBUG(AH_NULL, HAL_DEBUG_ATTACH, "%s: sc %p st %p sh %p\n", + __func__, sc, (void*) st, (void*) sh); + + /* NB: memory is returned zero'd */ + ahp9285 = ath_hal_malloc(sizeof (struct ath_hal_9285)); + if (ahp9285 == AH_NULL) { + HALDEBUG(AH_NULL, HAL_DEBUG_ANY, + "%s: cannot allocate memory for state block\n", __func__); + *status = HAL_ENOMEM; + return AH_NULL; + } + ahp = AH5212(ahp9285); + ah = &ahp->ah_priv.h; + + ar5416InitState(AH5416(ah), devid, sc, st, sh, status); + + /* XXX override with 9285 specific state */ + /* override 5416 methods for our needs */ + ah->ah_setAntennaSwitch = ar9285SetAntennaSwitch; + ah->ah_configPCIE = ar9285ConfigPCIE; + ah->ah_setTxPower = ar9285SetTransmitPower; + ah->ah_setBoardValues = ar9285SetBoardValues; + + AH5416(ah)->ah_cal.iqCalData.calData = &ar9280_iq_cal; + AH5416(ah)->ah_cal.adcGainCalData.calData = &ar9280_adc_gain_cal; + AH5416(ah)->ah_cal.adcDcCalData.calData = &ar9280_adc_dc_cal; + AH5416(ah)->ah_cal.adcDcCalInitData.calData = &ar9280_adc_init_dc_cal; + AH5416(ah)->ah_cal.suppCals = ADC_GAIN_CAL | ADC_DC_CAL | IQ_MISMATCH_CAL; + + AH5416(ah)->ah_spurMitigate = ar9280SpurMitigate; + AH5416(ah)->ah_writeIni = ar9285WriteIni; + AH5416(ah)->ah_rx_chainmask = AR9285_DEFAULT_RXCHAINMASK; + AH5416(ah)->ah_tx_chainmask = AR9285_DEFAULT_TXCHAINMASK; + + if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) { + /* reset chip */ + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't reset chip\n", + __func__); + ecode = HAL_EIO; + goto bad; + } + + if (!ar5416SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE)) { + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: couldn't wakeup chip\n", + __func__); + ecode = HAL_EIO; + goto bad; + } + /* Read Revisions from Chips before taking out of reset */ + val = OS_REG_READ(ah, AR_SREV); + HALDEBUG(ah, HAL_DEBUG_ATTACH, + "%s: ID 0x%x VERSION 0x%x TYPE 0x%x REVISION 0x%x\n", + __func__, MS(val, AR_XSREV_ID), MS(val, AR_XSREV_VERSION), + MS(val, AR_XSREV_TYPE), MS(val, AR_XSREV_REVISION)); + /* NB: include chip type to differentiate from pre-Sowl versions */ + AH_PRIVATE(ah)->ah_macVersion = + (val & AR_XSREV_VERSION) >> AR_XSREV_TYPE_S; + AH_PRIVATE(ah)->ah_macRev = MS(val, AR_XSREV_REVISION); + AH_PRIVATE(ah)->ah_ispcie = (val & AR_XSREV_TYPE_HOST_MODE) == 0; + + /* setup common ini data; rf backends handle remainder */ + if (AR_SREV_KITE_12_OR_LATER(ah)) { + HAL_INI_INIT(&ahp->ah_ini_modes, ar9285Modes_v2, 6); + HAL_INI_INIT(&ahp->ah_ini_common, ar9285Common_v2, 2); + HAL_INI_INIT(&AH5416(ah)->ah_ini_pcieserdes, + ar9285PciePhy_clkreq_always_on_L1_v2, 2); + } else { + HAL_INI_INIT(&ahp->ah_ini_modes, ar9285Modes, 6); + HAL_INI_INIT(&ahp->ah_ini_common, ar9285Common, 2); + HAL_INI_INIT(&AH5416(ah)->ah_ini_pcieserdes, + ar9285PciePhy_clkreq_always_on_L1, 2); + } + ar5416AttachPCIE(ah); + + ecode = ath_hal_v4kEepromAttach(ah); + if (ecode != HAL_OK) + goto bad; + + if (!ar5416ChipReset(ah, AH_NULL)) { /* reset chip */ + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: chip reset failed\n", + __func__); + ecode = HAL_EIO; + goto bad; + } + + AH_PRIVATE(ah)->ah_phyRev = OS_REG_READ(ah, AR_PHY_CHIP_ID); + + if (!ar5212ChipTest(ah)) { + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: hardware self-test failed\n", + __func__); + ecode = HAL_ESELFTEST; + goto bad; + } + + /* + * Set correct Baseband to analog shift + * setting to access analog chips. + */ + OS_REG_WRITE(ah, AR_PHY(0), 0x00000007); + + /* Read Radio Chip Rev Extract */ + AH_PRIVATE(ah)->ah_analog5GhzRev = ar5416GetRadioRev(ah); + switch (AH_PRIVATE(ah)->ah_analog5GhzRev & AR_RADIO_SREV_MAJOR) { + case AR_RAD2133_SREV_MAJOR: /* Sowl: 2G/3x3 */ + case AR_RAD5133_SREV_MAJOR: /* Sowl: 2+5G/3x3 */ + break; + default: + if (AH_PRIVATE(ah)->ah_analog5GhzRev == 0) { + AH_PRIVATE(ah)->ah_analog5GhzRev = + AR_RAD5133_SREV_MAJOR; + break; + } +#ifdef AH_DEBUG + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s: 5G Radio Chip Rev 0x%02X is not supported by " + "this driver\n", __func__, + AH_PRIVATE(ah)->ah_analog5GhzRev); + ecode = HAL_ENOTSUPP; + goto bad; +#endif + } + rfStatus = ar9285RfAttach(ah, &ecode); + if (!rfStatus) { + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: RF setup failed, status %u\n", + __func__, ecode); + goto bad; + } + + HAL_INI_INIT(&ahp9285->ah_ini_rxgain, ar9280Modes_original_rxgain_v2, + 6); + /* setup txgain table */ + switch (ath_hal_eepromGet(ah, AR_EEP_TXGAIN_TYPE, AH_NULL)) { + case AR5416_EEP_TXGAIN_HIGH_POWER: + HAL_INI_INIT(&ahp9285->ah_ini_txgain, + ar9285Modes_high_power_tx_gain_v2, 6); + break; + case AR5416_EEP_TXGAIN_ORIG: + HAL_INI_INIT(&ahp9285->ah_ini_txgain, + ar9285Modes_original_tx_gain_v2, 6); + break; + default: + HALASSERT(AH_FALSE); + goto bad; /* XXX ? try to continue */ + } + + /* + * Got everything we need now to setup the capabilities. + */ + if (!ar9285FillCapabilityInfo(ah)) { + ecode = HAL_EEREAD; + goto bad; + } + + ecode = ath_hal_eepromGet(ah, AR_EEP_MACADDR, ahp->ah_macaddr); + if (ecode != HAL_OK) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s: error getting mac address from EEPROM\n", __func__); + goto bad; + } + /* XXX How about the serial number ? */ + /* Read Reg Domain */ + AH_PRIVATE(ah)->ah_currentRD = + ath_hal_eepromGet(ah, AR_EEP_REGDMN_0, AH_NULL); + + /* + * ah_miscMode is populated by ar5416FillCapabilityInfo() + * starting from griffin. Set here to make sure that + * AR_MISC_MODE_MIC_NEW_LOC_ENABLE is set before a GTK is + * placed into hardware. + */ + if (ahp->ah_miscMode != 0) + OS_REG_WRITE(ah, AR_MISC_MODE, ahp->ah_miscMode); + + ar9285AniSetup(ah); /* Anti Noise Immunity */ + ar5416InitNfHistBuff(AH5416(ah)->ah_cal.nfCalHist); + + HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s: return\n", __func__); + + return ah; +bad: + if (ah != AH_NULL) + ah->ah_detach(ah); + if (status) + *status = ecode; + return AH_NULL; +} + +static void +ar9285ConfigPCIE(struct ath_hal *ah, HAL_BOOL restore) +{ + if (AH_PRIVATE(ah)->ah_ispcie && !restore) { + ath_hal_ini_write(ah, &AH5416(ah)->ah_ini_pcieserdes, 1, 0); + OS_DELAY(1000); + OS_REG_SET_BIT(ah, AR_PCIE_PM_CTRL, AR_PCIE_PM_CTRL_ENA); + OS_REG_WRITE(ah, AR_WA, AR9285_WA_DEFAULT); + } +} + +static void +ar9285WriteIni(struct ath_hal *ah, const struct ieee80211_channel *chan) +{ + u_int modesIndex, freqIndex; + int regWrites = 0; + + /* Setup the indices for the next set of register array writes */ + /* XXX Ignore 11n dynamic mode on the AR5416 for the moment */ + freqIndex = 2; + if (IEEE80211_IS_CHAN_HT40(chan)) + modesIndex = 3; + else if (IEEE80211_IS_CHAN_108G(chan)) + modesIndex = 5; + else + modesIndex = 4; + + /* Set correct Baseband to analog shift setting to access analog chips. */ + OS_REG_WRITE(ah, AR_PHY(0), 0x00000007); + OS_REG_WRITE(ah, AR_PHY_ADC_SERIAL_CTL, AR_PHY_SEL_INTERNAL_ADDAC); + regWrites = ath_hal_ini_write(ah, &AH5212(ah)->ah_ini_modes, + modesIndex, regWrites); + if (AR_SREV_KITE_12_OR_LATER(ah)) { + regWrites = ath_hal_ini_write(ah, &AH9285(ah)->ah_ini_txgain, + modesIndex, regWrites); + } + regWrites = ath_hal_ini_write(ah, &AH5212(ah)->ah_ini_common, + 1, regWrites); + +} + +/* + * Fill all software cached or static hardware state information. + * Return failure if capabilities are to come from EEPROM and + * cannot be read. + */ +static HAL_BOOL +ar9285FillCapabilityInfo(struct ath_hal *ah) +{ + HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps; + + if (!ar5416FillCapabilityInfo(ah)) + return AH_FALSE; + pCap->halNumGpioPins = 12; + pCap->halWowSupport = AH_TRUE; + pCap->halWowMatchPatternExact = AH_TRUE; +#if 0 + pCap->halWowMatchPatternDword = AH_TRUE; +#endif + pCap->halCSTSupport = AH_TRUE; + pCap->halRifsRxSupport = AH_TRUE; + pCap->halRifsTxSupport = AH_TRUE; + pCap->halRtsAggrLimit = 64*1024; /* 802.11n max */ + pCap->halExtChanDfsSupport = AH_TRUE; +#if 0 + /* XXX bluetooth */ + pCap->halBtCoexSupport = AH_TRUE; +#endif + pCap->halAutoSleepSupport = AH_FALSE; /* XXX? */ +#if 0 + pCap->hal4kbSplitTransSupport = AH_FALSE; +#endif + pCap->halRxStbcSupport = 1; + pCap->halTxStbcSupport = 1; + + return AH_TRUE; +} + +HAL_BOOL +ar9285SetAntennaSwitch(struct ath_hal *ah, HAL_ANT_SETTING settings) +{ +#define ANTENNA0_CHAINMASK 0x1 +#define ANTENNA1_CHAINMASK 0x2 + struct ath_hal_5416 *ahp = AH5416(ah); + + /* Antenna selection is done by setting the tx/rx chainmasks approp. */ + switch (settings) { + case HAL_ANT_FIXED_A: + /* Enable first antenna only */ + ahp->ah_tx_chainmask = ANTENNA0_CHAINMASK; + ahp->ah_rx_chainmask = ANTENNA0_CHAINMASK; + break; + case HAL_ANT_FIXED_B: + /* Enable second antenna only, after checking capability */ + if (AH_PRIVATE(ah)->ah_caps.halTxChainMask > ANTENNA1_CHAINMASK) + ahp->ah_tx_chainmask = ANTENNA1_CHAINMASK; + ahp->ah_rx_chainmask = ANTENNA1_CHAINMASK; + break; + case HAL_ANT_VARIABLE: + /* Restore original chainmask settings */ + /* XXX */ + ahp->ah_tx_chainmask = AR5416_DEFAULT_TXCHAINMASK; + ahp->ah_rx_chainmask = AR5416_DEFAULT_RXCHAINMASK; + break; + } + return AH_TRUE; +#undef ANTENNA0_CHAINMASK +#undef ANTENNA1_CHAINMASK +} + +static const char* +ar9285Probe(uint16_t vendorid, uint16_t devid) +{ + if (vendorid == ATHEROS_VENDOR_ID && devid == AR9285_DEVID_PCIE) + return "Atheros 9285"; + return AH_NULL; +} +AH_CHIP(AR9285, ar9285Probe, ar9285Attach); Added: head/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Mon Feb 15 17:49:49 2010 (r203930) @@ -0,0 +1,951 @@ +/* + * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting + * Copyright (c) 2002-2008 Atheros Communications, Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +/* + * This is almost the same as ar5416_reset.c but uses the v4k EEPROM and + * supports only 2Ghz operation. + */ + +#include "opt_ah.h" + +#include "ah.h" +#include "ah_internal.h" +#include "ah_devid.h" + +#include "ah_eeprom_v14.h" +#include "ah_eeprom_v4k.h" + +#include "ar5416/ar9285.h" +#include "ar5416/ar5416.h" +#include "ar5416/ar5416reg.h" +#include "ar5416/ar5416phy.h" + +/* Eeprom versioning macros. Returns true if the version is equal or newer than the ver specified */ +#define EEP_MINOR(_ah) \ + (AH_PRIVATE(_ah)->ah_eeversion & AR5416_EEP_VER_MINOR_MASK) +#define IS_EEP_MINOR_V2(_ah) (EEP_MINOR(_ah) >= AR5416_EEP_MINOR_VER_2) +#define IS_EEP_MINOR_V3(_ah) (EEP_MINOR(_ah) >= AR5416_EEP_MINOR_VER_3) + +/* Additional Time delay to wait after activiting the Base band */ +#define BASE_ACTIVATE_DELAY 100 /* 100 usec */ +#define PLL_SETTLE_DELAY 300 /* 300 usec */ +#define RTC_PLL_SETTLE_DELAY 1000 /* 1 ms */ + +static HAL_BOOL ar9285SetPowerPerRateTable(struct ath_hal *ah, + struct ar5416eeprom_4k *pEepData, + const struct ieee80211_channel *chan, int16_t *ratesArray, + uint16_t cfgCtl, uint16_t AntennaReduction, + uint16_t twiceMaxRegulatoryPower, + uint16_t powerLimit); +static HAL_BOOL ar9285SetPowerCalTable(struct ath_hal *ah, + struct ar5416eeprom_4k *pEepData, + const struct ieee80211_channel *chan, + int16_t *pTxPowerIndexOffset); +static int16_t interpolate(uint16_t target, uint16_t srcLeft, + uint16_t srcRight, int16_t targetLeft, int16_t targetRight); +static HAL_BOOL ar9285FillVpdTable(uint8_t, uint8_t, uint8_t *, uint8_t *, + uint16_t, uint8_t *); +static void ar9285GetGainBoundariesAndPdadcs(struct ath_hal *ah, + const struct ieee80211_channel *chan, CAL_DATA_PER_FREQ_4K *pRawDataSet, + uint8_t * bChans, uint16_t availPiers, + uint16_t tPdGainOverlap, int16_t *pMinCalPower, + uint16_t * pPdGainBoundaries, uint8_t * pPDADCValues, + uint16_t numXpdGains); +static HAL_BOOL getLowerUpperIndex(uint8_t target, uint8_t *pList, + uint16_t listSize, uint16_t *indexL, uint16_t *indexR); +static uint16_t ar9285GetMaxEdgePower(uint16_t, CAL_CTL_EDGES *); + +/* XXX gag, this is sick */ +typedef enum Ar5416_Rates { + rate6mb, rate9mb, rate12mb, rate18mb, + rate24mb, rate36mb, rate48mb, rate54mb, + rate1l, rate2l, rate2s, rate5_5l, + rate5_5s, rate11l, rate11s, rateXr, + rateHt20_0, rateHt20_1, rateHt20_2, rateHt20_3, + rateHt20_4, rateHt20_5, rateHt20_6, rateHt20_7, + rateHt40_0, rateHt40_1, rateHt40_2, rateHt40_3, + rateHt40_4, rateHt40_5, rateHt40_6, rateHt40_7, + rateDupCck, rateDupOfdm, rateExtCck, rateExtOfdm, + Ar5416RateSize +} AR5416_RATES; + +HAL_BOOL +ar9285SetTransmitPower(struct ath_hal *ah, + const struct ieee80211_channel *chan, uint16_t *rfXpdGain) +{ +#define POW_SM(_r, _s) (((_r) & 0x3f) << (_s)) +#define N(a) (sizeof (a) / sizeof (a[0])) + + MODAL_EEP4K_HEADER *pModal; + struct ath_hal_5212 *ahp = AH5212(ah); + int16_t ratesArray[Ar5416RateSize]; + int16_t txPowerIndexOffset = 0; + uint8_t ht40PowerIncForPdadc = 2; + int i; + + uint16_t cfgCtl; + uint16_t powerLimit; + uint16_t twiceAntennaReduction; + uint16_t twiceMaxRegulatoryPower; + int16_t maxPower; + HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom; + struct ar5416eeprom_4k *pEepData = &ee->ee_base; + + HALASSERT(AH_PRIVATE(ah)->ah_eeversion >= AR_EEPROM_VER14_1); + + /* Setup info for the actual eeprom */ + OS_MEMZERO(ratesArray, sizeof(ratesArray)); + cfgCtl = ath_hal_getctl(ah, chan); + powerLimit = chan->ic_maxregpower * 2; + twiceAntennaReduction = chan->ic_maxantgain; + twiceMaxRegulatoryPower = AH_MIN(MAX_RATE_POWER, AH_PRIVATE(ah)->ah_powerLimit); + pModal = &pEepData->modalHeader; + HALDEBUG(ah, HAL_DEBUG_RESET, "%s Channel=%u CfgCtl=%u\n", + __func__,chan->ic_freq, cfgCtl ); + + if (IS_EEP_MINOR_V2(ah)) { + ht40PowerIncForPdadc = pModal->ht40PowerIncForPdadc; + } + + if (!ar9285SetPowerPerRateTable(ah, pEepData, chan, + &ratesArray[0],cfgCtl, + twiceAntennaReduction, + twiceMaxRegulatoryPower, powerLimit)) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s: unable to set tx power per rate table\n", __func__); + return AH_FALSE; + } + + if (!ar9285SetPowerCalTable(ah, pEepData, chan, &txPowerIndexOffset)) { + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: unable to set power table\n", + __func__); + return AH_FALSE; + } + + maxPower = AH_MAX(ratesArray[rate6mb], ratesArray[rateHt20_0]); + maxPower = AH_MAX(maxPower, ratesArray[rate1l]); + + if (IEEE80211_IS_CHAN_HT40(chan)) { + maxPower = AH_MAX(maxPower, ratesArray[rateHt40_0]); + } + + ahp->ah_tx6PowerInHalfDbm = maxPower; + AH_PRIVATE(ah)->ah_maxPowerLevel = maxPower; + ahp->ah_txPowerIndexOffset = txPowerIndexOffset; + + /* + * txPowerIndexOffset is set by the SetPowerTable() call - + * adjust the rate table (0 offset if rates EEPROM not loaded) + */ + for (i = 0; i < N(ratesArray); i++) { + ratesArray[i] = (int16_t)(txPowerIndexOffset + ratesArray[i]); + if (ratesArray[i] > AR5416_MAX_RATE_POWER) + ratesArray[i] = AR5416_MAX_RATE_POWER; + ratesArray[i] -= AR5416_PWR_TABLE_OFFSET_DB * 2; + } + +#ifdef AH_EEPROM_DUMP + ar5416PrintPowerPerRate(ah, ratesArray); +#endif + + /* Write the OFDM power per rate set */ + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE1, + POW_SM(ratesArray[rate18mb], 24) + | POW_SM(ratesArray[rate12mb], 16) + | POW_SM(ratesArray[rate9mb], 8) + | POW_SM(ratesArray[rate6mb], 0) + ); + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE2, + POW_SM(ratesArray[rate54mb], 24) + | POW_SM(ratesArray[rate48mb], 16) + | POW_SM(ratesArray[rate36mb], 8) + | POW_SM(ratesArray[rate24mb], 0) + ); + + /* Write the CCK power per rate set */ + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE3, + POW_SM(ratesArray[rate2s], 24) + | POW_SM(ratesArray[rate2l], 16) + | POW_SM(ratesArray[rateXr], 8) /* XR target power */ + | POW_SM(ratesArray[rate1l], 0) + ); + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE4, + POW_SM(ratesArray[rate11s], 24) + | POW_SM(ratesArray[rate11l], 16) + | POW_SM(ratesArray[rate5_5s], 8) + | POW_SM(ratesArray[rate5_5l], 0) + ); + HALDEBUG(ah, HAL_DEBUG_RESET, + "%s AR_PHY_POWER_TX_RATE3=0x%x AR_PHY_POWER_TX_RATE4=0x%x\n", + __func__, OS_REG_READ(ah,AR_PHY_POWER_TX_RATE3), + OS_REG_READ(ah,AR_PHY_POWER_TX_RATE4)); + + /* Write the HT20 power per rate set */ + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE5, + POW_SM(ratesArray[rateHt20_3], 24) + | POW_SM(ratesArray[rateHt20_2], 16) + | POW_SM(ratesArray[rateHt20_1], 8) + | POW_SM(ratesArray[rateHt20_0], 0) + ); + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE6, + POW_SM(ratesArray[rateHt20_7], 24) + | POW_SM(ratesArray[rateHt20_6], 16) + | POW_SM(ratesArray[rateHt20_5], 8) + | POW_SM(ratesArray[rateHt20_4], 0) + ); + + if (IEEE80211_IS_CHAN_HT40(chan)) { + /* Write the HT40 power per rate set */ + /* Correct PAR difference between HT40 and HT20/LEGACY */ + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE7, + POW_SM(ratesArray[rateHt40_3] + ht40PowerIncForPdadc, 24) + | POW_SM(ratesArray[rateHt40_2] + ht40PowerIncForPdadc, 16) + | POW_SM(ratesArray[rateHt40_1] + ht40PowerIncForPdadc, 8) + | POW_SM(ratesArray[rateHt40_0] + ht40PowerIncForPdadc, 0) + ); + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE8, + POW_SM(ratesArray[rateHt40_7] + ht40PowerIncForPdadc, 24) + | POW_SM(ratesArray[rateHt40_6] + ht40PowerIncForPdadc, 16) + | POW_SM(ratesArray[rateHt40_5] + ht40PowerIncForPdadc, 8) + | POW_SM(ratesArray[rateHt40_4] + ht40PowerIncForPdadc, 0) + ); + /* Write the Dup/Ext 40 power per rate set */ + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE9, + POW_SM(ratesArray[rateExtOfdm], 24) + | POW_SM(ratesArray[rateExtCck], 16) + | POW_SM(ratesArray[rateDupOfdm], 8) + | POW_SM(ratesArray[rateDupCck], 0) + ); + } + + return AH_TRUE; +#undef POW_SM +#undef N +} + +HAL_BOOL +ar9285SetBoardValues(struct ath_hal *ah, const struct ieee80211_channel *chan) +{ + const HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom; + const struct ar5416eeprom_4k *eep = &ee->ee_base; + const MODAL_EEP4K_HEADER *pModal; + int i, regChainOffset; + uint8_t txRxAttenLocal; /* workaround for eeprom versions <= 14.2 */ + + HALASSERT(AH_PRIVATE(ah)->ah_eeversion >= AR_EEPROM_VER14_1); + pModal = &eep->modalHeader; + + /* NB: workaround for eeprom versions <= 14.2 */ + txRxAttenLocal = 23; + + OS_REG_WRITE(ah, AR_PHY_SWITCH_COM, pModal->antCtrlCommon); + for (i = 0; i < AR5416_4K_MAX_CHAINS; i++) { + if (AR_SREV_MERLIN(ah)) { + if (i >= 2) break; + } + if (AR_SREV_OWL_20_OR_LATER(ah) && + (AH5416(ah)->ah_rx_chainmask == 0x5 || + AH5416(ah)->ah_tx_chainmask == 0x5) && i != 0) { + /* Regs are swapped from chain 2 to 1 for 5416 2_0 with + * only chains 0 and 2 populated + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 18:14:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2AB61065670; Mon, 15 Feb 2010 18:14:51 +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 928AC8FC15; Mon, 15 Feb 2010 18:14: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 o1FIEpB1076417; Mon, 15 Feb 2010 18:14:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FIEpXP076415; Mon, 15 Feb 2010 18:14:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002151814.o1FIEpXP076415@svn.freebsd.org> From: Alexander Motin Date: Mon, 15 Feb 2010 18:14: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: r203931 - head/sys/cam/scsi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 18:14:51 -0000 Author: mav Date: Mon Feb 15 18:14:51 2010 New Revision: 203931 URL: http://svn.freebsd.org/changeset/base/203931 Log: Make CD driver a bit more robust and predictable to unreported errors. Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Mon Feb 15 17:49:49 2010 (r203930) +++ head/sys/cam/scsi/scsi_cd.c Mon Feb 15 18:14:51 2010 (r203931) @@ -638,15 +638,14 @@ cdregister(struct cam_periph *periph, vo return(CAM_REQ_CMP_ERR); } - softc = (struct cd_softc *)malloc(sizeof(*softc),M_DEVBUF,M_NOWAIT); - + softc = (struct cd_softc *)malloc(sizeof(*softc),M_DEVBUF, + M_NOWAIT | M_ZERO); if (softc == NULL) { printf("cdregister: Unable to probe new device. " "Unable to allocate softc\n"); return(CAM_REQ_CMP_ERR); } - bzero(softc, sizeof(*softc)); LIST_INIT(&softc->pending_ccbs); STAILQ_INIT(&softc->mode_queue); softc->state = CD_STATE_PROBE; @@ -861,8 +860,7 @@ cdregister(struct cam_periph *periph, vo */ else { nchanger = malloc(sizeof(struct cdchanger), - M_DEVBUF, M_NOWAIT); - + M_DEVBUF, M_NOWAIT | M_ZERO); if (nchanger == NULL) { softc->flags &= ~CD_FLAG_CHANGER; printf("cdregister: unable to malloc " @@ -875,10 +873,6 @@ cdregister(struct cam_periph *periph, vo */ goto cdregisterexit; } - - /* zero the structure */ - bzero(nchanger, sizeof(struct cdchanger)); - if (camq_init(&nchanger->devq, 1) != 0) { softc->flags &= ~CD_FLAG_CHANGER; printf("cdregister: changer support " @@ -1506,8 +1500,7 @@ cdstart(struct cam_periph *periph, union { rcap = (struct scsi_read_capacity_data *)malloc(sizeof(*rcap), - M_SCSICD, - M_NOWAIT); + M_SCSICD, M_NOWAIT | M_ZERO); if (rcap == NULL) { xpt_print(periph->path, "cdstart: Couldn't malloc read_capacity data\n"); @@ -2073,7 +2066,7 @@ cdioctl(struct disk *dp, u_long cmd, voi u_int32_t len = args->data_len; data = malloc(sizeof(struct cd_sub_channel_info), - M_SCSICD, M_WAITOK); + M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, @@ -2125,7 +2118,7 @@ cdioctl(struct disk *dp, u_long cmd, voi struct ioc_toc_header *th; th = malloc(sizeof(struct ioc_toc_header), M_SCSICD, - M_WAITOK); + M_WAITOK | M_ZERO); cam_periph_lock(periph); CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, @@ -2162,8 +2155,8 @@ cdioctl(struct disk *dp, u_long cmd, voi u_int32_t len, readlen, idx, num; u_int32_t starting_track = te->starting_track; - data = malloc(sizeof(*data), M_SCSICD, M_WAITOK); - lead = malloc(sizeof(*lead), M_SCSICD, M_WAITOK); + data = malloc(sizeof(*data), M_SCSICD, M_WAITOK | M_ZERO); + lead = malloc(sizeof(*lead), M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, @@ -2291,7 +2284,7 @@ cdioctl(struct disk *dp, u_long cmd, voi struct ioc_toc_header *th; u_int32_t track; - data = malloc(sizeof(*data), M_SCSICD, M_WAITOK); + data = malloc(sizeof(*data), M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, @@ -2906,7 +2899,7 @@ cdsize(struct cam_periph *periph, u_int3 /* XXX Should be M_WAITOK */ rcap_buf = malloc(sizeof(struct scsi_read_capacity_data), - M_SCSICD, M_NOWAIT); + M_SCSICD, M_NOWAIT | M_ZERO); if (rcap_buf == NULL) return (ENOMEM); @@ -2925,6 +2918,9 @@ cdsize(struct cam_periph *periph, u_int3 softc->params.disksize = scsi_4btoul(rcap_buf->addr) + 1; softc->params.blksize = scsi_4btoul(rcap_buf->length); + /* Make sure we got at least some block size. */ + if (error == 0 && softc->params.blksize == 0) + error = EIO; /* * SCSI-3 mandates that the reported blocksize shall be 2048. * Older drives sometimes report funny values, trim it down to From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 18:46:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92B891065694; Mon, 15 Feb 2010 18:46:03 +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 80CEC8FC1E; Mon, 15 Feb 2010 18: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 o1FIk3wp083411; Mon, 15 Feb 2010 18:46:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FIk3G3083404; Mon, 15 Feb 2010 18:46:03 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002151846.o1FIk3G3083404@svn.freebsd.org> From: Warner Losh Date: Mon, 15 Feb 2010 18: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: r203932 - in head/games: bcd caesar morse number pom ppt primes random X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 18:46:03 -0000 Author: imp Date: Mon Feb 15 18:46:02 2010 New Revision: 203932 URL: http://svn.freebsd.org/changeset/base/203932 Log: Remove the third clause for the Berkeley parts of games, per the letter in /COPYRIGHT. Modified: head/games/bcd/bcd.c head/games/caesar/caesar.c head/games/morse/morse.c head/games/number/number.c head/games/pom/pom.c head/games/ppt/ppt.c head/games/primes/pattern.c head/games/primes/pr_tbl.c head/games/primes/primes.c head/games/primes/primes.h head/games/random/random.c Modified: head/games/bcd/bcd.c ============================================================================== --- head/games/bcd/bcd.c Mon Feb 15 18:14:51 2010 (r203931) +++ head/games/bcd/bcd.c Mon Feb 15 18:46:02 2010 (r203932) @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/games/caesar/caesar.c ============================================================================== --- head/games/caesar/caesar.c Mon Feb 15 18:14:51 2010 (r203931) +++ head/games/caesar/caesar.c Mon Feb 15 18:46:02 2010 (r203932) @@ -18,11 +18,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/games/morse/morse.c ============================================================================== --- head/games/morse/morse.c Mon Feb 15 18:14:51 2010 (r203931) +++ head/games/morse/morse.c Mon Feb 15 18:46:02 2010 (r203932) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/games/number/number.c ============================================================================== --- head/games/number/number.c Mon Feb 15 18:14:51 2010 (r203931) +++ head/games/number/number.c Mon Feb 15 18:46:02 2010 (r203932) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/games/pom/pom.c ============================================================================== --- head/games/pom/pom.c Mon Feb 15 18:14:51 2010 (r203931) +++ head/games/pom/pom.c Mon Feb 15 18:46:02 2010 (r203932) @@ -12,11 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/games/ppt/ppt.c ============================================================================== --- head/games/ppt/ppt.c Mon Feb 15 18:14:51 2010 (r203931) +++ head/games/ppt/ppt.c Mon Feb 15 18:46:02 2010 (r203932) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/games/primes/pattern.c ============================================================================== --- head/games/primes/pattern.c Mon Feb 15 18:14:51 2010 (r203931) +++ head/games/primes/pattern.c Mon Feb 15 18:46:02 2010 (r203932) @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/games/primes/pr_tbl.c ============================================================================== --- head/games/primes/pr_tbl.c Mon Feb 15 18:14:51 2010 (r203931) +++ head/games/primes/pr_tbl.c Mon Feb 15 18:46:02 2010 (r203932) @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/games/primes/primes.c ============================================================================== --- head/games/primes/primes.c Mon Feb 15 18:14:51 2010 (r203931) +++ head/games/primes/primes.c Mon Feb 15 18:46:02 2010 (r203932) @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/games/primes/primes.h ============================================================================== --- head/games/primes/primes.h Mon Feb 15 18:14:51 2010 (r203931) +++ head/games/primes/primes.h Mon Feb 15 18:46:02 2010 (r203932) @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/games/random/random.c ============================================================================== --- head/games/random/random.c Mon Feb 15 18:14:51 2010 (r203931) +++ head/games/random/random.c Mon Feb 15 18:46:02 2010 (r203932) @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 18:47:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2985A1065750; Mon, 15 Feb 2010 18:47: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 198438FC15; Mon, 15 Feb 2010 18:47: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 o1FIlgVD083807; Mon, 15 Feb 2010 18:47:42 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FIlg38083805; Mon, 15 Feb 2010 18:47:42 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201002151847.o1FIlg38083805@svn.freebsd.org> From: Rui Paulo Date: Mon, 15 Feb 2010 18:47: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: r203933 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 18:47:43 -0000 Author: rpaulo Date: Mon Feb 15 18:47:42 2010 New Revision: 203933 URL: http://svn.freebsd.org/changeset/base/203933 Log: Fix KITE version check. Obtained from: //depot/user/rpaulo/80211n/... Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Mon Feb 15 18:46:02 2010 (r203932) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Mon Feb 15 18:47:42 2010 (r203933) @@ -613,12 +613,12 @@ (AR_SREV_KITE(ah) && \ AH_PRIVATE((_ah))->ah_macRev == AR_XSREV_REVISION_KITE_11) #define AR_SREV_KITE_11_OR_LATER(_ah) \ - (AH_PRIVATE((_ah))->ah_macVersion >= AR_XSREV_VERSION_KITE || \ + (AR_SREV_KITE_11(_ah) || \ AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_KITE_11) #define AR_SREV_KITE_12(_ah) \ (AR_SREV_KITE(ah) && \ - AH_PRIVATE((_ah))->ah_macRev == AR_XSREV_REVISION_KITE_12) + AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_KITE_12) #define AR_SREV_KITE_12_OR_LATER(_ah) \ - (AH_PRIVATE((_ah))->ah_macVersion >= AR_XSREV_VERSION_KITE || \ + (AR_SREV_KITE_12(_ah) || \ AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_KITE_12) #endif /* _DEV_ATH_AR5416REG_H */ From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 19:18:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D39F6106566C; Mon, 15 Feb 2010 19:18:46 +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 C37728FC0C; Mon, 15 Feb 2010 19:18: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 o1FJIkvv090661; Mon, 15 Feb 2010 19:18:46 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FJIkFS090659; Mon, 15 Feb 2010 19:18:46 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201002151918.o1FJIkFS090659@svn.freebsd.org> From: Bernhard Schmidt Date: Mon, 15 Feb 2010 19:18: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: r203934 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 19:18:46 -0000 Author: bschmidt Date: Mon Feb 15 19:18:46 2010 New Revision: 203934 URL: http://svn.freebsd.org/changeset/base/203934 Log: Fix for the Intel WiFi Link 1000. The EEPROM image is in the OTPROM block before the last block, not in the last block itself. Approved by: rpaulo (mentor) Obtained from: OpenBSD MFC after: 3 weeks Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon Feb 15 18:47:42 2010 (r203933) +++ head/sys/dev/iwn/if_iwn.c Mon Feb 15 19:18:46 2010 (r203934) @@ -972,8 +972,7 @@ iwn_eeprom_unlock(struct iwn_softc *sc) int iwn_init_otprom(struct iwn_softc *sc) { - uint32_t base; - uint16_t next; + uint16_t prev, base, next; int count, error; /* Wait for clock stabilization before accessing prph. */ @@ -1000,25 +999,26 @@ iwn_init_otprom(struct iwn_softc *sc) IWN_OTP_GP_ECC_CORR_STTS | IWN_OTP_GP_ECC_UNCORR_STTS); /* - * Find last valid OTP block (contains the EEPROM image) for HW - * without OTP shadow RAM. + * Find the block before last block (contains the EEPROM image) + * for HW without OTP shadow RAM. */ if (sc->hw_type == IWN_HW_REV_TYPE_1000) { /* Switch to absolute addressing mode. */ IWN_CLRBITS(sc, IWN_OTP_GP, IWN_OTP_GP_RELATIVE_ACCESS); - base = 0; + base = prev = 0; for (count = 0; count < IWN1000_OTP_NBLOCKS; count++) { error = iwn_read_prom_data(sc, base, &next, 2); if (error != 0) return error; if (next == 0) /* End of linked-list. */ break; + prev = base; base = le16toh(next); } - if (base == 0 || count == IWN1000_OTP_NBLOCKS) + if (count == 0 || count == IWN1000_OTP_NBLOCKS) return EIO; /* Skip "next" word. */ - sc->prom_base = base + 1; + sc->prom_base = prev + 1; } return 0; } From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 19:30:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25F7F106566B; Mon, 15 Feb 2010 19:30:29 +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 15D698FC0A; Mon, 15 Feb 2010 19:30: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 o1FJUSP1093257; Mon, 15 Feb 2010 19:30:28 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FJUSkR093255; Mon, 15 Feb 2010 19:30:28 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201002151930.o1FJUSkR093255@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 15 Feb 2010 19: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: r203935 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 19:30:29 -0000 Author: jkim Date: Mon Feb 15 19:30:28 2010 New Revision: 203935 URL: http://svn.freebsd.org/changeset/base/203935 Log: Add support for `cycle' and `zero' events for LCD brightness control. Submitted by: Daniel Walter (d dot walter at 0x90 dot at) (intial version) Modified: head/sys/dev/acpica/acpi_video.c Modified: head/sys/dev/acpica/acpi_video.c ============================================================================== --- head/sys/dev/acpica/acpi_video.c Mon Feb 15 19:18:46 2010 (r203934) +++ head/sys/dev/acpica/acpi_video.c Mon Feb 15 19:30:28 2010 (r203935) @@ -103,8 +103,10 @@ static void vo_set_device_state(ACPI_HAN /* events */ #define VID_NOTIFY_SWITCHED 0x80 #define VID_NOTIFY_REPROBE 0x81 +#define VID_NOTIFY_CYC_BRN 0x85 #define VID_NOTIFY_INC_BRN 0x86 #define VID_NOTIFY_DEC_BRN 0x87 +#define VID_NOTIFY_ZRO_BRN 0x88 /* _DOS (Enable/Disable Output Switching) argument bits */ #define DOS_SWITCH_MASK 3 @@ -645,20 +647,41 @@ acpi_video_vo_notify_handler(ACPI_HANDLE vo = context; ACPI_SERIAL_BEGIN(video_output); - if (vo->handle != handle) { - ACPI_SERIAL_END(video_output); - return; - } + if (vo->handle != handle) + goto out; switch (notify) { + case VID_NOTIFY_CYC_BRN: + if (vo->vo_numlevels <= 3) + goto out; + /* FALLTHROUGH */ case VID_NOTIFY_INC_BRN: case VID_NOTIFY_DEC_BRN: + case VID_NOTIFY_ZRO_BRN: if (vo->vo_levels == NULL) - break; + goto out; level = vo_get_brightness(handle); if (level < 0) - break; - new_level = level; + goto out; + break; + default: + printf("unknown notify event 0x%x from %s\n", + notify, acpi_name(handle)); + goto out; + } + + new_level = level; + switch (notify) { + case VID_NOTIFY_CYC_BRN: + for (i = 2; i < vo->vo_numlevels; i++) + if (vo->vo_levels[i] == level) { + new_level = vo->vo_numlevels > i + 1 ? + vo->vo_levels[i + 1] : vo->vo_levels[2]; + break; + } + break; + case VID_NOTIFY_INC_BRN: + case VID_NOTIFY_DEC_BRN: for (i = 0; i < vo->vo_numlevels; i++) { j = vo->vo_levels[i]; if (notify == VID_NOTIFY_INC_BRN) { @@ -671,15 +694,21 @@ acpi_video_vo_notify_handler(ACPI_HANDLE new_level = j; } } - if (new_level != level) { - vo_set_brightness(handle, new_level); - vo->vo_brightness = new_level; - } break; - default: - printf("unknown notify event 0x%x from %s\n", - notify, acpi_name(handle)); + case VID_NOTIFY_ZRO_BRN: + for (i = 0; i < vo->vo_numlevels; i++) + if (vo->vo_levels[i] == 0) { + new_level = 0; + break; + } + break; } + if (new_level != level) { + vo_set_brightness(handle, new_level); + vo->vo_brightness = new_level; + } + +out: ACPI_SERIAL_END(video_output); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 20:46:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F26031065696; Mon, 15 Feb 2010 20:46:01 +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 E166E8FC41; Mon, 15 Feb 2010 20:46: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 o1FKk1lA009982; Mon, 15 Feb 2010 20:46:01 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FKk1qa009980; Mon, 15 Feb 2010 20:46:01 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201002152046.o1FKk1qa009980@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 15 Feb 2010 20:46: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: r203936 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 20:46:02 -0000 Author: jkim Date: Mon Feb 15 20:46:01 2010 New Revision: 203936 URL: http://svn.freebsd.org/changeset/base/203936 Log: Rename some macros to clarify their intentions and fix style nits. Modified: head/sys/dev/acpica/acpi_video.c Modified: head/sys/dev/acpica/acpi_video.c ============================================================================== --- head/sys/dev/acpica/acpi_video.c Mon Feb 15 19:30:28 2010 (r203935) +++ head/sys/dev/acpica/acpi_video.c Mon Feb 15 20:46:01 2010 (r203936) @@ -101,54 +101,54 @@ static UINT32 vo_get_graphics_state(ACPI static void vo_set_device_state(ACPI_HANDLE, UINT32); /* events */ -#define VID_NOTIFY_SWITCHED 0x80 -#define VID_NOTIFY_REPROBE 0x81 -#define VID_NOTIFY_CYC_BRN 0x85 +#define VID_NOTIFY_SWITCHED 0x80 +#define VID_NOTIFY_REPROBE 0x81 +#define VID_NOTIFY_CYCLE_BRN 0x85 #define VID_NOTIFY_INC_BRN 0x86 #define VID_NOTIFY_DEC_BRN 0x87 -#define VID_NOTIFY_ZRO_BRN 0x88 +#define VID_NOTIFY_ZERO_BRN 0x88 /* _DOS (Enable/Disable Output Switching) argument bits */ -#define DOS_SWITCH_MASK 3 -#define DOS_SWITCH_BY_OSPM 0 -#define DOS_SWITCH_BY_BIOS 1 -#define DOS_SWITCH_LOCKED 2 -#define DOS_BRIGHTNESS_BY_BIOS (1 << 2) +#define DOS_SWITCH_MASK 3 +#define DOS_SWITCH_BY_OSPM 0 +#define DOS_SWITCH_BY_BIOS 1 +#define DOS_SWITCH_LOCKED 2 +#define DOS_BRIGHTNESS_BY_OSPM (1 << 2) /* _DOD and subdev's _ADR */ -#define DOD_DEVID_MASK 0x0f00 -#define DOD_DEVID_MASK_FULL 0xffff -#define DOD_DEVID_MASK_DISPIDX 0x000f -#define DOD_DEVID_MASK_DISPPORT 0x00f0 -#define DOD_DEVID_MONITOR 0x0100 -#define DOD_DEVID_LCD 0x0110 -#define DOD_DEVID_TV 0x0200 -#define DOD_DEVID_EXT 0x0300 -#define DOD_DEVID_INTDFP 0x0400 -#define DOD_BIOS (1 << 16) -#define DOD_NONVGA (1 << 17) -#define DOD_HEAD_ID_SHIFT 18 -#define DOD_HEAD_ID_BITS 3 -#define DOD_HEAD_ID_MASK \ +#define DOD_DEVID_MASK 0x0f00 +#define DOD_DEVID_MASK_FULL 0xffff +#define DOD_DEVID_MASK_DISPIDX 0x000f +#define DOD_DEVID_MASK_DISPPORT 0x00f0 +#define DOD_DEVID_MONITOR 0x0100 +#define DOD_DEVID_LCD 0x0110 +#define DOD_DEVID_TV 0x0200 +#define DOD_DEVID_EXT 0x0300 +#define DOD_DEVID_INTDFP 0x0400 +#define DOD_BIOS (1 << 16) +#define DOD_NONVGA (1 << 17) +#define DOD_HEAD_ID_SHIFT 18 +#define DOD_HEAD_ID_BITS 3 +#define DOD_HEAD_ID_MASK \ (((1 << DOD_HEAD_ID_BITS) - 1) << DOD_HEAD_ID_SHIFT) -#define DOD_DEVID_SCHEME_STD (1 << 31) +#define DOD_DEVID_SCHEME_STD (1 << 31) /* _BCL related constants */ -#define BCL_FULLPOWER 0 -#define BCL_ECONOMY 1 +#define BCL_FULLPOWER 0 +#define BCL_ECONOMY 1 /* _DCS (Device Currrent Status) value bits and masks. */ -#define DCS_EXISTS (1 << 0) -#define DCS_ACTIVE (1 << 1) -#define DCS_READY (1 << 2) -#define DCS_FUNCTIONAL (1 << 3) -#define DCS_ATTACHED (1 << 4) +#define DCS_EXISTS (1 << 0) +#define DCS_ACTIVE (1 << 1) +#define DCS_READY (1 << 2) +#define DCS_FUNCTIONAL (1 << 3) +#define DCS_ATTACHED (1 << 4) /* _DSS (Device Set Status) argument bits and masks. */ -#define DSS_INACTIVE 0 -#define DSS_ACTIVE (1 << 0) -#define DSS_SETNEXT (1 << 30) -#define DSS_COMMIT (1 << 31) +#define DSS_INACTIVE 0 +#define DSS_ACTIVE (1 << 0) +#define DSS_SETNEXT (1 << 30) +#define DSS_COMMIT (1 << 31) static device_method_t acpi_video_methods[] = { DEVMETHOD(device_identify, acpi_video_identify), @@ -275,7 +275,7 @@ acpi_video_attach(device_t dev) * brightness levels. */ vid_set_switch_policy(sc->handle, DOS_SWITCH_BY_OSPM | - DOS_BRIGHTNESS_BY_BIOS); + DOS_BRIGHTNESS_BY_OSPM); acpi_video_power_profile(sc); @@ -651,13 +651,13 @@ acpi_video_vo_notify_handler(ACPI_HANDLE goto out; switch (notify) { - case VID_NOTIFY_CYC_BRN: + case VID_NOTIFY_CYCLE_BRN: if (vo->vo_numlevels <= 3) goto out; /* FALLTHROUGH */ case VID_NOTIFY_INC_BRN: case VID_NOTIFY_DEC_BRN: - case VID_NOTIFY_ZRO_BRN: + case VID_NOTIFY_ZERO_BRN: if (vo->vo_levels == NULL) goto out; level = vo_get_brightness(handle); @@ -672,7 +672,7 @@ acpi_video_vo_notify_handler(ACPI_HANDLE new_level = level; switch (notify) { - case VID_NOTIFY_CYC_BRN: + case VID_NOTIFY_CYCLE_BRN: for (i = 2; i < vo->vo_numlevels; i++) if (vo->vo_levels[i] == level) { new_level = vo->vo_numlevels > i + 1 ? @@ -695,7 +695,7 @@ acpi_video_vo_notify_handler(ACPI_HANDLE } } break; - case VID_NOTIFY_ZRO_BRN: + case VID_NOTIFY_ZERO_BRN: for (i = 0; i < vo->vo_numlevels; i++) if (vo->vo_levels[i] == 0) { new_level = 0; From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 22:11:40 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 705531065679; Mon, 15 Feb 2010 22:11:40 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by mx1.freebsd.org (Postfix) with ESMTP id 07C9E8FC12; Mon, 15 Feb 2010 22:11:39 +0000 (UTC) Received: by iwn5 with SMTP id 5so2194403iwn.9 for ; Mon, 15 Feb 2010 14:11:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=0uRgVz4PeJr6t30j3xNvd0T8SCD46aKJIKCyQH902F8=; b=Ae1kisffBkiLL3VC+OpLpWK0qNCZutyaf13ISRmLgMwmoNd4bEuhA2M8KAznqjTz+A LWagQPSl5X7yZ2pxfWyQrxHSZ3IJwGWvHEuEUe45vRNkt5SYrxyoHmWHlAZRz/No1LKz dh2w8z6nSMOwgR01wQXopjvgO+wRWxGhdUD7k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=nC91AXYspfxmCVruwoL+xoZnSf0OEvuKg8TJrfWC+SAXxZLYbb2su4wzZo8nX8BOl4 +is9Q7APmplRBMAdtlODdRwUziWe9TWZquoJp1PFAyVK0aP3jTUg1Kt2DqRV9qkcyWpw ziiMtdpwfi4XPsc8Z6aNOAD4BFjF27wkH/Zi4= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.231.167.65 with SMTP id p1mr821296iby.20.1266271899366; Mon, 15 Feb 2010 14:11:39 -0800 (PST) In-Reply-To: <20100210203519.GA44831@FreeBSD.org> References: <201002101630.o1AGU4kn043737@svn.freebsd.org> <20100210203519.GA44831@FreeBSD.org> Date: Mon, 15 Feb 2010 23:11:39 +0100 X-Google-Sender-Auth: edefc3aac781870a Message-ID: <3bbf2fe11002151411u552a4749j847b3e10645293e7@mail.gmail.com> From: Attilio Rao To: Alexey Dokuchaev 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: r203758 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 22:11:40 -0000 2010/2/10 Alexey Dokuchaev : > On Wed, Feb 10, 2010 at 04:30:04PM +0000, Attilio Rao wrote: >> Author: attilio >> Date: Wed Feb 10 16:30:04 2010 >> New Revision: 203758 >> URL: http://svn.freebsd.org/changeset/base/203758 >> >> Log: >> =C2=A0 Add the options DEADLKRES (introducing the deadlock resolver thre= ad) in >> =C2=A0 the 'debugging' section of any HEAD kernel and enable for the mai= nstream >> =C2=A0 ones, excluding the embedded architectures. >> =C2=A0 It may, of course, enabled on a case-by-case basis. >> >> =C2=A0 Sponsored by: =C2=A0 =C2=A0 =C2=A0 Sandvine Incorporated >> =C2=A0 Requested by: =C2=A0 =C2=A0 =C2=A0 emaste >> =C2=A0 Discussed with: =C2=A0 =C2=A0 kib >> >> @@ -72,6 +72,7 @@ options =C2=A0 =C2=A0 INCLUDE_CONFIG_FILE =C2=A0 =C2= =A0 # Inclu >> =C2=A0options =C2=A0 =C2=A0 =C2=A0KDB =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Enable kernel debugger support. >> =C2=A0options =C2=A0 =C2=A0 =C2=A0DDB =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Support DDB. >> =C2=A0options =C2=A0 =C2=A0 =C2=A0GDB =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Support remote GDB. >> +options =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DEADLKRES =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Enable the deadlock resolve= r >> =C2=A0options =C2=A0 =C2=A0 =C2=A0INVARIANTS =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0# Enable calls of extra sanity checking > > Garbled indentation suggests you've put after "options" instead of > space. =C2=A0If you decide to fix it, you can take care of the similar er= ror > with FLOWTABLE option at least in amd64/conf/GENERIC. I'm sorry but it seems that all the other (at least for debugging) are as 'optionsMACRO' which is what I did here, or I made something wrong? Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 22:21:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A373D106566B; Mon, 15 Feb 2010 22:21:08 +0000 (UTC) (envelope-from julian@elischer.org) Received: from out-0.mx.aerioconnect.net (outw.internet-mail-service.net [216.240.47.246]) by mx1.freebsd.org (Postfix) with ESMTP id 816608FC0C; Mon, 15 Feb 2010 22:21:08 +0000 (UTC) Received: from idiom.com (postfix@mx0.idiom.com [216.240.32.160]) by out-0.mx.aerioconnect.net (8.13.8/8.13.8) with ESMTP id o1FML7He008453; Mon, 15 Feb 2010 14:21:07 -0800 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id 55B372D6A08; Mon, 15 Feb 2010 14:21:07 -0800 (PST) Message-ID: <4B79C902.6080908@elischer.org> Date: Mon, 15 Feb 2010 14:21:54 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Attilio Rao References: <201002101630.o1AGU4kn043737@svn.freebsd.org> <20100210203519.GA44831@FreeBSD.org> <3bbf2fe11002151411u552a4749j847b3e10645293e7@mail.gmail.com> In-Reply-To: <3bbf2fe11002151411u552a4749j847b3e10645293e7@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 216.240.47.51 Cc: svn-src-head@freebsd.org Subject: Re: svn commit: r203758 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 22:21:08 -0000 Attilio Rao wrote: > 2010/2/10 Alexey Dokuchaev : >> On Wed, Feb 10, 2010 at 04:30:04PM +0000, Attilio Rao wrote: >>> Author: attilio >>> Date: Wed Feb 10 16:30:04 2010 >>> New Revision: 203758 >>> URL: http://svn.freebsd.org/changeset/base/203758 >>> >>> Log: >>> Add the options DEADLKRES (introducing the deadlock resolver thread) in >>> the 'debugging' section of any HEAD kernel and enable for the mainstream >>> ones, excluding the embedded architectures. >>> It may, of course, enabled on a case-by-case basis. >>> >>> Sponsored by: Sandvine Incorporated >>> Requested by: emaste >>> Discussed with: kib >>> >>> @@ -72,6 +72,7 @@ options INCLUDE_CONFIG_FILE # Inclu >>> options KDB # Enable kernel debugger support. >>> options DDB # Support DDB. >>> options GDB # Support remote GDB. >>> +options DEADLKRES # Enable the deadlock resolver >>> options INVARIANTS # Enable calls of extra sanity checking >> Garbled indentation suggests you've put after "options" instead of >> space. If you decide to fix it, you can take care of the similar error >> with FLOWTABLE option at least in amd64/conf/GENERIC. > > I'm sorry but it seems that all the other (at least for debugging) are > as 'optionsMACRO' which is what I did here, or I made something > wrong? you may have done or similar.. > > Attilio > > From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 22:35:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8588106566C for ; Mon, 15 Feb 2010 22:35:51 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by mx1.freebsd.org (Postfix) with ESMTP id 898448FC14 for ; Mon, 15 Feb 2010 22:35:51 +0000 (UTC) Received: by iwn5 with SMTP id 5so2211742iwn.9 for ; Mon, 15 Feb 2010 14:35:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=I4DokLmC9kcoeC3cpz3KpsHtBZOHUX5oCUbD0z4Aoyg=; b=vASJRHvVlYXW0rju0xq2YT4lxSC8aax0wjFxlButh96em1HLBcWnSw0WpQc4RQhlbU vjFHyw0Zyob8E2YU/Nu0Nq/9f1UbrQVRZKlrB4Nq0m9gt5SY2J24zKIjOH1kAHfAGWRB v7foPmxEM/LS6AkAhvSb3xqWzlP7hQRCjm/Wg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=kd28qSIOf9aLT+KUiF8SFYMjg+s7aY09mKaXAq7esKENPo4fZeq1t2tdoSNSNgG8sf pWwlB6427DkaMyzxnw2VDoJJMtBUc7IqIEl7jScaiM7bxMy1PQ5BP+KuKZr5NXSQ73iu xNsjygKoNecj4o/mt1GPNZ5Ojgh3QX18xiEGo= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.231.168.136 with SMTP id u8mr9260069iby.56.1266273350970; Mon, 15 Feb 2010 14:35:50 -0800 (PST) In-Reply-To: <4B79C902.6080908@elischer.org> References: <201002101630.o1AGU4kn043737@svn.freebsd.org> <20100210203519.GA44831@FreeBSD.org> <3bbf2fe11002151411u552a4749j847b3e10645293e7@mail.gmail.com> <4B79C902.6080908@elischer.org> Date: Mon, 15 Feb 2010 23:35:50 +0100 X-Google-Sender-Auth: f98ab2db96251b61 Message-ID: <3bbf2fe11002151435i3cc65756yecebaf76b6dc76cc@mail.gmail.com> From: Attilio Rao To: Julian Elischer Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org Subject: Re: svn commit: r203758 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 22:35:52 -0000 2010/2/15 Julian Elischer : > Attilio Rao wrote: >> >> 2010/2/10 Alexey Dokuchaev : >>> >>> On Wed, Feb 10, 2010 at 04:30:04PM +0000, Attilio Rao wrote: >>>> >>>> Author: attilio >>>> Date: Wed Feb 10 16:30:04 2010 >>>> New Revision: 203758 >>>> URL: http://svn.freebsd.org/changeset/base/203758 >>>> >>>> Log: >>>> =C2=A0Add the options DEADLKRES (introducing the deadlock resolver thr= ead) in >>>> =C2=A0the 'debugging' section of any HEAD kernel and enable for the >>>> mainstream >>>> =C2=A0ones, excluding the embedded architectures. >>>> =C2=A0It may, of course, enabled on a case-by-case basis. >>>> >>>> =C2=A0Sponsored by: =C2=A0 =C2=A0 =C2=A0 Sandvine Incorporated >>>> =C2=A0Requested by: =C2=A0 =C2=A0 =C2=A0 emaste >>>> =C2=A0Discussed with: =C2=A0 =C2=A0 kib >>>> >>>> @@ -72,6 +72,7 @@ options =C2=A0 =C2=A0 INCLUDE_CONFIG_FILE =C2=A0 =C2= =A0 # Inclu >>>> =C2=A0options =C2=A0 =C2=A0 =C2=A0KDB =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Enable kernel debugger support. >>>> =C2=A0options =C2=A0 =C2=A0 =C2=A0DDB =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Support DDB. >>>> =C2=A0options =C2=A0 =C2=A0 =C2=A0GDB =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Support remote GDB. >>>> +options =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DEADLKRES =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Enable the deadlock >>>> resolver >>>> =C2=A0options =C2=A0 =C2=A0 =C2=A0INVARIANTS =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0# Enable calls of extra sanity >>>> checking >>> >>> Garbled indentation suggests you've put after "options" instead o= f >>> space. =C2=A0If you decide to fix it, you can take care of the similar = error >>> with FLOWTABLE option at least in amd64/conf/GENERIC. >> >> I'm sorry but it seems that all the other (at least for debugging) are >> as 'optionsMACRO' which is what I did here, or I made something >> wrong? > > you may have done or =C2=A0similar.. At least for GENERIC on amd64 it doesn't seem so. Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 22:45:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43831106568D; Mon, 15 Feb 2010 22:45:29 +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 A39C98FC1C; Mon, 15 Feb 2010 22:45:27 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA05377; Tue, 16 Feb 2010 00:45:25 +0200 (EET) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Nh9gz-000OJh-9I; Tue, 16 Feb 2010 00:45:25 +0200 Message-ID: <4B79CE84.3060901@freebsd.org> Date: Tue, 16 Feb 2010 00:45:24 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20100211) MIME-Version: 1.0 To: Attilio Rao References: <201002101630.o1AGU4kn043737@svn.freebsd.org> <20100210203519.GA44831@FreeBSD.org> <3bbf2fe11002151411u552a4749j847b3e10645293e7@mail.gmail.com> In-Reply-To: <3bbf2fe11002151411u552a4749j847b3e10645293e7@mail.gmail.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r203758 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 22:45:29 -0000 on 16/02/2010 00:11 Attilio Rao said the following: > 2010/2/10 Alexey Dokuchaev : >> On Wed, Feb 10, 2010 at 04:30:04PM +0000, Attilio Rao wrote: >>> Author: attilio >>> Date: Wed Feb 10 16:30:04 2010 >>> New Revision: 203758 >>> URL: http://svn.freebsd.org/changeset/base/203758 >>> >>> Log: >>> Add the options DEADLKRES (introducing the deadlock resolver thread) in >>> the 'debugging' section of any HEAD kernel and enable for the mainstream >>> ones, excluding the embedded architectures. >>> It may, of course, enabled on a case-by-case basis. >>> >>> Sponsored by: Sandvine Incorporated >>> Requested by: emaste >>> Discussed with: kib >>> >>> @@ -72,6 +72,7 @@ options INCLUDE_CONFIG_FILE # Inclu >>> options KDB # Enable kernel debugger support. >>> options DDB # Support DDB. >>> options GDB # Support remote GDB. >>> +options DEADLKRES # Enable the deadlock resolver >>> options INVARIANTS # Enable calls of extra sanity checking >> Garbled indentation suggests you've put after "options" instead of >> space. If you decide to fix it, you can take care of the similar error >> with FLOWTABLE option at least in amd64/conf/GENERIC. > > I'm sorry but it seems that all the other (at least for debugging) are > as 'optionsMACRO' which is what I did here, or I made something > wrong? At least in the i386/amd64 kernel config files typically we have: optionsOPTION And it is the case for the quoted above amd64 context. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 22:48:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E90D106566B; Mon, 15 Feb 2010 22:48:45 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.223.175]) by mx1.freebsd.org (Postfix) with ESMTP id 9AE518FC13; Mon, 15 Feb 2010 22:48:44 +0000 (UTC) Received: by iwn5 with SMTP id 5so2220782iwn.9 for ; Mon, 15 Feb 2010 14:48:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=ZZoGyZF8hyjS6oMCejeZaxedQREyTgpgMkZHRLtSa5Q=; b=HqPvTJfd9GxugEWHbOhL3obfAKTfbW2DwibA+/yN6RJWSBi4tTNmgAsRj+BBnaVMz1 I+jhtlv1Fk463LBKJYp305M67V749gpL1jidouwQ94F6zbefJyi0vdsfcWoLhJ/+lqkj 52a8nY7AvuWtuDujHKNTTW/blkqVm7Vv28Tvw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=reRli6nu8VolFgvOtUvOSt8VmHoWP313tdGRzWqZQKBx8s4bO1tvO+4hqqbYOjDq7R UNKrTBJJ2zC98dseW5GpvhJao+OMBQ2KwEQCux6cGeANx6NDjIMs03lux5v6CbbQcMDH coetXGpYjqJvCBHMljswoWsP1Lm1DwtUM10zE= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.231.148.134 with SMTP id p6mr5863655ibv.96.1266274123991; Mon, 15 Feb 2010 14:48:43 -0800 (PST) In-Reply-To: <4B79CE84.3060901@freebsd.org> References: <201002101630.o1AGU4kn043737@svn.freebsd.org> <20100210203519.GA44831@FreeBSD.org> <3bbf2fe11002151411u552a4749j847b3e10645293e7@mail.gmail.com> <4B79CE84.3060901@freebsd.org> Date: Mon, 15 Feb 2010 23:48:43 +0100 X-Google-Sender-Auth: ffc284d068b42dbf Message-ID: <3bbf2fe11002151448t6ca9a519s65fda66af3927086@mail.gmail.com> From: Attilio Rao To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Alexey Dokuchaev , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r203758 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 22:48:45 -0000 2010/2/15 Andriy Gapon : > on 16/02/2010 00:11 Attilio Rao said the following: >> 2010/2/10 Alexey Dokuchaev : >>> On Wed, Feb 10, 2010 at 04:30:04PM +0000, Attilio Rao wrote: >>>> Author: attilio >>>> Date: Wed Feb 10 16:30:04 2010 >>>> New Revision: 203758 >>>> URL: http://svn.freebsd.org/changeset/base/203758 >>>> >>>> Log: >>>> =C2=A0 Add the options DEADLKRES (introducing the deadlock resolver th= read) in >>>> =C2=A0 the 'debugging' section of any HEAD kernel and enable for the m= ainstream >>>> =C2=A0 ones, excluding the embedded architectures. >>>> =C2=A0 It may, of course, enabled on a case-by-case basis. >>>> >>>> =C2=A0 Sponsored by: =C2=A0 =C2=A0 =C2=A0 Sandvine Incorporated >>>> =C2=A0 Requested by: =C2=A0 =C2=A0 =C2=A0 emaste >>>> =C2=A0 Discussed with: =C2=A0 =C2=A0 kib >>>> >>>> @@ -72,6 +72,7 @@ options =C2=A0 =C2=A0 INCLUDE_CONFIG_FILE =C2=A0 =C2= =A0 # Inclu >>>> =C2=A0options =C2=A0 =C2=A0 =C2=A0KDB =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Enable kernel debugger support. >>>> =C2=A0options =C2=A0 =C2=A0 =C2=A0DDB =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Support DDB. >>>> =C2=A0options =C2=A0 =C2=A0 =C2=A0GDB =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Support remote GDB. >>>> +options =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0DEADLKRES =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 # Enable the deadlock resolve= r >>>> =C2=A0options =C2=A0 =C2=A0 =C2=A0INVARIANTS =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0# Enable calls of extra sanity checking >>> Garbled indentation suggests you've put after "options" instead o= f >>> space. =C2=A0If you decide to fix it, you can take care of the similar = error >>> with FLOWTABLE option at least in amd64/conf/GENERIC. >> >> I'm sorry but it seems that all the other (at least for debugging) are >> as 'optionsMACRO' which is what I did here, or I made something >> wrong? > > At least in the i386/amd64 kernel config files typically we have: > optionsOPTION > And it is the case for the quoted above amd64 context. Oh, I see now, I did opposed to . Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 23:17:45 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02B4E1065676; Mon, 15 Feb 2010 23:17:45 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id C74E28FC18; Mon, 15 Feb 2010 23:17:44 +0000 (UTC) Received: from ice.local ([10.0.0.115]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id o1FNHhRY085760 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 15 Feb 2010 15:17:44 -0800 (PST) (envelope-from sam@errno.com) Message-ID: <4B79D617.2010009@errno.com> Date: Mon, 15 Feb 2010 15:17:43 -0800 From: Sam Leffler User-Agent: Thunderbird 2.0.0.23 (Macintosh/20090812) MIME-Version: 1.0 To: Rui Paulo References: <201002151847.o1FIlg38083805@svn.freebsd.org> In-Reply-To: <201002151847.o1FIlg38083805@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r203933 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 23:17:45 -0000 Rui Paulo wrote: > Author: rpaulo > Date: Mon Feb 15 18:47:42 2010 > New Revision: 203933 > URL: http://svn.freebsd.org/changeset/base/203933 > > Log: > Fix KITE version check. > > Obtained from: //depot/user/rpaulo/80211n/... > > Modified: > head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h > > Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h > ============================================================================== > --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Mon Feb 15 18:46:02 2010 (r203932) > +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Mon Feb 15 18:47:42 2010 (r203933) > @@ -613,12 +613,12 @@ > (AR_SREV_KITE(ah) && \ > AH_PRIVATE((_ah))->ah_macRev == AR_XSREV_REVISION_KITE_11) > #define AR_SREV_KITE_11_OR_LATER(_ah) \ > - (AH_PRIVATE((_ah))->ah_macVersion >= AR_XSREV_VERSION_KITE || \ > + (AR_SREV_KITE_11(_ah) || \ > AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_KITE_11) > #define AR_SREV_KITE_12(_ah) \ > (AR_SREV_KITE(ah) && \ > - AH_PRIVATE((_ah))->ah_macRev == AR_XSREV_REVISION_KITE_12) > + AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_KITE_12) Should this be named AR_SREV_KITE_12_OR_LATER? or is the change wrong? > #define AR_SREV_KITE_12_OR_LATER(_ah) \ > - (AH_PRIVATE((_ah))->ah_macVersion >= AR_XSREV_VERSION_KITE || \ > + (AR_SREV_KITE_12(_ah) || \ > AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_KITE_12) > #endif /* _DEV_ATH_AR5416REG_H */ > > From owner-svn-src-head@FreeBSD.ORG Mon Feb 15 23:44:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 685A71065676; Mon, 15 Feb 2010 23:44:49 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 557A68FC1A; Mon, 15 Feb 2010 23:44: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 o1FNimiv049281; Mon, 15 Feb 2010 23:44:48 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FNimLB049245; Mon, 15 Feb 2010 23:44:48 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201002152344.o1FNimLB049245@svn.freebsd.org> From: Attilio Rao Date: Mon, 15 Feb 2010 23:44: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: r203938 - in head/sys: amd64/conf arm/conf conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 23:44:49 -0000 Author: attilio Date: Mon Feb 15 23:44:48 2010 New Revision: 203938 URL: http://svn.freebsd.org/changeset/base/203938 Log: Adjust style (following the already existing rules) for the newly introduced option DEADLKRES. Reported by: danfe, julian, avg Modified: head/sys/amd64/conf/GENERIC head/sys/amd64/conf/XENHVM head/sys/arm/conf/AVILA head/sys/arm/conf/BWCT head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/CRB head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/EP80219 head/sys/arm/conf/GUMSTIX head/sys/arm/conf/HL200 head/sys/arm/conf/IQ31244 head/sys/arm/conf/KB920X head/sys/arm/conf/NSLU head/sys/arm/conf/SKYEYE head/sys/conf/NOTES head/sys/i386/conf/GENERIC head/sys/i386/conf/XEN head/sys/ia64/conf/GENERIC head/sys/mips/conf/ADM5120 head/sys/mips/conf/ALCHEMY head/sys/mips/conf/IDT head/sys/mips/conf/MALTA head/sys/mips/conf/MALTA64 head/sys/mips/conf/OCTEON1 head/sys/mips/conf/OCTEON1-32 head/sys/mips/conf/QEMU head/sys/mips/conf/SENTRY5 head/sys/mips/conf/SWARM head/sys/mips/conf/XLR head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/MPC85XX head/sys/sun4v/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/amd64/conf/GENERIC Mon Feb 15 23:44:48 2010 (r203938) @@ -72,7 +72,7 @@ options INCLUDE_CONFIG_FILE # Inclu options KDB # Enable kernel debugger support. options DDB # Support DDB. options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver +options DEADLKRES # Enable the deadlock resolver options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles Modified: head/sys/amd64/conf/XENHVM ============================================================================== --- head/sys/amd64/conf/XENHVM Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/amd64/conf/XENHVM Mon Feb 15 23:44:48 2010 (r203938) @@ -70,7 +70,7 @@ options NO_ADAPTIVE_RWLOCKS options KDB # Enable kernel debugger support. options DDB # Support DDB. options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver +options DEADLKRES # Enable the deadlock resolver options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/arm/conf/AVILA Mon Feb 15 23:44:48 2010 (r203938) @@ -39,7 +39,7 @@ options DEVICE_POLLING options KDB #options GDB options DDB #Enable the kernel debugger -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/arm/conf/BWCT Mon Feb 15 23:44:48 2010 (r203938) @@ -79,7 +79,7 @@ device mii device rlswitch # Debugging for use in -current -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/arm/conf/CAMBRIA Mon Feb 15 23:44:48 2010 (r203938) @@ -39,7 +39,7 @@ options DEVICE_POLLING options KDB #options GDB options DDB #Enable the kernel debugger -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/arm/conf/CNS11XXNAS Mon Feb 15 23:44:48 2010 (r203938) @@ -39,7 +39,7 @@ options DEVICE_POLLING options KDB #options GDB options DDB #Enable the kernel debugger -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/CRB ============================================================================== --- head/sys/arm/conf/CRB Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/arm/conf/CRB Mon Feb 15 23:44:48 2010 (r203938) @@ -93,7 +93,7 @@ device pty # Debugging for use in -current options KDB options DDB #Enable the kernel debugger -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/arm/conf/DB-88F5XXX Mon Feb 15 23:44:48 2010 (r203938) @@ -39,7 +39,7 @@ options NO_SWAPPING # Debugging options ALT_BREAK_TO_DEBUGGER options DDB -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver options DIAGNOSTIC #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/arm/conf/DB-88F6XXX Mon Feb 15 23:44:48 2010 (r203938) @@ -39,7 +39,7 @@ options NO_SWAPPING # Debugging options ALT_BREAK_TO_DEBUGGER options DDB -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver options DIAGNOSTIC #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS Modified: head/sys/arm/conf/EP80219 ============================================================================== --- head/sys/arm/conf/EP80219 Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/arm/conf/EP80219 Mon Feb 15 23:44:48 2010 (r203938) @@ -89,7 +89,7 @@ device dma # I80321 DMA Controller # Debugging for use in -current options KDB options DDB #Enable the kernel debugger -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/GUMSTIX ============================================================================== --- head/sys/arm/conf/GUMSTIX Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/arm/conf/GUMSTIX Mon Feb 15 23:44:48 2010 (r203938) @@ -80,7 +80,7 @@ device pty # Debugging for use in -current options KDB options DDB #Enable the kernel debugger -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/arm/conf/HL200 Mon Feb 15 23:44:48 2010 (r203938) @@ -74,7 +74,7 @@ device mii device lxtphy # Debugging for use in -current -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/IQ31244 ============================================================================== --- head/sys/arm/conf/IQ31244 Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/arm/conf/IQ31244 Mon Feb 15 23:44:48 2010 (r203938) @@ -94,7 +94,7 @@ device "iq31244_7seg" # IQ31244 7 seg # Debugging for use in -current options KDB options DDB #Enable the kernel debugger -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/arm/conf/KB920X Mon Feb 15 23:44:48 2010 (r203938) @@ -75,7 +75,7 @@ device mii device lxtphy # Debugging for use in -current -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/arm/conf/NSLU Mon Feb 15 23:44:48 2010 (r203938) @@ -44,7 +44,7 @@ options DEVICE_POLLING options KDB #options GDB options DDB #Enable the kernel debugger -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/arm/conf/SKYEYE ============================================================================== --- head/sys/arm/conf/SKYEYE Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/arm/conf/SKYEYE Mon Feb 15 23:44:48 2010 (r203938) @@ -68,7 +68,7 @@ device uart # output. Adds ~215k to driver. # Debugging for use in -current -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/conf/NOTES Mon Feb 15 23:44:48 2010 (r203938) @@ -2547,7 +2547,7 @@ options SW_WATCHDOG # # Add the software deadlock resolver thread. # -options DEADLKRES +options DEADLKRES # # Disable swapping of stack pages. This option removes all Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/i386/conf/GENERIC Mon Feb 15 23:44:48 2010 (r203938) @@ -72,7 +72,7 @@ options INCLUDE_CONFIG_FILE # Inclu options KDB # Enable kernel debugger support. options DDB # Support DDB. options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver +options DEADLKRES # Enable the deadlock resolver options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles Modified: head/sys/i386/conf/XEN ============================================================================== --- head/sys/i386/conf/XEN Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/i386/conf/XEN Mon Feb 15 23:44:48 2010 (r203938) @@ -49,7 +49,7 @@ options AUDIT # Security event auditi options KDB # Enable kernel debugger support. options DDB # Support DDB. options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver +options DEADLKRES # Enable the deadlock resolver options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/ia64/conf/GENERIC Mon Feb 15 23:44:48 2010 (r203938) @@ -31,7 +31,7 @@ options COMPAT_43TTY # BSD 4.3 TTY comp options COMPAT_FREEBSD6 # Compatible with FreeBSD6 options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options DDB # Support DDB -options DEADLKRES # Enable the deadlock resolver +options DEADLKRES # Enable the deadlock resolver options FFS # Berkeley Fast Filesystem options GDB # Support remote GDB options GEOM_LABEL # Provides labelization Modified: head/sys/mips/conf/ADM5120 ============================================================================== --- head/sys/mips/conf/ADM5120 Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/mips/conf/ADM5120 Mon Feb 15 23:44:48 2010 (r203938) @@ -55,7 +55,7 @@ options BOOTP_COMPAT options ROOTDEVNAME=\"nfs:10.0.0.1:/mnt/bsd\" # Debugging for use in -current -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/mips/conf/ALCHEMY ============================================================================== --- head/sys/mips/conf/ALCHEMY Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/mips/conf/ALCHEMY Mon Feb 15 23:44:48 2010 (r203938) @@ -55,7 +55,7 @@ options ROOTDEVNAME=\"nfs:10.0.0.1:/mnt # Debugging for use in -current -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/mips/conf/IDT ============================================================================== --- head/sys/mips/conf/IDT Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/mips/conf/IDT Mon Feb 15 23:44:48 2010 (r203938) @@ -27,7 +27,7 @@ options BOOTP_WIRED_TO=kr0 options BOOTP_COMPAT # Debugging for use in -current -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS Modified: head/sys/mips/conf/MALTA ============================================================================== --- head/sys/mips/conf/MALTA Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/mips/conf/MALTA Mon Feb 15 23:44:48 2010 (r203938) @@ -58,7 +58,7 @@ options ROOTDEVNAME=\"ufs:ad0s1a\" # Debugging for use in -current -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/mips/conf/MALTA64 ============================================================================== --- head/sys/mips/conf/MALTA64 Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/mips/conf/MALTA64 Mon Feb 15 23:44:48 2010 (r203938) @@ -59,7 +59,7 @@ options ROOTDEVNAME=\"ufs:ad0s1a\" # Debugging for use in -current -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/mips/conf/OCTEON1 Mon Feb 15 23:44:48 2010 (r203938) @@ -67,7 +67,7 @@ options UFS_DIRHASH # Debugging for use in -current -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/mips/conf/OCTEON1-32 ============================================================================== --- head/sys/mips/conf/OCTEON1-32 Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/mips/conf/OCTEON1-32 Mon Feb 15 23:44:48 2010 (r203938) @@ -56,7 +56,7 @@ options UFS_DIRHASH # Debugging for use in -current -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/mips/conf/QEMU ============================================================================== --- head/sys/mips/conf/QEMU Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/mips/conf/QEMU Mon Feb 15 23:44:48 2010 (r203938) @@ -43,7 +43,7 @@ options PSEUDOFS #Pseudo-filesystem fr options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions # Debugging for use in -current -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/mips/conf/SENTRY5 ============================================================================== --- head/sys/mips/conf/SENTRY5 Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/mips/conf/SENTRY5 Mon Feb 15 23:44:48 2010 (r203938) @@ -56,7 +56,7 @@ options PSEUDOFS #Pseudo-filesystem fr options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions # Debugging for use in -current -#options DEADLKRES +#options DEADLKRES options INVARIANTS options INVARIANT_SUPPORT Modified: head/sys/mips/conf/SWARM ============================================================================== --- head/sys/mips/conf/SWARM Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/mips/conf/SWARM Mon Feb 15 23:44:48 2010 (r203938) @@ -47,7 +47,7 @@ options PSEUDOFS #Pseudo-filesystem fr options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions # Debugging for use in -current -#options DEADLKRES +#options DEADLKRES options INVARIANTS options INVARIANT_SUPPORT options WITNESS Modified: head/sys/mips/conf/XLR ============================================================================== --- head/sys/mips/conf/XLR Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/mips/conf/XLR Mon Feb 15 23:44:48 2010 (r203938) @@ -96,7 +96,7 @@ options DDB options KDB options GDB options ALT_BREAK_TO_DEBUGGER -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/pc98/conf/GENERIC Mon Feb 15 23:44:48 2010 (r203938) @@ -72,7 +72,7 @@ options INCLUDE_CONFIG_FILE # Inclu options KDB # Enable kernel debugger support. options DDB # Support DDB. options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver +options DEADLKRES # Enable the deadlock resolver options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/powerpc/conf/GENERIC Mon Feb 15 23:44:48 2010 (r203938) @@ -68,7 +68,7 @@ options INCLUDE_CONFIG_FILE # Inclu # Debugging for use in -current options KDB #Enable the kernel debugger options DDB #Support DDB -#options DEADLKRES #Enable the deadlock resolver +#options DEADLKRES #Enable the deadlock resolver options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS options WITNESS #Enable checks to detect deadlocks and cycles Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/powerpc/conf/MPC85XX Mon Feb 15 23:44:48 2010 (r203938) @@ -22,7 +22,7 @@ options BOOTP_WIRED_TO=tsec0 options CD9660 options COMPAT_43 options DDB -#options DEADLKRES +#options DEADLKRES options DEVICE_POLLING options HZ=1000 #options DIAGNOSTIC Modified: head/sys/sun4v/conf/GENERIC ============================================================================== --- head/sys/sun4v/conf/GENERIC Mon Feb 15 21:40:25 2010 (r203937) +++ head/sys/sun4v/conf/GENERIC Mon Feb 15 23:44:48 2010 (r203938) @@ -75,7 +75,7 @@ options DDB # Support DDB. #options TRAP_TRACING # Enable trap tracing. #options TRAP_TRACE_ENTRIES=256 # Trap trace buffer entries. #options GDB # Support remote GDB. -#options DEADLKRES # Enable the deadlock resolver +#options DEADLKRES # Enable the deadlock resolver #options INVARIANTS # Enable calls of extra sanity checking #options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS #options WITNESS # Enable checks to detect deadlocks and cycles From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 00:08:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97A12106566C; Tue, 16 Feb 2010 00:08:42 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86F368FC14; Tue, 16 Feb 2010 00:08: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 o1G08go7055147; Tue, 16 Feb 2010 00:08:42 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1G08gZm055145; Tue, 16 Feb 2010 00:08:42 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201002160008.o1G08gZm055145@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 16 Feb 2010 00:08: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: r203940 - head/sys/mips/cavium X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 00:08:42 -0000 Author: gonzo Date: Tue Feb 16 00:08:42 2010 New Revision: 203940 URL: http://svn.freebsd.org/changeset/base/203940 Log: - Clean-up output of memory banks info Modified: head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Tue Feb 16 00:05:53 2010 (r203939) +++ head/sys/mips/cavium/octeon_machdep.c Tue Feb 16 00:08:42 2010 (r203940) @@ -715,10 +715,10 @@ octeon_memory_init(void) } realmem = physmem; - printf("\nTotal DRAM Size 0x%X", (uint32_t) octeon_dram); - printf("\nBank 0 = 0x%8X -> 0x%8X", phys_avail[0], phys_avail[1]); - printf("\nBank 1 = 0x%8X -> 0x%8X\n", phys_avail[2], phys_avail[3]); - printf("\nphysmem: 0x%lx", physmem); + printf("Total DRAM Size %#X\n", (uint32_t) octeon_dram); + printf("Bank 0 = %#08X -> %#08X\n", phys_avail[0], phys_avail[1]); + printf("Bank 1 = %#08X -> %#08X\n", phys_avail[2], phys_avail[3]); + printf("physmem: %#lx\n", physmem); Maxmem = physmem; From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 00:22:05 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C05BB106566B; Tue, 16 Feb 2010 00:22:05 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 668798FC1B; Tue, 16 Feb 2010 00:22:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o1G0EDNN021255; Mon, 15 Feb 2010 17:14:13 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 15 Feb 2010 17:14:25 -0700 (MST) Message-Id: <20100215.171425.646090028373155752.imp@bsdimp.com> To: avg@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <4B79CE84.3060901@freebsd.org> References: <20100210203519.GA44831@FreeBSD.org> <3bbf2fe11002151411u552a4749j847b3e10645293e7@mail.gmail.com> <4B79CE84.3060901@freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: attilio@FreeBSD.org, svn-src-head@FreeBSD.org, danfe@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r203758 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 00:22:05 -0000 In message: <4B79CE84.3060901@freebsd.org> Andriy Gapon writes: : At least in the i386/amd64 kernel config files typically we have: : optionsOPTION : And it is the case for the quoted above amd64 context. That's the standard way to add options in all kernel config files, although there's pockets here and there which don't quite comply. Warner From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 01:07:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DAD9106566C; Tue, 16 Feb 2010 01:07:07 +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 1DD618FC14; Tue, 16 Feb 2010 01:07: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 o1G177Cv068082; Tue, 16 Feb 2010 01:07:07 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1G177SE068080; Tue, 16 Feb 2010 01:07:07 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201002160107.o1G177SE068080@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 16 Feb 2010 01:07: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: r203943 - head/etc/ppp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 01:07:07 -0000 Author: jkim Date: Tue Feb 16 01:07:06 2010 New Revision: 203943 URL: http://svn.freebsd.org/changeset/base/203943 Log: Remove COMPILATIONDATE from the default section. This string is no longer being substituted since r162063. PR: bin/143976 MFC after: 1 month Modified: head/etc/ppp/ppp.conf Modified: head/etc/ppp/ppp.conf ============================================================================== --- head/etc/ppp/ppp.conf Tue Feb 16 00:23:22 2010 (r203942) +++ head/etc/ppp/ppp.conf Tue Feb 16 01:07:06 2010 (r203943) @@ -10,7 +10,7 @@ default: set log Phase Chat LCP IPCP CCP tun command - ident user-ppp VERSION (built COMPILATIONDATE) + ident user-ppp VERSION # Ensure that "device" references the correct serial port # for your modem. (cuau0 = COM1, cuau1 = COM2) From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 01:22:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB41B106566C; Tue, 16 Feb 2010 01:22:33 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA2D18FC15; Tue, 16 Feb 2010 01:22: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 o1G1MXVH071495; Tue, 16 Feb 2010 01:22:33 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1G1MXvg071491; Tue, 16 Feb 2010 01:22:33 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201002160122.o1G1MXvg071491@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 16 Feb 2010 01:22: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: r203944 - head/sys/dev/siba X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 01:22:33 -0000 Author: weongyo Date: Tue Feb 16 01:22:33 2010 New Revision: 203944 URL: http://svn.freebsd.org/changeset/base/203944 Log: supports SPROM rev8 informations properly which are used to support low-power PHY of bwn(4) and LDO voltage adjustments. Modified: head/sys/dev/siba/siba_core.c head/sys/dev/siba/sibareg.h head/sys/dev/siba/sibavar.h Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Tue Feb 16 01:07:06 2010 (r203943) +++ head/sys/dev/siba/siba_core.c Tue Feb 16 01:22:33 2010 (r203944) @@ -1457,6 +1457,9 @@ siba_crc8(uint8_t crc, uint8_t data) (((__x) & (__mask)) / SIBA_LOWEST_SET_BIT(__mask)) #define SIBA_SHIFTOUT(_var, _offset, _mask) \ out->_var = SIBA_SHIFTOUT_SUB(in[SIBA_OFFSET(_offset)], (_mask)) +#define SIBA_SHIFTOUT_4(_var, _offset, _mask, _shift) \ + out->_var = ((((uint32_t)in[SIBA_OFFSET((_offset)+2)] << 16 | \ + in[SIBA_OFFSET(_offset)]) & (_mask)) >> (_shift)) static void siba_sprom_r123(struct siba_sprom *out, const uint16_t *in) @@ -1511,6 +1514,7 @@ siba_sprom_r123(struct siba_sprom *out, SIBA_SHIFTOUT(gpio1, SIBA_SPROM1_GPIOA, SIBA_SPROM1_GPIOA_P1); SIBA_SHIFTOUT(gpio2, SIBA_SPROM1_GPIOB, SIBA_SPROM1_GPIOB_P2); SIBA_SHIFTOUT(gpio3, SIBA_SPROM1_GPIOB, SIBA_SPROM1_GPIOB_P3); + SIBA_SHIFTOUT(maxpwr_a, SIBA_SPROM1_MAXPWR, SIBA_SPROM1_MAXPWR_A); SIBA_SHIFTOUT(maxpwr_bg, SIBA_SPROM1_MAXPWR, SIBA_SPROM1_MAXPWR_BG); SIBA_SHIFTOUT(tssi_a, SIBA_SPROM1_TSSI, SIBA_SPROM1_TSSI_A); @@ -1587,22 +1591,61 @@ siba_sprom_r8(struct siba_sprom *out, co uint16_t v; for (i = 0; i < 3; i++) { - v = in[SIBA_OFFSET(SIBA_SPROM1_MAC_80211BG) + i]; + v = in[SIBA_OFFSET(SIBA_SPROM8_MAC_80211BG) + i]; *(((uint16_t *)out->mac_80211bg) + i) = htobe16(v); } SIBA_SHIFTOUT(ccode, SIBA_SPROM8_CCODE, 0xffff); SIBA_SHIFTOUT(bf_lo, SIBA_SPROM8_BFLOW, 0xffff); SIBA_SHIFTOUT(bf_hi, SIBA_SPROM8_BFHIGH, 0xffff); + SIBA_SHIFTOUT(bf2_lo, SIBA_SPROM8_BFL2LO, 0xffff); + SIBA_SHIFTOUT(bf2_hi, SIBA_SPROM8_BFL2HI, 0xffff); SIBA_SHIFTOUT(ant_a, SIBA_SPROM8_ANTAVAIL, SIBA_SPROM8_ANTAVAIL_A); SIBA_SHIFTOUT(ant_bg, SIBA_SPROM8_ANTAVAIL, SIBA_SPROM8_ANTAVAIL_BG); SIBA_SHIFTOUT(maxpwr_bg, SIBA_SPROM8_MAXP_BG, SIBA_SPROM8_MAXP_BG_MASK); SIBA_SHIFTOUT(tssi_bg, SIBA_SPROM8_MAXP_BG, SIBA_SPROM8_TSSI_BG); SIBA_SHIFTOUT(maxpwr_a, SIBA_SPROM8_MAXP_A, SIBA_SPROM8_MAXP_A_MASK); SIBA_SHIFTOUT(tssi_a, SIBA_SPROM8_MAXP_A, SIBA_SPROM8_TSSI_A); + SIBA_SHIFTOUT(maxpwr_ah, SIBA_SPROM8_MAXP_AHL, + SIBA_SPROM8_MAXP_AH_MASK); + SIBA_SHIFTOUT(maxpwr_al, SIBA_SPROM8_MAXP_AHL, + SIBA_SPROM8_MAXP_AL_MASK); SIBA_SHIFTOUT(gpio0, SIBA_SPROM8_GPIOA, SIBA_SPROM8_GPIOA_P0); SIBA_SHIFTOUT(gpio1, SIBA_SPROM8_GPIOA, SIBA_SPROM8_GPIOA_P1); SIBA_SHIFTOUT(gpio2, SIBA_SPROM8_GPIOB, SIBA_SPROM8_GPIOB_P2); SIBA_SHIFTOUT(gpio3, SIBA_SPROM8_GPIOB, SIBA_SPROM8_GPIOB_P3); + SIBA_SHIFTOUT(tri2g, SIBA_SPROM8_TRI25G, SIBA_SPROM8_TRI2G); + SIBA_SHIFTOUT(tri5g, SIBA_SPROM8_TRI25G, SIBA_SPROM8_TRI5G); + SIBA_SHIFTOUT(tri5gl, SIBA_SPROM8_TRI5GHL, SIBA_SPROM8_TRI5GL); + SIBA_SHIFTOUT(tri5gh, SIBA_SPROM8_TRI5GHL, SIBA_SPROM8_TRI5GH); + SIBA_SHIFTOUT(rxpo2g, SIBA_SPROM8_RXPO, SIBA_SPROM8_RXPO2G); + SIBA_SHIFTOUT(rxpo5g, SIBA_SPROM8_RXPO, SIBA_SPROM8_RXPO5G); + SIBA_SHIFTOUT(rssismf2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISMF2G); + SIBA_SHIFTOUT(rssismc2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISMC2G); + SIBA_SHIFTOUT(rssisav2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_RSSISAV2G); + SIBA_SHIFTOUT(bxa2g, SIBA_SPROM8_RSSIPARM2G, SIBA_SPROM8_BXA2G); + SIBA_SHIFTOUT(rssismf5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_RSSISMF5G); + SIBA_SHIFTOUT(rssismc5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_RSSISMC5G); + SIBA_SHIFTOUT(rssisav5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_RSSISAV5G); + SIBA_SHIFTOUT(bxa5g, SIBA_SPROM8_RSSIPARM5G, SIBA_SPROM8_BXA5G); + + SIBA_SHIFTOUT(pa0b0, SIBA_SPROM8_PA0B0, 0xffff); + SIBA_SHIFTOUT(pa0b1, SIBA_SPROM8_PA0B1, 0xffff); + SIBA_SHIFTOUT(pa0b2, SIBA_SPROM8_PA0B2, 0xffff); + SIBA_SHIFTOUT(pa1b0, SIBA_SPROM8_PA1B0, 0xffff); + SIBA_SHIFTOUT(pa1b1, SIBA_SPROM8_PA1B1, 0xffff); + SIBA_SHIFTOUT(pa1b2, SIBA_SPROM8_PA1B2, 0xffff); + SIBA_SHIFTOUT(pa1lob0, SIBA_SPROM8_PA1LOB0, 0xffff); + SIBA_SHIFTOUT(pa1lob1, SIBA_SPROM8_PA1LOB1, 0xffff); + SIBA_SHIFTOUT(pa1lob2, SIBA_SPROM8_PA1LOB2, 0xffff); + SIBA_SHIFTOUT(pa1hib0, SIBA_SPROM8_PA1HIB0, 0xffff); + SIBA_SHIFTOUT(pa1hib1, SIBA_SPROM8_PA1HIB1, 0xffff); + SIBA_SHIFTOUT(pa1hib2, SIBA_SPROM8_PA1HIB2, 0xffff); + SIBA_SHIFTOUT(cck2gpo, SIBA_SPROM8_CCK2GPO, 0xffff); + + SIBA_SHIFTOUT_4(ofdm2gpo, SIBA_SPROM8_OFDM2GPO, 0xffffffff, 0); + SIBA_SHIFTOUT_4(ofdm5glpo, SIBA_SPROM8_OFDM5GLPO, 0xffffffff, 0); + SIBA_SHIFTOUT_4(ofdm5gpo, SIBA_SPROM8_OFDM5GPO, 0xffffffff, 0); + SIBA_SHIFTOUT_4(ofdm5ghpo, SIBA_SPROM8_OFDM5GHPO, 0xffffffff, 0); /* antenna gain */ SIBA_SHIFTOUT(again.ghz24.a0, SIBA_SPROM8_AGAIN01, SIBA_SPROM8_AGAIN0); @@ -2005,3 +2048,79 @@ siba_core_resume(struct siba_softc *siba return (0); } + +static void +siba_cc_regctl_setmask(struct siba_cc *cc, uint32_t offset, uint32_t mask, + uint32_t set) +{ + + SIBA_CC_READ32(cc, SIBA_CC_REGCTL_ADDR); + SIBA_CC_WRITE32(cc, SIBA_CC_REGCTL_ADDR, offset); + SIBA_CC_READ32(cc, SIBA_CC_REGCTL_ADDR); + SIBA_CC_WRITE32(cc, SIBA_CC_REGCTL_DATA, + (SIBA_CC_READ32(cc, SIBA_CC_REGCTL_DATA) & mask) | set); + SIBA_CC_READ32(cc, SIBA_CC_REGCTL_DATA); +} + +void +siba_cc_pmu_set_ldovolt(struct siba_cc *scc, int id, uint32_t volt) +{ + struct siba_softc *siba = scc->scc_dev->sd_bus; + uint32_t *p = NULL, info[5][3] = { + { 2, 25, 0xf }, + { 3, 1, 0xf }, + { 3, 9, 0xf }, + { 3, 17, 0x3f }, + { 0, 21, 0x3f } + }; + + if (siba->siba_chipid == 0x4312) { + if (id != SIBA_LDO_PAREF) + return; + p = info[4]; + siba_cc_regctl_setmask(scc, p[0], ~(p[2] << p[1]), + (volt & p[2]) << p[1]); + return; + } + if (siba->siba_chipid == 0x4328 || siba->siba_chipid == 0x5354) { + switch (id) { + case SIBA_LDO_PAREF: + p = info[3]; + break; + case SIBA_LDO_VOLT1: + p = info[0]; + break; + case SIBA_LDO_VOLT2: + p = info[1]; + break; + case SIBA_LDO_VOLT3: + p = info[2]; + break; + default: + KASSERT(0 == 1, + ("%s: unsupported voltage ID %#x", __func__, id)); + return; + } + siba_cc_regctl_setmask(scc, p[0], ~(p[2] << p[1]), + (volt & p[2]) << p[1]); + } +} + +void +siba_cc_pmu_set_ldoparef(struct siba_cc *scc, uint8_t on) +{ + struct siba_softc *siba = scc->scc_dev->sd_bus; + int ldo; + + ldo = ((siba->siba_chipid == 0x4312) ? SIBA_CC_PMU_4312_PA_REF : + ((siba->siba_chipid == 0x4328) ? SIBA_CC_PMU_4328_PA_REF : + ((siba->siba_chipid == 0x5354) ? SIBA_CC_PMU_5354_PA_REF : -1))); + if (ldo == -1) + return; + + if (on) + SIBA_CC_SET32(scc, SIBA_CC_PMU_MINRES, 1 << ldo); + else + SIBA_CC_MASK32(scc, SIBA_CC_PMU_MINRES, ~(1 << ldo)); + SIBA_CC_READ32(scc, SIBA_CC_PMU_MINRES); +} Modified: head/sys/dev/siba/sibareg.h ============================================================================== --- head/sys/dev/siba/sibareg.h Tue Feb 16 01:07:06 2010 (r203943) +++ head/sys/dev/siba/sibareg.h Tue Feb 16 01:22:33 2010 (r203944) @@ -32,7 +32,7 @@ */ #ifndef _SIBA_SIBAREG_H_ -#define _SIBA_SIBAREG_H_ +#define _SIBA_SIBAREG_H_ #define PCI_DEVICE_ID_BCM4401 0x4401 #define PCI_DEVICE_ID_BCM4401B0 0x4402 @@ -92,6 +92,8 @@ #define SIBA_CC_PMU_TABSEL 0x0620 #define SIBA_CC_PMU_DEPMSK 0x0624 #define SIBA_CC_PMU_UPDNTM 0x0628 +#define SIBA_CC_REGCTL_ADDR 0x0658 +#define SIBA_CC_REGCTL_DATA 0x065c #define SIBA_CC_PLLCTL_ADDR 0x0660 #define SIBA_CC_PLLCTL_DATA 0x0664 @@ -148,6 +150,7 @@ { 38400, 13, 45, 873813, }, { 40000, 14, 45, 0, }, \ } +#define SIBA_CC_PMU_4312_PA_REF 2 #define SIBA_CC_PMU_4325_BURST 1 #define SIBA_CC_PMU_4325_CLBURST 3 #define SIBA_CC_PMU_4325_LN 10 @@ -178,6 +181,7 @@ #define SIBA_CC_PMU_4328_BB_PLL_FILTBYP 17 #define SIBA_CC_PMU_4328_RF_PLL_FILTBYP 18 #define SIBA_CC_PMU_4328_BB_PLL_PU 19 +#define SIBA_CC_PMU_5354_PA_REF 8 #define SIBA_CC_PMU_5354_BB_PLL_PU 19 #define SIBA_CC_PMU_4325_RES_UPDOWN \ @@ -237,9 +241,9 @@ #define SIBA_REGWIN(x) \ (SIBA_ENUM_START + ((x) * SIBA_CORE_LEN)) -#define SIBA_CORE_LEN 0x00001000 /* Size of cfg per core */ -#define SIBA_CFG_END 0x00010000 /* Upper bound of cfg space */ -#define SIBA_MAX_CORES (SIBA_CFG_END/SIBA_CORE_LEN) /* #max cores */ +#define SIBA_CORE_LEN 0x00001000 /* Size of cfg per core */ +#define SIBA_CFG_END 0x00010000 /* Upper bound of cfg space */ +#define SIBA_MAX_CORES (SIBA_CFG_END/SIBA_CORE_LEN) /* #max cores */ #define SIBA_ENUM_START 0x18000000U #define SIBA_ENUM_END 0x18010000U @@ -372,6 +376,9 @@ #define SIBA_SPROM5_GPIOB_P3 0xff00 #define SIBA_SPROM8_BFLOW 0x1084 #define SIBA_SPROM8_BFHIGH 0x1086 +#define SIBA_SPROM8_BFL2LO 0x1088 +#define SIBA_SPROM8_BFL2HI 0x108a +#define SIBA_SPROM8_MAC_80211BG 0x108c #define SIBA_SPROM8_CCODE 0x1092 #define SIBA_SPROM8_ANTAVAIL 0x109c #define SIBA_SPROM8_ANTAVAIL_A 0xff00 @@ -379,21 +386,60 @@ #define SIBA_SPROM8_AGAIN01 0x109e #define SIBA_SPROM8_AGAIN0 0x00ff #define SIBA_SPROM8_AGAIN1 0xff00 -#define SIBA_SPROM8_AGAIN23 0x10a0 -#define SIBA_SPROM8_AGAIN2 0x00ff -#define SIBA_SPROM8_AGAIN3 0xff00 #define SIBA_SPROM8_GPIOA 0x1096 #define SIBA_SPROM8_GPIOA_P0 0x00ff #define SIBA_SPROM8_GPIOA_P1 0xff00 #define SIBA_SPROM8_GPIOB 0x1098 #define SIBA_SPROM8_GPIOB_P2 0x00ff #define SIBA_SPROM8_GPIOB_P3 0xff00 +#define SIBA_SPROM8_AGAIN23 0x10a0 +#define SIBA_SPROM8_AGAIN2 0x00ff +#define SIBA_SPROM8_AGAIN3 0xff00 +#define SIBA_SPROM8_RSSIPARM2G 0x10a4 +#define SIBA_SPROM8_RSSISMF2G 0x000f +#define SIBA_SPROM8_RSSISMC2G 0x00f0 +#define SIBA_SPROM8_RSSISAV2G 0x0700 /* BITMASK */ +#define SIBA_SPROM8_BXA2G 0x1800 /* BITMASK */ +#define SIBA_SPROM8_RSSIPARM5G 0x10a6 +#define SIBA_SPROM8_RSSISMF5G 0x000f +#define SIBA_SPROM8_RSSISMC5G 0x00f0 +#define SIBA_SPROM8_RSSISAV5G 0x0700 /* BITMASK */ +#define SIBA_SPROM8_BXA5G 0x1800 /* BITMASK */ +#define SIBA_SPROM8_TRI25G 0x10a8 +#define SIBA_SPROM8_TRI2G 0x00ff +#define SIBA_SPROM8_TRI5G 0xff00 +#define SIBA_SPROM8_TRI5GHL 0x10aa +#define SIBA_SPROM8_TRI5GL 0x00ff +#define SIBA_SPROM8_TRI5GH 0xff00 +#define SIBA_SPROM8_RXPO 0x10ac +#define SIBA_SPROM8_RXPO2G 0x00ff +#define SIBA_SPROM8_RXPO5G 0xff00 #define SIBA_SPROM8_MAXP_BG 0x10c0 #define SIBA_SPROM8_MAXP_BG_MASK 0x00ff #define SIBA_SPROM8_TSSI_BG 0xff00 +#define SIBA_SPROM8_PA0B0 0x10c2 +#define SIBA_SPROM8_PA0B1 0x10c4 +#define SIBA_SPROM8_PA0B2 0x10c6 #define SIBA_SPROM8_MAXP_A 0x10c8 #define SIBA_SPROM8_MAXP_A_MASK 0x00ff #define SIBA_SPROM8_TSSI_A 0xff00 +#define SIBA_SPROM8_MAXP_AHL 0x10ca +#define SIBA_SPROM8_MAXP_AH_MASK 0x00ff +#define SIBA_SPROM8_MAXP_AL_MASK 0xff00 +#define SIBA_SPROM8_PA1B0 0x10cc +#define SIBA_SPROM8_PA1B1 0x10ce +#define SIBA_SPROM8_PA1B2 0x10d0 +#define SIBA_SPROM8_PA1LOB0 0x10d2 +#define SIBA_SPROM8_PA1LOB1 0x10d4 +#define SIBA_SPROM8_PA1LOB2 0x10d6 +#define SIBA_SPROM8_PA1HIB0 0x10d8 +#define SIBA_SPROM8_PA1HIB1 0x10da +#define SIBA_SPROM8_PA1HIB2 0x10dc +#define SIBA_SPROM8_CCK2GPO 0x1140 +#define SIBA_SPROM8_OFDM2GPO 0x1142 +#define SIBA_SPROM8_OFDM5GPO 0x1146 +#define SIBA_SPROM8_OFDM5GLPO 0x114a +#define SIBA_SPROM8_OFDM5GHPO 0x114e #define SIBA_BOARDVENDOR_DELL 0x1028 #define SIBA_BOARDVENDOR_BCM 0x14e4 @@ -413,4 +459,6 @@ #define SIBA_PCICORE_SBTOPCI_BURST 0x00000008 #define SIBA_PCICORE_SBTOPCI_MRM 0x00000020 +#define SIBA_CHIPPACK_BCM4712S 1 /* Small 200pin 4712 */ + #endif /* _SIBA_SIBAREG_H_ */ Modified: head/sys/dev/siba/sibavar.h ============================================================================== --- head/sys/dev/siba/sibavar.h Tue Feb 16 01:07:06 2010 (r203943) +++ head/sys/dev/siba/sibavar.h Tue Feb 16 01:22:33 2010 (r203944) @@ -214,16 +214,46 @@ struct siba_sprom { uint16_t pa1b0; uint16_t pa1b1; uint16_t pa1b2; + uint16_t pa1lob0; + uint16_t pa1lob1; + uint16_t pa1lob2; + uint16_t pa1hib0; + uint16_t pa1hib1; + uint16_t pa1hib2; uint8_t gpio0; uint8_t gpio1; uint8_t gpio2; uint8_t gpio3; + uint16_t maxpwr_al; uint16_t maxpwr_a; /* A-PHY Max Power */ + uint16_t maxpwr_ah; uint16_t maxpwr_bg; /* BG-PHY Max Power */ + uint8_t rxpo2g; + uint8_t rxpo5g; uint8_t tssi_a; /* Idle TSSI */ uint8_t tssi_bg; /* Idle TSSI */ + uint8_t tri2g; + uint8_t tri5gl; + uint8_t tri5g; + uint8_t tri5gh; + uint8_t rssisav2g; + uint8_t rssismc2g; + uint8_t rssismf2g; + uint8_t bxa2g; + uint8_t rssisav5g; + uint8_t rssismc5g; + uint8_t rssismf5g; + uint8_t bxa5g; + uint16_t cck2gpo; + uint32_t ofdm2gpo; + uint32_t ofdm5glpo; + uint32_t ofdm5gpo; + uint32_t ofdm5ghpo; uint16_t bf_lo; /* boardflags */ uint16_t bf_hi; /* boardflags */ + uint16_t bf2_lo; + uint16_t bf2_hi; + struct { struct { int8_t a0, a1, a2, a3; @@ -234,6 +264,11 @@ struct siba_sprom { } again; /* antenna gain */ }; +#define SIBA_LDO_PAREF 0 +#define SIBA_LDO_VOLT1 1 +#define SIBA_LDO_VOLT2 2 +#define SIBA_LDO_VOLT3 3 + struct siba_cc_pmu { uint8_t rev; /* PMU rev */ uint32_t freq; /* crystal freq in kHz */ @@ -367,5 +402,7 @@ void siba_write_multi_2(struct siba_dev void siba_write_multi_4(struct siba_dev_softc *, const void *, size_t, uint16_t); void siba_barrier(struct siba_dev_softc *, int); +void siba_cc_pmu_set_ldovolt(struct siba_cc *, int, uint32_t); +void siba_cc_pmu_set_ldoparef(struct siba_cc *, uint8_t); #endif /* _SIBA_SIBAVAR_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 01:44:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79F311065676; Tue, 16 Feb 2010 01:44:14 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6784B8FC0C; Tue, 16 Feb 2010 01:44: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 o1G1iEsb076300; Tue, 16 Feb 2010 01:44:14 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1G1iEur076296; Tue, 16 Feb 2010 01:44:14 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201002160144.o1G1iEur076296@svn.freebsd.org> From: Weongyo Jeong Date: Tue, 16 Feb 2010 01:44: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: r203945 - in head: share/man/man4 sys/dev/bwn sys/modules/bwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 01:44:14 -0000 Author: weongyo Date: Tue Feb 16 01:44:14 2010 New Revision: 203945 URL: http://svn.freebsd.org/changeset/base/203945 Log: adds bwn(4) driver for supporting Broadcom BCM43xx chipsets. o uses v4 firmware instead of v3. A port will be committed to create the bwn firmware module. o supports B/G and LP(low power) PHYs. o supports 32 / 64 bits DMA operations. o tested on big / little endian machines so should work on all architectures. It'd not connected to the build until the firmware port is committed. Added: head/share/man/man4/bwn.4 (contents, props changed) head/sys/dev/bwn/ head/sys/dev/bwn/if_bwn.c (contents, props changed) head/sys/dev/bwn/if_bwnreg.h (contents, props changed) head/sys/dev/bwn/if_bwnvar.h (contents, props changed) head/sys/modules/bwn/ head/sys/modules/bwn/Makefile (contents, props changed) Added: head/share/man/man4/bwn.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/bwn.4 Tue Feb 16 01:44:14 2010 (r203945) @@ -0,0 +1,134 @@ +.\" Copyright (c) 2009 Christian Brueffer +.\" 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$ +.\" +.Dd February 15, 2010 +.Dt BWN 4 +.Os +.Sh NAME +.Nm bwn +.Nd Broadcom BCM43xx IEEE 802.11b/g wireless network driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device siba_bwn" +.Cd "device bwn" +.Cd "device wlan" +.Cd "device wlan_amrr" +.Cd "device firmware" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_bwn_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for Broadcom BCM43xx based +PCI/CardBus network adapters. +.Pp +It supports +.Cm station +and +.Cm monitor +mode operation. +Only one virtual interface may be configured at any time. +For more information on configuring this device, see +.Xr ifconfig 8 . +.Pp +This driver requires firmware to be loaded before it will work. +The +.Pa ports/net/bwn-firmware-kmod +port needs to be installed before +.Xr ifconfig 8 +will work. +.Sh HARDWARE +The +.Nm +driver supports Broadcom BCM43xx based wireless devices, including: +.Pp +.Bl -column -compact "Apple Airport Extreme" "BCM4306" "Mini PCI" "a/b/g" -offset 6n +.It Em "Card Chip Bus Standard" +.It "Apple Airport Extreme BCM4306 PCI b/g" +.It "Apple Airport Extreme BCM4318 PCI b/g" +.It "ASUS WL-138g BCM4318 PCI b/g" +.It "Buffalo WLI-CB-G54S BCM4318 CardBus b/g" +.It "Buffalo WLI-PCI-G54S BCM4306 PCI b/g" +.It "Compaq R4035 onboard BCM4306 PCI b/g" +.It "Dell Wireless 1470 BCM4318 Mini PCI b/g" +.It "Dell Truemobile 1400 BCM4309 Mini 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" +.It "TRENDnet TEW-401PCplus BCM4306 CardBus b/g" +.It "US Robotics 5411 BCM4318 CardBus b/g" +.El +.Sh EXAMPLES +Join an existing BSS network (i.e., connect to an access point): +.Pp +.Bd -literal -offset indent +ifconfig wlan create wlandev bwn0 inet 192.168.0.20 \e + netmask 0xffffff00 +.Ed +.Pp +Join a specific BSS network with network name +.Dq Li my_net : +.Pp +.Dl "ifconfig wlan create wlandev bwn0 ssid my_net up" +.Pp +Join a specific BSS network with 64-bit WEP encryption: +.Bd -literal -offset indent +ifconfig wlan create wlandev bwn0 ssid my_net \e + wepmode on wepkey 0x1234567890 weptxkey 1 up +.Ed +.Sh SEE ALSO +.Xr arp 4 , +.Xr cardbus 4 , +.Xr intro 4 , +.Xr pci 4 , +.Xr wlan 4 , +.Xr wlan_amrr 4 , +.Xr ifconfig 8 , +.Xr wpa_supplicant 8 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 8.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Weongyo Jeong +.Aq weongyo@FreeBSD.org . +.\".Sh BUGS +.\"Some card based on the BCM4306 and BCM4309 chips do not work properly +.\"on channel 1, 2 and 3. Added: head/sys/dev/bwn/if_bwn.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bwn/if_bwn.c Tue Feb 16 01:44:14 2010 (r203945) @@ -0,0 +1,14317 @@ +/*- + * Copyright (c) 2009-2010 Weongyo Jeong + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * The Broadcom Wireless LAN controller driver. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +SYSCTL_NODE(_hw, OID_AUTO, bwn, CTLFLAG_RD, 0, "Broadcom driver parameters"); + +/* + * Tunable & sysctl variables. + */ + +#ifdef BWN_DEBUG +static int bwn_debug = 0; +SYSCTL_INT(_hw_bwn, OID_AUTO, debug, CTLFLAG_RW, &bwn_debug, 0, + "Broadcom debugging printfs"); +TUNABLE_INT("hw.bwn.debug", &bwn_debug); +enum { + BWN_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ + BWN_DEBUG_RECV = 0x00000002, /* basic recv operation */ + BWN_DEBUG_STATE = 0x00000004, /* 802.11 state transitions */ + BWN_DEBUG_TXPOW = 0x00000008, /* tx power processing */ + BWN_DEBUG_RESET = 0x00000010, /* reset processing */ + BWN_DEBUG_OPS = 0x00000020, /* bwn_ops processing */ + BWN_DEBUG_BEACON = 0x00000040, /* beacon handling */ + BWN_DEBUG_WATCHDOG = 0x00000080, /* watchdog timeout */ + BWN_DEBUG_INTR = 0x00000100, /* ISR */ + BWN_DEBUG_CALIBRATE = 0x00000200, /* periodic calibration */ + BWN_DEBUG_NODE = 0x00000400, /* node management */ + BWN_DEBUG_LED = 0x00000800, /* led management */ + BWN_DEBUG_CMD = 0x00001000, /* cmd submission */ + BWN_DEBUG_LO = 0x00002000, /* LO */ + BWN_DEBUG_FW = 0x00004000, /* firmware */ + BWN_DEBUG_WME = 0x00008000, /* WME */ + BWN_DEBUG_RF = 0x00010000, /* RF */ + BWN_DEBUG_FATAL = 0x80000000, /* fatal errors */ + BWN_DEBUG_ANY = 0xffffffff +}; +#define DPRINTF(sc, m, fmt, ...) do { \ + if (sc->sc_debug & (m)) \ + printf(fmt, __VA_ARGS__); \ +} while (0) +#else +#define DPRINTF(sc, m, fmt, ...) do { (void) sc; } while (0) +#endif + +static int bwn_bfp = 0; /* use "Bad Frames Preemption" */ +SYSCTL_INT(_hw_bwn, OID_AUTO, bfp, CTLFLAG_RW, &bwn_bfp, 0, + "uses Bad Frames Preemption"); +static int bwn_bluetooth = 1; +SYSCTL_INT(_hw_bwn, OID_AUTO, bluetooth, CTLFLAG_RW, &bwn_bluetooth, 0, + "turns on Bluetooth Coexistence"); +static int bwn_hwpctl = 0; +SYSCTL_INT(_hw_bwn, OID_AUTO, hwpctl, CTLFLAG_RW, &bwn_hwpctl, 0, + "uses H/W power control"); +static int bwn_msi_disable = 0; /* MSI disabled */ +TUNABLE_INT("hw.bwn.msi_disable", &bwn_msi_disable); +static int bwn_usedma = 1; +SYSCTL_INT(_hw_bwn, OID_AUTO, usedma, CTLFLAG_RD, &bwn_usedma, 0, + "uses DMA"); +TUNABLE_INT("hw.bwn.usedma", &bwn_usedma); +static int bwn_wme = 1; +SYSCTL_INT(_hw_bwn, OID_AUTO, wme, CTLFLAG_RW, &bwn_wme, 0, + "uses WME support"); + +static int bwn_attach_pre(struct bwn_softc *); +static int bwn_attach_post(struct bwn_softc *); +static void bwn_sprom_bugfixes(struct siba_softc *); +static void bwn_init(void *); +static int bwn_init_locked(struct bwn_softc *); +static int bwn_ioctl(struct ifnet *, u_long, caddr_t); +static void bwn_start(struct ifnet *); +static int bwn_attach_core(struct bwn_mac *); +static void bwn_reset_core(struct bwn_mac *, uint32_t); +static int bwn_phy_getinfo(struct bwn_mac *, int); +static int bwn_chiptest(struct bwn_mac *); +static int bwn_setup_channels(struct bwn_mac *, int, int); +static int bwn_phy_g_attach(struct bwn_mac *); +static void bwn_phy_g_detach(struct bwn_mac *); +static void bwn_phy_g_init_pre(struct bwn_mac *); +static int bwn_phy_g_prepare_hw(struct bwn_mac *); +static int bwn_phy_g_init(struct bwn_mac *); +static void bwn_phy_g_exit(struct bwn_mac *); +static uint16_t bwn_phy_g_read(struct bwn_mac *, uint16_t); +static void bwn_phy_g_write(struct bwn_mac *, uint16_t, + uint16_t); +static uint16_t bwn_phy_g_rf_read(struct bwn_mac *, uint16_t); +static void bwn_phy_g_rf_write(struct bwn_mac *, uint16_t, + uint16_t); +static int bwn_phy_g_hwpctl(struct bwn_mac *); +static void bwn_phy_g_rf_onoff(struct bwn_mac *, int); +static int bwn_phy_g_switch_channel(struct bwn_mac *, uint32_t); +static uint32_t bwn_phy_g_get_default_chan(struct bwn_mac *); +static void bwn_phy_g_set_antenna(struct bwn_mac *, int); +static int bwn_phy_g_im(struct bwn_mac *, int); +static int bwn_phy_g_recalc_txpwr(struct bwn_mac *, int); +static void bwn_phy_g_set_txpwr(struct bwn_mac *); +static void bwn_phy_g_task_15s(struct bwn_mac *); +static void bwn_phy_g_task_60s(struct bwn_mac *); +static uint16_t bwn_phy_g_txctl(struct bwn_mac *); +static void bwn_phy_switch_analog(struct bwn_mac *, int); +static uint16_t bwn_shm_read_2(struct bwn_mac *, uint16_t, uint16_t); +static void bwn_shm_write_2(struct bwn_mac *, uint16_t, uint16_t, + uint16_t); +static uint32_t bwn_shm_read_4(struct bwn_mac *, uint16_t, uint16_t); +static void bwn_shm_write_4(struct bwn_mac *, uint16_t, uint16_t, + uint32_t); +static void bwn_shm_ctlword(struct bwn_mac *, uint16_t, + uint16_t); +static void bwn_addchannels(struct ieee80211_channel [], int, int *, + const struct bwn_channelinfo *, int); +static int bwn_raw_xmit(struct ieee80211_node *, struct mbuf *, + const struct ieee80211_bpf_params *); +static void bwn_newassoc(struct ieee80211_node *, int); +static void bwn_updateslot(struct ifnet *); +static void bwn_update_promisc(struct ifnet *); +static void bwn_wme_init(struct bwn_mac *); +static int bwn_wme_update(struct ieee80211com *); +static struct ieee80211_node *bwn_node_alloc(struct ieee80211vap *, + const uint8_t [IEEE80211_ADDR_LEN]); +static void bwn_wme_clear(struct bwn_softc *); +static void bwn_wme_load(struct bwn_mac *); +static void bwn_wme_loadparams(struct bwn_mac *, + const struct wmeParams *, uint16_t); +static void bwn_node_cleanup(struct ieee80211_node *); +static void bwn_scan_start(struct ieee80211com *); +static void bwn_scan_end(struct ieee80211com *); +static void bwn_set_channel(struct ieee80211com *); +static struct ieee80211vap *bwn_vap_create(struct ieee80211com *, + const char [IFNAMSIZ], int, int, + int, const uint8_t [IEEE80211_ADDR_LEN], + const uint8_t [IEEE80211_ADDR_LEN]); +static void bwn_vap_delete(struct ieee80211vap *); +static void bwn_stop(struct bwn_softc *, int); +static void bwn_stop_locked(struct bwn_softc *, int); +static int bwn_core_init(struct bwn_mac *); +static void bwn_core_start(struct bwn_mac *); +static void bwn_core_exit(struct bwn_mac *); +static void bwn_fix_imcfglobug(struct bwn_mac *); +static void bwn_bt_disable(struct bwn_mac *); +static int bwn_chip_init(struct bwn_mac *); +static uint64_t bwn_hf_read(struct bwn_mac *); +static void bwn_hf_write(struct bwn_mac *, uint64_t); +static void bwn_set_txretry(struct bwn_mac *, int, int); +static void bwn_rate_init(struct bwn_mac *); +static void bwn_set_phytxctl(struct bwn_mac *); +static void bwn_spu_setdelay(struct bwn_mac *, int); +static void bwn_bt_enable(struct bwn_mac *); +static void bwn_set_macaddr(struct bwn_mac *); +static void bwn_crypt_init(struct bwn_mac *); +static void bwn_chip_exit(struct bwn_mac *); +static int bwn_fw_fillinfo(struct bwn_mac *); +static int bwn_fw_loaducode(struct bwn_mac *); +static int bwn_gpio_init(struct bwn_mac *); +static int bwn_fw_loadinitvals(struct bwn_mac *); +static int bwn_phy_init(struct bwn_mac *); +static void bwn_set_txantenna(struct bwn_mac *, int); +static void bwn_set_opmode(struct bwn_mac *); +static void bwn_gpio_cleanup(struct bwn_mac *); +static void bwn_rate_write(struct bwn_mac *, uint16_t, int); +static uint8_t bwn_plcp_getcck(const uint8_t); +static uint8_t bwn_plcp_getofdm(const uint8_t); +static void bwn_pio_init(struct bwn_mac *); +static uint16_t bwn_pio_idx2base(struct bwn_mac *, int); +static void bwn_pio_set_txqueue(struct bwn_mac *, struct bwn_pio_txqueue *, + int); +static void bwn_pio_setupqueue_rx(struct bwn_mac *, + struct bwn_pio_rxqueue *, int); +static void bwn_destroy_queue_tx(struct bwn_pio_txqueue *); +static uint16_t bwn_pio_read_2(struct bwn_mac *, struct bwn_pio_txqueue *, + uint16_t); +static void bwn_pio_cancel_tx_packets(struct bwn_pio_txqueue *); +static int bwn_pio_rx(struct bwn_pio_rxqueue *); +static uint8_t bwn_pio_rxeof(struct bwn_pio_rxqueue *); +static void bwn_pio_handle_txeof(struct bwn_mac *, + const struct bwn_txstatus *); +static uint16_t bwn_pio_rx_read_2(struct bwn_pio_rxqueue *, uint16_t); +static uint32_t bwn_pio_rx_read_4(struct bwn_pio_rxqueue *, uint16_t); +static void bwn_pio_rx_write_2(struct bwn_pio_rxqueue *, uint16_t, + uint16_t); +static void bwn_pio_rx_write_4(struct bwn_pio_rxqueue *, uint16_t, + uint32_t); +static int bwn_pio_tx_start(struct bwn_mac *, struct ieee80211_node *, + struct mbuf *); +static struct bwn_pio_txqueue *bwn_pio_select(struct bwn_mac *, uint8_t); +static uint32_t bwn_pio_write_multi_4(struct bwn_mac *, + struct bwn_pio_txqueue *, uint32_t, const void *, int); +static void bwn_pio_write_4(struct bwn_mac *, struct bwn_pio_txqueue *, + uint16_t, uint32_t); +static uint16_t bwn_pio_write_multi_2(struct bwn_mac *, + struct bwn_pio_txqueue *, uint16_t, const void *, int); +static uint16_t bwn_pio_write_mbuf_2(struct bwn_mac *, + struct bwn_pio_txqueue *, uint16_t, struct mbuf *); +static struct bwn_pio_txqueue *bwn_pio_parse_cookie(struct bwn_mac *, + uint16_t, struct bwn_pio_txpkt **); +static void bwn_dma_init(struct bwn_mac *); +static void bwn_dma_rxdirectfifo(struct bwn_mac *, int, uint8_t); +static int bwn_dma_mask2type(uint64_t); +static uint64_t bwn_dma_mask(struct bwn_mac *); +static uint16_t bwn_dma_base(int, int); +static void bwn_dma_ringfree(struct bwn_dma_ring **); +static void bwn_dma_32_getdesc(struct bwn_dma_ring *, + int, struct bwn_dmadesc_generic **, + struct bwn_dmadesc_meta **); +static void bwn_dma_32_setdesc(struct bwn_dma_ring *, + struct bwn_dmadesc_generic *, bus_addr_t, uint16_t, int, + int, int); +static void bwn_dma_32_start_transfer(struct bwn_dma_ring *, int); +static void bwn_dma_32_suspend(struct bwn_dma_ring *); +static void bwn_dma_32_resume(struct bwn_dma_ring *); +static int bwn_dma_32_get_curslot(struct bwn_dma_ring *); +static void bwn_dma_32_set_curslot(struct bwn_dma_ring *, int); +static void bwn_dma_64_getdesc(struct bwn_dma_ring *, + int, struct bwn_dmadesc_generic **, + struct bwn_dmadesc_meta **); +static void bwn_dma_64_setdesc(struct bwn_dma_ring *, + struct bwn_dmadesc_generic *, bus_addr_t, uint16_t, int, + int, int); +static void bwn_dma_64_start_transfer(struct bwn_dma_ring *, int); +static void bwn_dma_64_suspend(struct bwn_dma_ring *); +static void bwn_dma_64_resume(struct bwn_dma_ring *); +static int bwn_dma_64_get_curslot(struct bwn_dma_ring *); +static void bwn_dma_64_set_curslot(struct bwn_dma_ring *, int); +static int bwn_dma_allocringmemory(struct bwn_dma_ring *); +static void bwn_dma_setup(struct bwn_dma_ring *); +static void bwn_dma_free_ringmemory(struct bwn_dma_ring *); +static void bwn_dma_cleanup(struct bwn_dma_ring *); +static void bwn_dma_free_descbufs(struct bwn_dma_ring *); +static int bwn_dma_tx_reset(struct bwn_mac *, uint16_t, int); +static void bwn_dma_rx(struct bwn_dma_ring *); +static int bwn_dma_rx_reset(struct bwn_mac *, uint16_t, int); +static void bwn_dma_free_descbuf(struct bwn_dma_ring *, + struct bwn_dmadesc_meta *); +static void bwn_dma_set_redzone(struct bwn_dma_ring *, struct mbuf *); +static int bwn_dma_gettype(struct bwn_mac *); +static void bwn_dma_ring_addr(void *, bus_dma_segment_t *, int, int); +static int bwn_dma_freeslot(struct bwn_dma_ring *); +static int bwn_dma_nextslot(struct bwn_dma_ring *, int); +static void bwn_dma_rxeof(struct bwn_dma_ring *, int *); +static int bwn_dma_newbuf(struct bwn_dma_ring *, + struct bwn_dmadesc_generic *, struct bwn_dmadesc_meta *, + int); +static void bwn_dma_buf_addr(void *, bus_dma_segment_t *, int, + bus_size_t, int); +static uint8_t bwn_dma_check_redzone(struct bwn_dma_ring *, struct mbuf *); +static void bwn_dma_handle_txeof(struct bwn_mac *, + const struct bwn_txstatus *); +static int bwn_dma_tx_start(struct bwn_mac *, struct ieee80211_node *, + struct mbuf *); +static int bwn_dma_getslot(struct bwn_dma_ring *); +static struct bwn_dma_ring *bwn_dma_select(struct bwn_mac *, + uint8_t); +static int bwn_dma_attach(struct bwn_mac *); +static struct bwn_dma_ring *bwn_dma_ringsetup(struct bwn_mac *, + int, int, int); +static struct bwn_dma_ring *bwn_dma_parse_cookie(struct bwn_mac *, + const struct bwn_txstatus *, uint16_t, int *); +static void bwn_dma_free(struct bwn_mac *); +static void bwn_phy_g_init_sub(struct bwn_mac *); +static uint8_t bwn_has_hwpctl(struct bwn_mac *); +static void bwn_phy_init_b5(struct bwn_mac *); +static void bwn_phy_init_b6(struct bwn_mac *); +static void bwn_phy_init_a(struct bwn_mac *); +static void bwn_loopback_calcgain(struct bwn_mac *); +static uint16_t bwn_rf_init_bcm2050(struct bwn_mac *); +static void bwn_lo_g_init(struct bwn_mac *); +static void bwn_lo_g_adjust(struct bwn_mac *); +static void bwn_lo_get_powervector(struct bwn_mac *); +static struct bwn_lo_calib *bwn_lo_calibset(struct bwn_mac *, + const struct bwn_bbatt *, const struct bwn_rfatt *); +static void bwn_lo_write(struct bwn_mac *, struct bwn_loctl *); +static void bwn_phy_hwpctl_init(struct bwn_mac *); +static void bwn_phy_g_switch_chan(struct bwn_mac *, int, uint8_t); +static void bwn_phy_g_set_txpwr_sub(struct bwn_mac *, + const struct bwn_bbatt *, const struct bwn_rfatt *, + uint8_t); +static void bwn_phy_g_set_bbatt(struct bwn_mac *, uint16_t); +static uint16_t bwn_rf_2050_rfoverval(struct bwn_mac *, uint16_t, uint32_t); +static void bwn_spu_workaround(struct bwn_mac *, uint8_t); +static void bwn_wa_init(struct bwn_mac *); +static void bwn_ofdmtab_write_2(struct bwn_mac *, uint16_t, uint16_t, + uint16_t); +static void bwn_dummy_transmission(struct bwn_mac *, int, int); +static void bwn_ofdmtab_write_4(struct bwn_mac *, uint16_t, uint16_t, + uint32_t); +static void bwn_gtab_write(struct bwn_mac *, uint16_t, uint16_t, + uint16_t); +static void bwn_ram_write(struct bwn_mac *, uint16_t, uint32_t); +static void bwn_mac_suspend(struct bwn_mac *); +static void bwn_mac_enable(struct bwn_mac *); +static void bwn_psctl(struct bwn_mac *, uint32_t); +static int16_t bwn_nrssi_read(struct bwn_mac *, uint16_t); +static void bwn_nrssi_offset(struct bwn_mac *); +static void bwn_nrssi_threshold(struct bwn_mac *); +static void bwn_nrssi_slope_11g(struct bwn_mac *); +static void bwn_set_all_gains(struct bwn_mac *, int16_t, int16_t, + int16_t); +static void bwn_set_original_gains(struct bwn_mac *); +static void bwn_hwpctl_early_init(struct bwn_mac *); +static void bwn_hwpctl_init_gphy(struct bwn_mac *); +static uint16_t bwn_phy_g_chan2freq(uint8_t); +static int bwn_fw_gets(struct bwn_mac *, enum bwn_fwtype); +static int bwn_fw_get(struct bwn_mac *, enum bwn_fwtype, + const char *, struct bwn_fwfile *); +static void bwn_release_firmware(struct bwn_mac *); +static void bwn_do_release_fw(struct bwn_fwfile *); +static uint16_t bwn_fwcaps_read(struct bwn_mac *); +static int bwn_fwinitvals_write(struct bwn_mac *, + const struct bwn_fwinitvals *, size_t, size_t); +static int bwn_switch_channel(struct bwn_mac *, int); +static uint16_t bwn_ant2phy(int); +static void bwn_mac_write_bssid(struct bwn_mac *); +static void bwn_mac_setfilter(struct bwn_mac *, uint16_t, + const uint8_t *); +static void bwn_key_dowrite(struct bwn_mac *, uint8_t, uint8_t, + const uint8_t *, size_t, const uint8_t *); +static void bwn_key_macwrite(struct bwn_mac *, uint8_t, + const uint8_t *); +static void bwn_key_write(struct bwn_mac *, uint8_t, uint8_t, + const uint8_t *); +static void bwn_phy_exit(struct bwn_mac *); +static void bwn_core_stop(struct bwn_mac *); +static int bwn_switch_band(struct bwn_softc *, + struct ieee80211_channel *); +static void bwn_phy_reset(struct bwn_mac *); +static int bwn_newstate(struct ieee80211vap *, enum ieee80211_state, int); +static void bwn_set_pretbtt(struct bwn_mac *); +static int bwn_intr(void *); +static void bwn_intrtask(void *, int); +static void bwn_restart(struct bwn_mac *, const char *); +static void bwn_intr_ucode_debug(struct bwn_mac *); +static void bwn_intr_tbtt_indication(struct bwn_mac *); +static void bwn_intr_atim_end(struct bwn_mac *); +static void bwn_intr_beacon(struct bwn_mac *); +static void bwn_intr_pmq(struct bwn_mac *); +static void bwn_intr_noise(struct bwn_mac *); +static void bwn_intr_txeof(struct bwn_mac *); +static void bwn_hwreset(void *, int); +static void bwn_handle_fwpanic(struct bwn_mac *); +static void bwn_load_beacon0(struct bwn_mac *); +static void bwn_load_beacon1(struct bwn_mac *); +static uint32_t bwn_jssi_read(struct bwn_mac *); +static void bwn_noise_gensample(struct bwn_mac *); +static void bwn_handle_txeof(struct bwn_mac *, + const struct bwn_txstatus *); +static void bwn_rxeof(struct bwn_mac *, struct mbuf *, const void *); +static void bwn_phy_txpower_check(struct bwn_mac *, uint32_t); +static void bwn_start_locked(struct ifnet *); +static int bwn_tx_start(struct bwn_softc *, struct ieee80211_node *, + struct mbuf *); +static int bwn_tx_isfull(struct bwn_softc *, struct mbuf *); +static int bwn_set_txhdr(struct bwn_mac *, + struct ieee80211_node *, struct mbuf *, struct bwn_txhdr *, + uint16_t); +static void bwn_plcp_genhdr(struct bwn_plcp4 *, const uint16_t, + const uint8_t); +static uint8_t bwn_antenna_sanitize(struct bwn_mac *, uint8_t); +static uint8_t bwn_get_fbrate(uint8_t); +static int bwn_phy_shm_tssi_read(struct bwn_mac *, uint16_t); +static void bwn_phy_g_setatt(struct bwn_mac *, int *, int *); +static void bwn_phy_lock(struct bwn_mac *); +static void bwn_phy_unlock(struct bwn_mac *); +static void bwn_rf_lock(struct bwn_mac *); +static void bwn_rf_unlock(struct bwn_mac *); +static void bwn_txpwr(void *, int); +static void bwn_tasks(void *); +static void bwn_task_15s(struct bwn_mac *); +static void bwn_task_30s(struct bwn_mac *); +static void bwn_task_60s(struct bwn_mac *); +static int bwn_plcp_get_ofdmrate(struct bwn_mac *, struct bwn_plcp6 *, + uint8_t); +static int bwn_plcp_get_cckrate(struct bwn_mac *, struct bwn_plcp6 *); +static void bwn_rx_radiotap(struct bwn_mac *, struct mbuf *, + const struct bwn_rxhdr4 *, struct bwn_plcp6 *, int, + int, int); +static void bwn_tsf_read(struct bwn_mac *, uint64_t *); +static void bwn_phy_g_dc_lookup_init(struct bwn_mac *, uint8_t); +static void bwn_set_slot_time(struct bwn_mac *, uint16_t); +static void bwn_watchdog(void *); +static void bwn_dma_stop(struct bwn_mac *); +static void bwn_pio_stop(struct bwn_mac *); +static void bwn_dma_ringstop(struct bwn_dma_ring **); +static void bwn_led_attach(struct bwn_mac *); +static void bwn_led_newstate(struct bwn_mac *, enum ieee80211_state); +static void bwn_led_event(struct bwn_mac *, int); +static void bwn_led_blink_start(struct bwn_mac *, int, int); +static void bwn_led_blink_next(void *); +static void bwn_led_blink_end(void *); +static void bwn_rfswitch(void *); +static void bwn_rf_turnon(struct bwn_mac *); +static void bwn_rf_turnoff(struct bwn_mac *); +static void bwn_phy_lp_init_pre(struct bwn_mac *); +static int bwn_phy_lp_init(struct bwn_mac *); +static uint16_t bwn_phy_lp_read(struct bwn_mac *, uint16_t); +static void bwn_phy_lp_write(struct bwn_mac *, uint16_t, uint16_t); +static void bwn_phy_lp_maskset(struct bwn_mac *, uint16_t, uint16_t, + uint16_t); +static uint16_t bwn_phy_lp_rf_read(struct bwn_mac *, uint16_t); +static void bwn_phy_lp_rf_write(struct bwn_mac *, uint16_t, uint16_t); +static void bwn_phy_lp_rf_onoff(struct bwn_mac *, int); +static int bwn_phy_lp_switch_channel(struct bwn_mac *, uint32_t); +static uint32_t bwn_phy_lp_get_default_chan(struct bwn_mac *); +static void bwn_phy_lp_set_antenna(struct bwn_mac *, int); +static void bwn_phy_lp_task_60s(struct bwn_mac *); +static void bwn_phy_lp_readsprom(struct bwn_mac *); +static void bwn_phy_lp_bbinit(struct bwn_mac *); +static void bwn_phy_lp_txpctl_init(struct bwn_mac *); +static void bwn_phy_lp_calib(struct bwn_mac *); +static void bwn_phy_lp_switch_analog(struct bwn_mac *, int); +static int bwn_phy_lp_b2062_switch_channel(struct bwn_mac *, uint8_t); +static int bwn_phy_lp_b2063_switch_channel(struct bwn_mac *, uint8_t); +static void bwn_phy_lp_set_anafilter(struct bwn_mac *, uint8_t); +static void bwn_phy_lp_set_gaintbl(struct bwn_mac *, uint32_t); +static void bwn_phy_lp_digflt_save(struct bwn_mac *); +static void bwn_phy_lp_get_txpctlmode(struct bwn_mac *); +static void bwn_phy_lp_set_txpctlmode(struct bwn_mac *, uint8_t); +static void bwn_phy_lp_bugfix(struct bwn_mac *); +static void bwn_phy_lp_digflt_restore(struct bwn_mac *); +static void bwn_phy_lp_tblinit(struct bwn_mac *); +static void bwn_phy_lp_bbinit_r2(struct bwn_mac *); +static void bwn_phy_lp_bbinit_r01(struct bwn_mac *); +static void bwn_phy_lp_b2062_init(struct bwn_mac *); +static void bwn_phy_lp_b2063_init(struct bwn_mac *); +static void bwn_phy_lp_rxcal_r2(struct bwn_mac *); +static void bwn_phy_lp_rccal_r12(struct bwn_mac *); +static void bwn_phy_lp_set_rccap(struct bwn_mac *); +static uint32_t bwn_phy_lp_roundup(uint32_t, uint32_t, uint8_t); +static void bwn_phy_lp_b2062_reset_pllbias(struct bwn_mac *); +static void bwn_phy_lp_b2062_vco_calib(struct bwn_mac *); +static void bwn_tab_write_multi(struct bwn_mac *, uint32_t, int, + const void *); +static void bwn_tab_read_multi(struct bwn_mac *, uint32_t, int, void *); +static struct bwn_txgain + bwn_phy_lp_get_txgain(struct bwn_mac *); +static uint8_t bwn_phy_lp_get_bbmult(struct bwn_mac *); +static void bwn_phy_lp_set_txgain(struct bwn_mac *, struct bwn_txgain *); +static void bwn_phy_lp_set_bbmult(struct bwn_mac *, uint8_t); +static void bwn_phy_lp_set_trsw_over(struct bwn_mac *, uint8_t, uint8_t); +static void bwn_phy_lp_set_rxgain(struct bwn_mac *, uint32_t); +static void bwn_phy_lp_set_deaf(struct bwn_mac *, uint8_t); +static int bwn_phy_lp_calc_rx_iq_comp(struct bwn_mac *, uint16_t); +static void bwn_phy_lp_clear_deaf(struct bwn_mac *, uint8_t); +static void bwn_phy_lp_tblinit_r01(struct bwn_mac *); +static void bwn_phy_lp_tblinit_r2(struct bwn_mac *); +static void bwn_phy_lp_tblinit_txgain(struct bwn_mac *); +static void bwn_tab_write(struct bwn_mac *, uint32_t, uint32_t); +static void bwn_phy_lp_b2062_tblinit(struct bwn_mac *); +static void bwn_phy_lp_b2063_tblinit(struct bwn_mac *); +static int bwn_phy_lp_loopback(struct bwn_mac *); +static void bwn_phy_lp_set_rxgain_idx(struct bwn_mac *, uint16_t); +static void bwn_phy_lp_ddfs_turnon(struct bwn_mac *, int, int, int, int, + int); +static uint8_t bwn_phy_lp_rx_iq_est(struct bwn_mac *, uint16_t, uint8_t, + struct bwn_phy_lp_iq_est *); +static void bwn_phy_lp_ddfs_turnoff(struct bwn_mac *); +static uint32_t bwn_tab_read(struct bwn_mac *, uint32_t); +static void bwn_phy_lp_set_txgain_dac(struct bwn_mac *, uint16_t); +static void bwn_phy_lp_set_txgain_pa(struct bwn_mac *, uint16_t); +static void bwn_phy_lp_set_txgain_override(struct bwn_mac *); +static uint16_t bwn_phy_lp_get_pa_gain(struct bwn_mac *); +static uint8_t bwn_nbits(int32_t); +static void bwn_phy_lp_gaintbl_write_multi(struct bwn_mac *, int, int, + struct bwn_txgain_entry *); +static void bwn_phy_lp_gaintbl_write(struct bwn_mac *, int, + struct bwn_txgain_entry); +static void bwn_phy_lp_gaintbl_write_r2(struct bwn_mac *, int, + struct bwn_txgain_entry); +static void bwn_phy_lp_gaintbl_write_r01(struct bwn_mac *, int, + struct bwn_txgain_entry); + +static struct resource_spec bwn_res_spec_legacy[] = { + { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, + { -1, 0, 0 } +}; + +static struct resource_spec bwn_res_spec_msi[] = { + { SYS_RES_IRQ, 1, RF_ACTIVE }, + { -1, 0, 0 } +}; + +static const struct bwn_channelinfo bwn_chantable_bg = { + .channels = { + { 2412, 1, 30 }, { 2417, 2, 30 }, { 2422, 3, 30 }, + { 2427, 4, 30 }, { 2432, 5, 30 }, { 2437, 6, 30 }, + { 2442, 7, 30 }, { 2447, 8, 30 }, { 2452, 9, 30 }, + { 2457, 10, 30 }, { 2462, 11, 30 }, { 2467, 12, 30 }, + { 2472, 13, 30 }, { 2484, 14, 30 } }, + .nchannels = 14 +}; + +static const struct bwn_channelinfo bwn_chantable_a = { + .channels = { + { 5170, 34, 30 }, { 5180, 36, 30 }, { 5190, 38, 30 }, + { 5200, 40, 30 }, { 5210, 42, 30 }, { 5220, 44, 30 }, + { 5230, 46, 30 }, { 5240, 48, 30 }, { 5260, 52, 30 }, + { 5280, 56, 30 }, { 5300, 60, 30 }, { 5320, 64, 30 }, + { 5500, 100, 30 }, { 5520, 104, 30 }, { 5540, 108, 30 }, + { 5560, 112, 30 }, { 5580, 116, 30 }, { 5600, 120, 30 }, + { 5620, 124, 30 }, { 5640, 128, 30 }, { 5660, 132, 30 }, + { 5680, 136, 30 }, { 5700, 140, 30 }, { 5745, 149, 30 }, + { 5765, 153, 30 }, { 5785, 157, 30 }, { 5805, 161, 30 }, + { 5825, 165, 30 }, { 5920, 184, 30 }, { 5940, 188, 30 }, + { 5960, 192, 30 }, { 5980, 196, 30 }, { 6000, 200, 30 }, + { 6020, 204, 30 }, { 6040, 208, 30 }, { 6060, 212, 30 }, + { 6080, 216, 30 } }, + .nchannels = 37 +}; + +static const struct bwn_channelinfo bwn_chantable_n = { + .channels = { + { 5160, 32, 30 }, { 5170, 34, 30 }, { 5180, 36, 30 }, + { 5190, 38, 30 }, { 5200, 40, 30 }, { 5210, 42, 30 }, + { 5220, 44, 30 }, { 5230, 46, 30 }, { 5240, 48, 30 }, + { 5250, 50, 30 }, { 5260, 52, 30 }, { 5270, 54, 30 }, + { 5280, 56, 30 }, { 5290, 58, 30 }, { 5300, 60, 30 }, + { 5310, 62, 30 }, { 5320, 64, 30 }, { 5330, 66, 30 }, + { 5340, 68, 30 }, { 5350, 70, 30 }, { 5360, 72, 30 }, + { 5370, 74, 30 }, { 5380, 76, 30 }, { 5390, 78, 30 }, + { 5400, 80, 30 }, { 5410, 82, 30 }, { 5420, 84, 30 }, + { 5430, 86, 30 }, { 5440, 88, 30 }, { 5450, 90, 30 }, + { 5460, 92, 30 }, { 5470, 94, 30 }, { 5480, 96, 30 }, + { 5490, 98, 30 }, { 5500, 100, 30 }, { 5510, 102, 30 }, + { 5520, 104, 30 }, { 5530, 106, 30 }, { 5540, 108, 30 }, + { 5550, 110, 30 }, { 5560, 112, 30 }, { 5570, 114, 30 }, + { 5580, 116, 30 }, { 5590, 118, 30 }, { 5600, 120, 30 }, + { 5610, 122, 30 }, { 5620, 124, 30 }, { 5630, 126, 30 }, + { 5640, 128, 30 }, { 5650, 130, 30 }, { 5660, 132, 30 }, + { 5670, 134, 30 }, { 5680, 136, 30 }, { 5690, 138, 30 }, + { 5700, 140, 30 }, { 5710, 142, 30 }, { 5720, 144, 30 }, + { 5725, 145, 30 }, { 5730, 146, 30 }, { 5735, 147, 30 }, + { 5740, 148, 30 }, { 5745, 149, 30 }, { 5750, 150, 30 }, + { 5755, 151, 30 }, { 5760, 152, 30 }, { 5765, 153, 30 }, + { 5770, 154, 30 }, { 5775, 155, 30 }, { 5780, 156, 30 }, + { 5785, 157, 30 }, { 5790, 158, 30 }, { 5795, 159, 30 }, + { 5800, 160, 30 }, { 5805, 161, 30 }, { 5810, 162, 30 }, + { 5815, 163, 30 }, { 5820, 164, 30 }, { 5825, 165, 30 }, + { 5830, 166, 30 }, { 5840, 168, 30 }, { 5850, 170, 30 }, + { 5860, 172, 30 }, { 5870, 174, 30 }, { 5880, 176, 30 }, + { 5890, 178, 30 }, { 5900, 180, 30 }, { 5910, 182, 30 }, + { 5920, 184, 30 }, { 5930, 186, 30 }, { 5940, 188, 30 }, + { 5950, 190, 30 }, { 5960, 192, 30 }, { 5970, 194, 30 }, + { 5980, 196, 30 }, { 5990, 198, 30 }, { 6000, 200, 30 }, + { 6010, 202, 30 }, { 6020, 204, 30 }, { 6030, 206, 30 }, + { 6040, 208, 30 }, { 6050, 210, 30 }, { 6060, 212, 30 }, + { 6070, 214, 30 }, { 6080, 216, 30 }, { 6090, 218, 30 }, + { 6100, 220, 30 }, { 6110, 222, 30 }, { 6120, 224, 30 }, + { 6130, 226, 30 }, { 6140, 228, 30 } }, + .nchannels = 110 +}; + +static const uint8_t bwn_b2063_chantable_data[33][12] = { + { 0x6f, 0x3c, 0x3c, 0x4, 0x5, 0x5, 0x5, 0x5, 0x77, 0x80, 0x80, 0x70 }, + { 0x6f, 0x2c, 0x2c, 0x4, 0x5, 0x5, 0x5, 0x5, 0x77, 0x80, 0x80, 0x70 }, + { 0x6f, 0x1c, 0x1c, 0x4, 0x5, 0x5, 0x5, 0x5, 0x77, 0x80, 0x80, 0x70 }, + { 0x6e, 0x1c, 0x1c, 0x4, 0x5, 0x5, 0x5, 0x5, 0x77, 0x80, 0x80, 0x70 }, + { 0x6e, 0xc, 0xc, 0x4, 0x5, 0x5, 0x5, 0x5, 0x77, 0x80, 0x80, 0x70 }, + { 0x6a, 0xc, 0xc, 0, 0x2, 0x5, 0xd, 0xd, 0x77, 0x80, 0x20, 0 }, + { 0x6a, 0xc, 0xc, 0, 0x1, 0x5, 0xd, 0xc, 0x77, 0x80, 0x20, 0 }, + { 0x6a, 0xc, 0xc, 0, 0x1, 0x4, 0xc, 0xc, 0x77, 0x80, 0x20, 0 }, + { 0x69, 0xc, 0xc, 0, 0x1, 0x4, 0xc, 0xc, 0x77, 0x70, 0x20, 0 }, + { 0x69, 0xc, 0xc, 0, 0x1, 0x4, 0xb, 0xc, 0x77, 0x70, 0x20, 0 }, + { 0x69, 0xc, 0xc, 0, 0, 0x4, 0xb, 0xb, 0x77, 0x60, 0x20, 0 }, + { 0x69, 0xc, 0xc, 0, 0, 0x3, 0xa, 0xb, 0x77, 0x60, 0x20, 0 }, + { 0x69, 0xc, 0xc, 0, 0, 0x3, 0xa, 0xa, 0x77, 0x60, 0x20, 0 }, + { 0x68, 0xc, 0xc, 0, 0, 0x2, 0x9, 0x9, 0x77, 0x60, 0x20, 0 }, + { 0x68, 0xc, 0xc, 0, 0, 0x1, 0x8, 0x8, 0x77, 0x50, 0x10, 0 }, + { 0x67, 0xc, 0xc, 0, 0, 0, 0x8, 0x8, 0x77, 0x50, 0x10, 0 }, + { 0x64, 0xc, 0xc, 0, 0, 0, 0x2, 0x1, 0x77, 0x20, 0, 0 }, + { 0x64, 0xc, 0xc, 0, 0, 0, 0x1, 0x1, 0x77, 0x20, 0, 0 }, + { 0x63, 0xc, 0xc, 0, 0, 0, 0x1, 0, 0x77, 0x10, 0, 0 }, + { 0x63, 0xc, 0xc, 0, 0, 0, 0, 0, 0x77, 0x10, 0, 0 }, + { 0x62, 0xc, 0xc, 0, 0, 0, 0, 0, 0x77, 0x10, 0, 0 }, + { 0x62, 0xc, 0xc, 0, 0, 0, 0, 0, 0x77, 0, 0, 0 }, + { 0x61, 0xc, 0xc, 0, 0, 0, 0, 0, 0x77, 0, 0, 0 }, + { 0x60, 0xc, 0xc, 0, 0, 0, 0, 0, 0x77, 0, 0, 0 }, + { 0x6e, 0xc, 0xc, 0, 0x9, 0xe, 0xf, 0xf, 0x77, 0xc0, 0x50, 0 }, + { 0x6e, 0xc, 0xc, 0, 0x9, 0xd, 0xf, 0xf, 0x77, 0xb0, 0x50, 0 }, + { 0x6e, 0xc, 0xc, 0, 0x8, 0xc, 0xf, 0xf, 0x77, 0xb0, 0x50, 0 }, + { 0x6d, 0xc, 0xc, 0, 0x8, 0xc, 0xf, 0xf, 0x77, 0xa0, 0x40, 0 }, + { 0x6d, 0xc, 0xc, 0, 0x8, 0xb, 0xf, 0xf, 0x77, 0xa0, 0x40, 0 }, + { 0x6d, 0xc, 0xc, 0, 0x8, 0xa, 0xf, 0xf, 0x77, 0xa0, 0x40, 0 }, + { 0x6c, 0xc, 0xc, 0, 0x7, 0x9, 0xf, 0xf, 0x77, 0x90, 0x40, 0 }, + { 0x6c, 0xc, 0xc, 0, 0x6, 0x8, 0xf, 0xf, 0x77, 0x90, 0x40, 0 }, + { 0x6c, 0xc, 0xc, 0, 0x5, 0x8, 0xf, 0xf, 0x77, 0x90, 0x40, 0 } +}; + +static const struct bwn_b206x_chan bwn_b2063_chantable[] = { + { 1, 2412, bwn_b2063_chantable_data[0] }, + { 2, 2417, bwn_b2063_chantable_data[0] }, + { 3, 2422, bwn_b2063_chantable_data[0] }, + { 4, 2427, bwn_b2063_chantable_data[1] }, + { 5, 2432, bwn_b2063_chantable_data[1] }, + { 6, 2437, bwn_b2063_chantable_data[1] }, + { 7, 2442, bwn_b2063_chantable_data[1] }, + { 8, 2447, bwn_b2063_chantable_data[1] }, + { 9, 2452, bwn_b2063_chantable_data[2] }, + { 10, 2457, bwn_b2063_chantable_data[2] }, + { 11, 2462, bwn_b2063_chantable_data[3] }, + { 12, 2467, bwn_b2063_chantable_data[3] }, + { 13, 2472, bwn_b2063_chantable_data[3] }, + { 14, 2484, bwn_b2063_chantable_data[4] }, + { 34, 5170, bwn_b2063_chantable_data[5] }, + { 36, 5180, bwn_b2063_chantable_data[6] }, + { 38, 5190, bwn_b2063_chantable_data[7] }, + { 40, 5200, bwn_b2063_chantable_data[8] }, + { 42, 5210, bwn_b2063_chantable_data[9] }, + { 44, 5220, bwn_b2063_chantable_data[10] }, + { 46, 5230, bwn_b2063_chantable_data[11] }, + { 48, 5240, bwn_b2063_chantable_data[12] }, + { 52, 5260, bwn_b2063_chantable_data[13] }, + { 56, 5280, bwn_b2063_chantable_data[14] }, + { 60, 5300, bwn_b2063_chantable_data[14] }, + { 64, 5320, bwn_b2063_chantable_data[15] }, + { 100, 5500, bwn_b2063_chantable_data[16] }, + { 104, 5520, bwn_b2063_chantable_data[17] }, + { 108, 5540, bwn_b2063_chantable_data[18] }, + { 112, 5560, bwn_b2063_chantable_data[19] }, + { 116, 5580, bwn_b2063_chantable_data[20] }, + { 120, 5600, bwn_b2063_chantable_data[21] }, + { 124, 5620, bwn_b2063_chantable_data[21] }, + { 128, 5640, bwn_b2063_chantable_data[22] }, + { 132, 5660, bwn_b2063_chantable_data[22] }, + { 136, 5680, bwn_b2063_chantable_data[22] }, + { 140, 5700, bwn_b2063_chantable_data[23] }, + { 149, 5745, bwn_b2063_chantable_data[23] }, + { 153, 5765, bwn_b2063_chantable_data[23] }, + { 157, 5785, bwn_b2063_chantable_data[23] }, + { 161, 5805, bwn_b2063_chantable_data[23] }, + { 165, 5825, bwn_b2063_chantable_data[23] }, + { 184, 4920, bwn_b2063_chantable_data[24] }, + { 188, 4940, bwn_b2063_chantable_data[25] }, + { 192, 4960, bwn_b2063_chantable_data[26] }, + { 196, 4980, bwn_b2063_chantable_data[27] }, + { 200, 5000, bwn_b2063_chantable_data[28] }, + { 204, 5020, bwn_b2063_chantable_data[29] }, + { 208, 5040, bwn_b2063_chantable_data[30] }, + { 212, 5060, bwn_b2063_chantable_data[31] }, + { 216, 5080, bwn_b2063_chantable_data[32] } +}; + +static const uint8_t bwn_b2062_chantable_data[22][12] = { + { 0xff, 0xff, 0xb5, 0x1b, 0x24, 0x32, 0x32, 0x88, 0x88, 0, 0, 0 }, + { 0, 0x22, 0x20, 0x84, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, + { 0, 0x11, 0x10, 0x83, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, + { 0, 0, 0, 0x83, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, + { 0, 0x11, 0x20, 0x83, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, + { 0, 0x11, 0x10, 0x84, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, + { 0, 0x11, 0, 0x83, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, + { 0, 0, 0, 0x63, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, + { 0, 0, 0, 0x62, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, + { 0, 0, 0, 0x30, 0x3c, 0x77, 0x37, 0xff, 0x88, 0, 0, 0 }, + { 0, 0, 0, 0x20, 0x3c, 0x77, 0x37, 0xff, 0x88, 0, 0, 0 }, + { 0, 0, 0, 0x10, 0x3c, 0x77, 0x37, 0xff, 0x88, 0, 0, 0 }, + { 0, 0, 0, 0, 0x3c, 0x77, 0x37, 0xff, 0x88, 0, 0, 0 }, + { 0x55, 0x77, 0x90, 0xf7, 0x3c, 0x77, 0x35, 0xff, 0xff, 0, 0, 0 }, + { 0x44, 0x77, 0x80, 0xe7, 0x3c, 0x77, 0x35, 0xff, 0xff, 0, 0, 0 }, + { 0x44, 0x66, 0x80, 0xe7, 0x3c, 0x77, 0x35, 0xff, 0xff, 0, 0, 0 }, + { 0x33, 0x66, 0x70, 0xc7, 0x3c, 0x77, 0x35, 0xff, 0xff, 0, 0, 0 }, + { 0x22, 0x55, 0x60, 0xd7, 0x3c, 0x77, 0x35, 0xff, 0xff, 0, 0, 0 }, + { 0x22, 0x55, 0x60, 0xc7, 0x3c, 0x77, 0x35, 0xff, 0xff, 0, 0, 0 }, + { 0x22, 0x44, 0x50, 0xc7, 0x3c, 0x77, 0x35, 0xff, 0xff, 0, 0, 0 }, + { 0x11, 0x44, 0x50, 0xa5, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 }, + { 0, 0x44, 0x40, 0xb6, 0x3c, 0x77, 0x35, 0xff, 0x88, 0, 0, 0 } +}; + +static const struct bwn_b206x_chan bwn_b2062_chantable[] = { + { 1, 2412, bwn_b2062_chantable_data[0] }, + { 2, 2417, bwn_b2062_chantable_data[0] }, + { 3, 2422, bwn_b2062_chantable_data[0] }, + { 4, 2427, bwn_b2062_chantable_data[0] }, + { 5, 2432, bwn_b2062_chantable_data[0] }, + { 6, 2437, bwn_b2062_chantable_data[0] }, + { 7, 2442, bwn_b2062_chantable_data[0] }, + { 8, 2447, bwn_b2062_chantable_data[0] }, + { 9, 2452, bwn_b2062_chantable_data[0] }, + { 10, 2457, bwn_b2062_chantable_data[0] }, + { 11, 2462, bwn_b2062_chantable_data[0] }, + { 12, 2467, bwn_b2062_chantable_data[0] }, + { 13, 2472, bwn_b2062_chantable_data[0] }, + { 14, 2484, bwn_b2062_chantable_data[0] }, + { 34, 5170, bwn_b2062_chantable_data[1] }, + { 38, 5190, bwn_b2062_chantable_data[2] }, + { 42, 5210, bwn_b2062_chantable_data[2] }, + { 46, 5230, bwn_b2062_chantable_data[3] }, + { 36, 5180, bwn_b2062_chantable_data[4] }, + { 40, 5200, bwn_b2062_chantable_data[5] }, + { 44, 5220, bwn_b2062_chantable_data[6] }, + { 48, 5240, bwn_b2062_chantable_data[3] }, + { 52, 5260, bwn_b2062_chantable_data[3] }, + { 56, 5280, bwn_b2062_chantable_data[3] }, + { 60, 5300, bwn_b2062_chantable_data[7] }, + { 64, 5320, bwn_b2062_chantable_data[8] }, + { 100, 5500, bwn_b2062_chantable_data[9] }, + { 104, 5520, bwn_b2062_chantable_data[10] }, + { 108, 5540, bwn_b2062_chantable_data[10] }, + { 112, 5560, bwn_b2062_chantable_data[10] }, + { 116, 5580, bwn_b2062_chantable_data[11] }, + { 120, 5600, bwn_b2062_chantable_data[12] }, + { 124, 5620, bwn_b2062_chantable_data[12] }, + { 128, 5640, bwn_b2062_chantable_data[12] }, + { 132, 5660, bwn_b2062_chantable_data[12] }, + { 136, 5680, bwn_b2062_chantable_data[12] }, + { 140, 5700, bwn_b2062_chantable_data[12] }, + { 149, 5745, bwn_b2062_chantable_data[12] }, + { 153, 5765, bwn_b2062_chantable_data[12] }, + { 157, 5785, bwn_b2062_chantable_data[12] }, + { 161, 5805, bwn_b2062_chantable_data[12] }, + { 165, 5825, bwn_b2062_chantable_data[12] }, + { 184, 4920, bwn_b2062_chantable_data[13] }, + { 188, 4940, bwn_b2062_chantable_data[14] }, + { 192, 4960, bwn_b2062_chantable_data[15] }, + { 196, 4980, bwn_b2062_chantable_data[16] }, + { 200, 5000, bwn_b2062_chantable_data[17] }, + { 204, 5020, bwn_b2062_chantable_data[18] }, + { 208, 5040, bwn_b2062_chantable_data[19] }, + { 212, 5060, bwn_b2062_chantable_data[20] }, + { 216, 5080, bwn_b2062_chantable_data[21] } +}; + +/* for LP PHY */ +static const struct bwn_rxcompco bwn_rxcompco_5354[] = { + { 1, -66, 15 }, { 2, -66, 15 }, { 3, -66, 15 }, { 4, -66, 15 }, + { 5, -66, 15 }, { 6, -66, 15 }, { 7, -66, 14 }, { 8, -66, 14 }, + { 9, -66, 14 }, { 10, -66, 14 }, { 11, -66, 14 }, { 12, -66, 13 }, + { 13, -66, 13 }, { 14, -66, 13 }, +}; + +/* for LP PHY */ +static const struct bwn_rxcompco bwn_rxcompco_r12[] = { + { 1, -64, 13 }, { 2, -64, 13 }, { 3, -64, 13 }, { 4, -64, 13 }, + { 5, -64, 12 }, { 6, -64, 12 }, { 7, -64, 12 }, { 8, -64, 12 }, + { 9, -64, 12 }, { 10, -64, 11 }, { 11, -64, 11 }, { 12, -64, 11 }, + { 13, -64, 11 }, { 14, -64, 10 }, { 34, -62, 24 }, { 38, -62, 24 }, + { 42, -62, 24 }, { 46, -62, 23 }, { 36, -62, 24 }, { 40, -62, 24 }, + { 44, -62, 23 }, { 48, -62, 23 }, { 52, -62, 23 }, { 56, -62, 22 }, + { 60, -62, 22 }, { 64, -62, 22 }, { 100, -62, 16 }, { 104, -62, 16 }, + { 108, -62, 15 }, { 112, -62, 14 }, { 116, -62, 14 }, { 120, -62, 13 }, + { 124, -62, 12 }, { 128, -62, 12 }, { 132, -62, 12 }, { 136, -62, 11 }, + { 140, -62, 10 }, { 149, -61, 9 }, { 153, -61, 9 }, { 157, -61, 9 }, + { 161, -61, 8 }, { 165, -61, 8 }, { 184, -62, 25 }, { 188, -62, 25 }, + { 192, -62, 25 }, { 196, -62, 25 }, { 200, -62, 25 }, { 204, -62, 25 }, + { 208, -62, 25 }, { 212, -62, 25 }, { 216, -62, 26 }, +}; + +static const struct bwn_rxcompco bwn_rxcompco_r2 = { 0, -64, 0 }; + +static const uint8_t bwn_tab_sigsq_tbl[] = { + 0xde, 0xdc, 0xda, 0xd8, 0xd6, 0xd4, 0xd2, 0xcf, 0xcd, + 0xca, 0xc7, 0xc4, 0xc1, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, + 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0x00, + 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, 0xbe, + 0xbe, 0xbe, 0xbe, 0xbe, 0xc1, 0xc4, 0xc7, 0xca, 0xcd, + 0xcf, 0xd2, 0xd4, 0xd6, 0xd8, 0xda, 0xdc, 0xde, +}; + +static const uint8_t bwn_tab_pllfrac_tbl[] = { + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, +}; + +static const uint16_t bwn_tabl_iqlocal_tbl[] = { + 0x0200, 0x0300, 0x0400, 0x0600, 0x0800, 0x0b00, 0x1000, 0x1001, 0x1002, + 0x1003, 0x1004, 0x1005, 0x1006, 0x1007, 0x1707, 0x2007, 0x2d07, 0x4007, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0200, 0x0300, 0x0400, 0x0600, + 0x0800, 0x0b00, 0x1000, 0x1001, 0x1002, 0x1003, 0x1004, 0x1005, 0x1006, + 0x1007, 0x1707, 0x2007, 0x2d07, 0x4007, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, +}; + +static const uint16_t bwn_tab_noise_g1[] = BWN_TAB_NOISE_G1; +static const uint16_t bwn_tab_noise_g2[] = BWN_TAB_NOISE_G2; +static const uint16_t bwn_tab_noisescale_g1[] = BWN_TAB_NOISESCALE_G1; +static const uint16_t bwn_tab_noisescale_g2[] = BWN_TAB_NOISESCALE_G2; +static const uint16_t bwn_tab_noisescale_g3[] = BWN_TAB_NOISESCALE_G3; +const uint8_t bwn_bitrev_table[256] = BWN_BITREV_TABLE; + +#define VENDOR_LED_ACT(vendor) \ +{ \ + .vid = PCI_VENDOR_##vendor, \ + .led_act = { BWN_VENDOR_LED_ACT_##vendor } \ +} + +static const struct { + uint16_t vid; + uint8_t led_act[BWN_LED_MAX]; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 02:22:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A59D91065694; Tue, 16 Feb 2010 02:22:59 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95FDB8FC14; Tue, 16 Feb 2010 02:22: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 o1G2MxSg084982; Tue, 16 Feb 2010 02:22:59 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1G2MxVh084980; Tue, 16 Feb 2010 02:22:59 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002160222.o1G2MxVh084980@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 16 Feb 2010 02:22: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: r203946 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 02:22:59 -0000 Author: marcel Date: Tue Feb 16 02:22:59 2010 New Revision: 203946 URL: http://svn.freebsd.org/changeset/base/203946 Log: The static TLS size as given by tls_static_space includes TLS_TCB_SIZE bytes of TCB in variant I. Modified: head/lib/libc/gen/tls.c Modified: head/lib/libc/gen/tls.c ============================================================================== --- head/lib/libc/gen/tls.c Tue Feb 16 01:44:14 2010 (r203945) +++ head/lib/libc/gen/tls.c Tue Feb 16 02:22:59 2010 (r203946) @@ -137,11 +137,11 @@ __libc_allocate_tls(void *oldtcb, size_t if (oldtcb != NULL && tcbsize == TLS_TCB_SIZE) return (oldtcb); - tcb = calloc(1, tls_static_space + tcbsize); + tcb = calloc(1, tls_static_space + tcbsize - TLS_TCB_SIZE); tls = (Elf_Addr **)(tcb + tcbsize - TLS_TCB_SIZE); if (oldtcb != NULL) { - memcpy(tls, oldtcb, tls_static_space + TLS_TCB_SIZE); + memcpy(tls, oldtcb, tls_static_space); free(oldtcb); /* Adjust the DTV. */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 02:48:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 993C81065670; Tue, 16 Feb 2010 02:48:11 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89A998FC19; Tue, 16 Feb 2010 02: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 o1G2mBJ3090588; Tue, 16 Feb 2010 02:48:11 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1G2mBDG090586; Tue, 16 Feb 2010 02:48:11 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002160248.o1G2mBDG090586@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 16 Feb 2010 02: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: r203947 - head/libexec/rtld-elf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 02:48:11 -0000 Author: marcel Date: Tue Feb 16 02:48:11 2010 New Revision: 203947 URL: http://svn.freebsd.org/changeset/base/203947 Log: Improve TLS variant I: o Use obj->tlsinitsize to determine whether there's initialized data. o If obj->tlssize > obj->tlsinitsize, then bzero uninitialized data. o Don't exclude variant I from the work-around in free_tls_offset(). Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Feb 16 02:22:59 2010 (r203946) +++ head/libexec/rtld-elf/rtld.c Tue Feb 16 02:48:11 2010 (r203947) @@ -3151,13 +3151,13 @@ allocate_tls(Obj_Entry *objs, void *oldt dtv[1] = tls_max_index; for (obj = objs; obj; obj = obj->next) { - if (obj->tlsoffset) { + if (obj->tlsoffset > 0) { addr = (Elf_Addr)tls + obj->tlsoffset; - memset((void*) (addr + obj->tlsinitsize), - 0, obj->tlssize - obj->tlsinitsize); - if (obj->tlsinit) - memcpy((void*) addr, obj->tlsinit, - obj->tlsinitsize); + if (obj->tlsinitsize > 0) + memcpy((void*) addr, obj->tlsinit, obj->tlsinitsize); + if (obj->tlssize > obj->tlsinitsize) + memset((void*) (addr + obj->tlsinitsize), 0, + obj->tlssize - obj->tlsinitsize); dtv[obj->tlsindex + 1] = addr; } } @@ -3357,21 +3357,18 @@ allocate_tls_offset(Obj_Entry *obj) void free_tls_offset(Obj_Entry *obj) { -#if defined(__i386__) || defined(__amd64__) || defined(__sparc64__) || \ - defined(__arm__) || defined(__mips__) + /* * If we were the last thing to allocate out of the static TLS * block, we give our space back to the 'allocator'. This is a * simplistic workaround to allow libGL.so.1 to be loaded and - * unloaded multiple times. We only handle the Variant II - * mechanism for now - this really needs a proper allocator. + * unloaded multiple times. */ if (calculate_tls_end(obj->tlsoffset, obj->tlssize) == calculate_tls_end(tls_last_offset, tls_last_size)) { tls_last_offset -= obj->tlssize; tls_last_size = 0; } -#endif } void * From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 06:47:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5865B106566B; Tue, 16 Feb 2010 06:47:01 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E55F8FC08; Tue, 16 Feb 2010 06:47: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 o1G6l1vX043766; Tue, 16 Feb 2010 06:47:01 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1G6l1uL043765; Tue, 16 Feb 2010 06:47:01 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002160647.o1G6l1uL043765@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 16 Feb 2010 06:47: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: r203950 - head/lib/libc/stdlib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 06:47:01 -0000 Author: marcel Date: Tue Feb 16 06:47:00 2010 New Revision: 203950 URL: http://svn.freebsd.org/changeset/base/203950 Log: Unbreak ia64: tls_model("initial-exec") is invalid, because it assumes the static TLS model, which is fundamentally different from the dynamic TLS model. The consequence was data corruption. Limit the attribute to i386 and amd64. Modified: head/lib/libc/stdlib/malloc.c Modified: head/lib/libc/stdlib/malloc.c ============================================================================== --- head/lib/libc/stdlib/malloc.c Tue Feb 16 06:34:44 2010 (r203949) +++ head/lib/libc/stdlib/malloc.c Tue Feb 16 06:47:00 2010 (r203950) @@ -215,10 +215,12 @@ __FBSDID("$FreeBSD$"); # define LG_QUANTUM 4 # define LG_SIZEOF_PTR 2 # define CPU_SPINWAIT __asm__ volatile("pause") +# define TLS_MODEL __attribute__((tls_model("initial-exec"))) #endif #ifdef __ia64__ # define LG_QUANTUM 4 # define LG_SIZEOF_PTR 3 +# define TLS_MODEL /* default */ #endif #ifdef __alpha__ # define LG_QUANTUM 4 @@ -234,6 +236,7 @@ __FBSDID("$FreeBSD$"); # define LG_QUANTUM 4 # define LG_SIZEOF_PTR 3 # define CPU_SPINWAIT __asm__ volatile("pause") +# define TLS_MODEL __attribute__((tls_model("initial-exec"))) #endif #ifdef __arm__ # define LG_QUANTUM 3 @@ -1090,14 +1093,12 @@ static pthread_mutex_t arenas_lock; /* P * Map of _pthread_self() --> arenas[???], used for selecting an arena to use * for allocations. */ -static __thread arena_t *arenas_map - __attribute__((tls_model("initial-exec"))); +static __thread arena_t *arenas_map TLS_MODEL; #endif #ifdef MALLOC_TCACHE /* Map of thread-specific caches. */ -static __thread tcache_t *tcache_tls - __attribute__((tls_model("initial-exec"))); +static __thread tcache_t *tcache_tls TLS_MODEL; /* * Number of cache slots for each bin in the thread cache, or 0 if tcache is @@ -1115,15 +1116,12 @@ unsigned tcache_gc_incr; * since the state of mmap_unaligned only affects performance, rather than * correct function. */ -static #ifndef NO_TLS - __thread -#endif - bool mmap_unaligned -#ifndef NO_TLS - __attribute__((tls_model("initial-exec"))) +static __thread bool mmap_unaligned TLS_MODEL; +#else +static bool mmap_unaligned; #endif - ; + #ifdef MALLOC_STATS static malloc_mutex_t chunks_mtx; /* Chunk statistics. */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 08:19:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 717B6106566C; Tue, 16 Feb 2010 08:19:28 +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 610898FC12; Tue, 16 Feb 2010 08:19: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 o1G8JSVN064042; Tue, 16 Feb 2010 08:19:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1G8JSuZ064040; Tue, 16 Feb 2010 08:19:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002160819.o1G8JSuZ064040@svn.freebsd.org> From: Xin LI Date: Tue, 16 Feb 2010 08:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203951 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 08:19:28 -0000 Author: delphij Date: Tue Feb 16 08:19:28 2010 New Revision: 203951 URL: http://svn.freebsd.org/changeset/base/203951 Log: Remove clause 3 from my license. Modified: head/share/man/man5/tmpfs.5 Modified: head/share/man/man5/tmpfs.5 ============================================================================== --- head/share/man/man5/tmpfs.5 Tue Feb 16 06:47:00 2010 (r203950) +++ head/share/man/man5/tmpfs.5 Tue Feb 16 08:19:28 2010 (r203951) @@ -10,8 +10,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission .\" .\" THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 09:10:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9311106566C; Tue, 16 Feb 2010 09:10:21 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DDE48FC13; Tue, 16 Feb 2010 09:10: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 o1G9ALj6075201; Tue, 16 Feb 2010 09:10:21 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1G9ALip075195; Tue, 16 Feb 2010 09:10:21 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201002160910.o1G9ALip075195@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 16 Feb 2010 09:10: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: r203952 - in head: lib/libarchive share/syscons/keymaps tools/regression/usr.bin/env usr.sbin/cxgbtool usr.sbin/ftp-proxy X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 09:10:21 -0000 Author: uqs Date: Tue Feb 16 09:10:21 2010 New Revision: 203952 URL: http://svn.freebsd.org/changeset/base/203952 Log: Add missing newline in last line of file. Uncovered via: fromcvs vs. svn Approved by: ed (co-mentor) Modified: head/lib/libarchive/archive_write_disk.3 head/share/syscons/keymaps/fr.dvorak.acc.kbd head/tools/regression/usr.bin/env/Makefile head/usr.sbin/cxgbtool/Makefile head/usr.sbin/ftp-proxy/Makefile.inc Modified: head/lib/libarchive/archive_write_disk.3 ============================================================================== --- head/lib/libarchive/archive_write_disk.3 Tue Feb 16 08:19:28 2010 (r203951) +++ head/lib/libarchive/archive_write_disk.3 Tue Feb 16 09:10:21 2010 (r203952) @@ -372,4 +372,4 @@ compact implementation when appropriate. There should be a corresponding .Nm archive_read_disk interface that walks a directory heirarchy and returns archive -entry objects. \ No newline at end of file +entry objects. Modified: head/share/syscons/keymaps/fr.dvorak.acc.kbd ============================================================================== --- head/share/syscons/keymaps/fr.dvorak.acc.kbd Tue Feb 16 08:19:28 2010 (r203951) +++ head/share/syscons/keymaps/fr.dvorak.acc.kbd Tue Feb 16 09:10:21 2010 (r203952) @@ -146,4 +146,4 @@ ( 'y' 255 ) ( 'Y' 190 ) dacu '´' ( 'a' 'á' ) ( 'e' 'é' ) ( 'i' 237 ) ( 'o' 'ó') ( 'u' 'ú' ) ( 'A' 'Á' ) ( 'E' 'É' ) ( 'I' 'Í' ) ( 'O' 'Ó' ) ( 'U' 'Ú' ) - ( 'Y' 221 ) ( 'y' 253 ) \ No newline at end of file + ( 'Y' 221 ) ( 'y' 253 ) Modified: head/tools/regression/usr.bin/env/Makefile ============================================================================== --- head/tools/regression/usr.bin/env/Makefile Tue Feb 16 08:19:28 2010 (r203951) +++ head/tools/regression/usr.bin/env/Makefile Tue Feb 16 09:10:21 2010 (r203952) @@ -14,4 +14,4 @@ all: # This will probably need a bit more thought... testenv: @ruby regress-sb.rb --rgdata=${.CURDIR}/regress-env.rgdata \ - --testpgm=${TESTPGM} \ No newline at end of file + --testpgm=${TESTPGM} Modified: head/usr.sbin/cxgbtool/Makefile ============================================================================== --- head/usr.sbin/cxgbtool/Makefile Tue Feb 16 08:19:28 2010 (r203951) +++ head/usr.sbin/cxgbtool/Makefile Tue Feb 16 09:10:21 2010 (r203952) @@ -8,4 +8,4 @@ CFLAGS+= -DCONFIG_T3_REGS -DCHELSIO_INTE install: -.include \ No newline at end of file +.include Modified: head/usr.sbin/ftp-proxy/Makefile.inc ============================================================================== --- head/usr.sbin/ftp-proxy/Makefile.inc Tue Feb 16 08:19:28 2010 (r203951) +++ head/usr.sbin/ftp-proxy/Makefile.inc Tue Feb 16 09:10:21 2010 (r203952) @@ -2,4 +2,4 @@ LIBEVENT= ${.OBJDIR}/../libevent/libevent.a -.include "../Makefile.inc" \ No newline at end of file +.include "../Makefile.inc" From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 09:10:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2E241065780; Tue, 16 Feb 2010 09:10:48 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C99DF8FC12; Tue, 16 Feb 2010 09:10: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 o1G9AmHF075335; Tue, 16 Feb 2010 09:10:48 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1G9Am5Y075333; Tue, 16 Feb 2010 09:10:48 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201002160910.o1G9Am5Y075333@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 16 Feb 2010 09:10: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: r203953 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 09:10:49 -0000 Author: uqs Date: Tue Feb 16 09:10:48 2010 New Revision: 203953 URL: http://svn.freebsd.org/changeset/base/203953 Log: Document co-mentorship by ed. Approved by: ed (co-mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Tue Feb 16 09:10:21 2010 (r203952) +++ head/share/misc/committers-src.dot Tue Feb 16 09:10:48 2010 (r203953) @@ -264,6 +264,7 @@ dwmalone -> snb ed -> gavin ed -> jilles ed -> rdivacky +ed -> uqs eivind -> des eivind -> rwatson From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 12:29:03 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 319811065670; Tue, 16 Feb 2010 12:29:03 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 211498FC0C; Tue, 16 Feb 2010 12:29: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 o1GCT3js020747; Tue, 16 Feb 2010 12:29:03 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GCT2DE020743; Tue, 16 Feb 2010 12:29:02 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002161229.o1GCT2DE020743@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 16 Feb 2010 12:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203958 - in head/lib: libc/stdio libc/stdtime libpam/modules/pam_echo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 12:29:03 -0000 Author: ru Date: Tue Feb 16 12:29:02 2010 New Revision: 203958 URL: http://svn.freebsd.org/changeset/base/203958 Log: %U was macroized in mdoc(7), escape. Modified: head/lib/libc/stdio/printf.3 head/lib/libc/stdtime/strptime.3 head/lib/libpam/modules/pam_echo/pam_echo.8 Modified: head/lib/libc/stdio/printf.3 ============================================================================== --- head/lib/libc/stdio/printf.3 Tue Feb 16 11:35:50 2010 (r203957) +++ head/lib/libc/stdio/printf.3 Tue Feb 16 12:29:02 2010 (r203958) @@ -812,7 +812,7 @@ available. The conversion formats .Cm \&%D , \&%O , and -.Cm %U +.Cm \&%U are not standard and are provided only for backward compatibility. The effect of padding the Modified: head/lib/libc/stdtime/strptime.3 ============================================================================== --- head/lib/libc/stdtime/strptime.3 Tue Feb 16 11:35:50 2010 (r203957) +++ head/lib/libc/stdtime/strptime.3 Tue Feb 16 12:29:02 2010 (r203958) @@ -149,7 +149,7 @@ and 12PM is taken as noon. .Pp The -.Fa %U +.Fa \&%U and .Fa %W format specifiers accept any value within the range 00 to 53 Modified: head/lib/libpam/modules/pam_echo/pam_echo.8 ============================================================================== --- head/lib/libpam/modules/pam_echo/pam_echo.8 Tue Feb 16 11:35:50 2010 (r203957) +++ head/lib/libpam/modules/pam_echo/pam_echo.8 Tue Feb 16 12:29:02 2010 (r203958) @@ -65,7 +65,7 @@ The current service name .It Cm %t The name of the controlling tty .Pq Dv PAM_TTY . -.It Cm %U +.It Cm \&%U The applicant's user name .Pq Dv PAM_RUSER . .It Cm %u From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 12:43:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEA5C106566C; Tue, 16 Feb 2010 12:43:55 +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 9E8718FC0C; Tue, 16 Feb 2010 12:43: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 o1GChtkk024047; Tue, 16 Feb 2010 12:43:55 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GChtwE024045; Tue, 16 Feb 2010 12:43:55 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201002161243.o1GChtwE024045@svn.freebsd.org> From: Rui Paulo Date: Tue, 16 Feb 2010 12:43: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: r203959 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 12:43:55 -0000 Author: rpaulo Date: Tue Feb 16 12:43:55 2010 New Revision: 203959 URL: http://svn.freebsd.org/changeset/base/203959 Log: Fix Kite and Merlin version check. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Tue Feb 16 12:29:02 2010 (r203958) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Tue Feb 16 12:43:55 2010 (r203959) @@ -600,7 +600,7 @@ (AH_PRIVATE((_ah))->ah_macVersion >= AR_XSREV_VERSION_MERLIN) #define AR_SREV_MERLIN_20(_ah) \ (AR_SREV_MERLIN(_ah) && \ - AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_MERLIN_20) + AH_PRIVATE((_ah))->ah_macRev == AR_XSREV_REVISION_MERLIN_20) #define AR_SREV_MERLIN_20_OR_LATER(_ah) \ (AR_SREV_MERLIN_20(_ah) || \ AH_PRIVATE((_ah))->ah_macVersion > AR_XSREV_VERSION_MERLIN) @@ -617,7 +617,7 @@ AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_KITE_11) #define AR_SREV_KITE_12(_ah) \ (AR_SREV_KITE(ah) && \ - AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_KITE_12) + AH_PRIVATE((_ah))->ah_macRev == AR_XSREV_REVISION_KITE_12) #define AR_SREV_KITE_12_OR_LATER(_ah) \ (AR_SREV_KITE_12(_ah) || \ AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_KITE_12) From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 14:09:12 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBB1B1065676; Tue, 16 Feb 2010 14:09:12 +0000 (UTC) (envelope-from ticso@cicely7.cicely.de) Received: from raven.bwct.de (raven.bwct.de [85.159.14.73]) by mx1.freebsd.org (Postfix) with ESMTP id 6B6988FC19; Tue, 16 Feb 2010 14:09:12 +0000 (UTC) Received: from mail.cicely.de ([10.1.1.37]) by raven.bwct.de (8.13.4/8.13.4) with ESMTP id o1GDUbmY034532 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 16 Feb 2010 14:30:38 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (cicely7.cicely.de [10.1.1.9]) by mail.cicely.de (8.14.3/8.14.3) with ESMTP id o1GDUXKQ084119 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Feb 2010 14:30:33 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) Received: from cicely7.cicely.de (localhost [127.0.0.1]) by cicely7.cicely.de (8.14.2/8.14.2) with ESMTP id o1GDUXs2071275; Tue, 16 Feb 2010 14:30:33 +0100 (CET) (envelope-from ticso@cicely7.cicely.de) Received: (from ticso@localhost) by cicely7.cicely.de (8.14.2/8.14.2/Submit) id o1GDUWMg071274; Tue, 16 Feb 2010 14:30:32 +0100 (CET) (envelope-from ticso) Date: Tue, 16 Feb 2010 14:30:32 +0100 From: Bernd Walter To: "M. Warner Losh" Message-ID: <20100216133032.GH43625@cicely7.cicely.de> References: <20100210203519.GA44831@FreeBSD.org> <3bbf2fe11002151411u552a4749j847b3e10645293e7@mail.gmail.com> <4B79CE84.3060901@freebsd.org> <20100215.171425.646090028373155752.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100215.171425.646090028373155752.imp@bsdimp.com> X-Operating-System: FreeBSD cicely7.cicely.de 7.0-STABLE i386 User-Agent: Mutt/1.5.11 X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED=-1.8, BAYES_00=-2.599 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on spamd.cicely.de Cc: danfe@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, avg@FreeBSD.org, attilio@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r203758 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ticso@cicely.de List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 14:09:13 -0000 On Mon, Feb 15, 2010 at 05:14:25PM -0700, M. Warner Losh wrote: > In message: <4B79CE84.3060901@freebsd.org> > Andriy Gapon writes: > : At least in the i386/amd64 kernel config files typically we have: > : optionsOPTION > : And it is the case for the quoted above amd64 context. > > That's the standard way to add options in all kernel config files, > although there's pockets here and there which don't quite comply. Interesting - I wasn't aware of this, but it surely makes sense. -- B.Walter http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm. From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 16:38:57 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4E861065692; Tue, 16 Feb 2010 16:38:57 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D3C4B8FC14; Tue, 16 Feb 2010 16:38: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 o1GGcvrP075560; Tue, 16 Feb 2010 16:38:57 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GGcv58075557; Tue, 16 Feb 2010 16:38:57 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002161638.o1GGcv58075557@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 16 Feb 2010 16:38: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: r203960 - head/gnu/usr.bin/gdb/arch/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 16:38:58 -0000 Author: marcel Date: Tue Feb 16 16:38:57 2010 New Revision: 203960 URL: http://svn.freebsd.org/changeset/base/203960 Log: Compile fbsd-threads.c. Threading & TLS support is working just fine. Modified: head/gnu/usr.bin/gdb/arch/ia64/Makefile head/gnu/usr.bin/gdb/arch/ia64/init.c Modified: head/gnu/usr.bin/gdb/arch/ia64/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/arch/ia64/Makefile Tue Feb 16 12:43:55 2010 (r203959) +++ head/gnu/usr.bin/gdb/arch/ia64/Makefile Tue Feb 16 16:38:57 2010 (r203960) @@ -1,7 +1,7 @@ # $FreeBSD$ .if !defined(GDB_CROSS_DEBUGGER) -LIBSRCS+= fbsd-proc.c gcore.c +LIBSRCS+= fbsd-proc.c fbsd-threads.c gcore.c LIBSRCS+= ia64-fbsd-nat.c .endif LIBSRCS+= solib.c solib-svr4.c Modified: head/gnu/usr.bin/gdb/arch/ia64/init.c ============================================================================== --- head/gnu/usr.bin/gdb/arch/ia64/init.c Tue Feb 16 12:43:55 2010 (r203959) +++ head/gnu/usr.bin/gdb/arch/ia64/init.c Tue Feb 16 16:38:57 2010 (r203960) @@ -15,6 +15,7 @@ extern initialize_file_ftype _initialize extern initialize_file_ftype _initialize_ser_tcp; extern initialize_file_ftype _initialize_fbsd_proc; extern initialize_file_ftype _initialize_gcore; +extern initialize_file_ftype _initialize_thread_db; extern initialize_file_ftype _initialize_ia64_fbsd_nat; extern initialize_file_ftype _initialize_kernel_u_addr; extern initialize_file_ftype _initialize_infptrace; @@ -127,6 +128,7 @@ initialize_all_files (void) #ifndef CROSS_DEBUGGER _initialize_fbsd_proc (); _initialize_gcore (); + _initialize_thread_db (); _initialize_ia64_fbsd_nat (); _initialize_kernel_u_addr (); _initialize_infptrace (); From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 19:28:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEB0A10656A5; Tue, 16 Feb 2010 19:28:10 +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 BC0498FC33; Tue, 16 Feb 2010 19:28: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 o1GJSA4I013391; Tue, 16 Feb 2010 19:28:10 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GJSAfP013385; Tue, 16 Feb 2010 19:28:10 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002161928.o1GJSAfP013385@svn.freebsd.org> From: Warner Losh Date: Tue, 16 Feb 2010 19:28: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: r203963 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 19:28:10 -0000 Author: imp Date: Tue Feb 16 19:28:10 2010 New Revision: 203963 URL: http://svn.freebsd.org/changeset/base/203963 Log: Remove NetBSD Foundation clauses 3 & 4. They eliminated those clauses last year. Modified: head/include/getopt.h head/include/hesiod.h head/include/nl_types.h head/include/nsswitch.h head/include/wchar.h Modified: head/include/getopt.h ============================================================================== --- head/include/getopt.h Tue Feb 16 19:00:47 2010 (r203962) +++ head/include/getopt.h Tue Feb 16 19:28:10 2010 (r203963) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/include/hesiod.h ============================================================================== --- head/include/hesiod.h Tue Feb 16 19:00:47 2010 (r203962) +++ head/include/hesiod.h Tue Feb 16 19:28:10 2010 (r203963) @@ -14,13 +14,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/include/nl_types.h ============================================================================== --- head/include/nl_types.h Tue Feb 16 19:00:47 2010 (r203962) +++ head/include/nl_types.h Tue Feb 16 19:28:10 2010 (r203963) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/include/nsswitch.h ============================================================================== --- head/include/nsswitch.h Tue Feb 16 19:00:47 2010 (r203962) +++ head/include/nsswitch.h Tue Feb 16 19:28:10 2010 (r203963) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/include/wchar.h ============================================================================== --- head/include/wchar.h Tue Feb 16 19:00:47 2010 (r203962) +++ head/include/wchar.h Tue Feb 16 19:28:10 2010 (r203963) @@ -41,13 +41,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 19:39:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06727106566C; Tue, 16 Feb 2010 19:39:51 +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 E6DC88FC1A; Tue, 16 Feb 2010 19:39: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 o1GJdoo9016024; Tue, 16 Feb 2010 19:39:50 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GJdo5M015979; Tue, 16 Feb 2010 19:39:50 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002161939.o1GJdo5M015979@svn.freebsd.org> From: Warner Losh Date: Tue, 16 Feb 2010 19:39: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: r203964 - head/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 19:39:51 -0000 Author: imp Date: Tue Feb 16 19:39:50 2010 New Revision: 203964 URL: http://svn.freebsd.org/changeset/base/203964 Log: Remove the Berkeley clause 3's. Add a few $FreeBSD$ Modified: head/include/_ctype.h head/include/a.out.h head/include/ar.h head/include/assert.h head/include/ctype.h head/include/db.h head/include/dirent.h head/include/dlfcn.h head/include/err.h head/include/fnmatch.h head/include/fstab.h head/include/fts.h head/include/glob.h head/include/grp.h head/include/limits.h head/include/locale.h head/include/memory.h head/include/mpool.h head/include/ndbm.h head/include/netdb.h head/include/nlist.h head/include/paths.h head/include/pwd.h head/include/ranlib.h head/include/regex.h head/include/regexp.h head/include/resolv.h head/include/runetype.h head/include/setjmp.h head/include/signal.h head/include/stab.h head/include/stddef.h head/include/stdio.h head/include/stdlib.h head/include/string.h head/include/sysexits.h head/include/tar.h head/include/termios.h head/include/time.h head/include/timeconv.h head/include/ttyent.h head/include/unistd.h head/include/utime.h head/include/vis.h Modified: head/include/_ctype.h ============================================================================== --- head/include/_ctype.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/_ctype.h Tue Feb 16 19:39:50 2010 (r203964) @@ -18,11 +18,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/a.out.h ============================================================================== --- head/include/a.out.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/a.out.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/ar.h ============================================================================== --- head/include/ar.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/ar.h Tue Feb 16 19:39:50 2010 (r203964) @@ -18,11 +18,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/assert.h ============================================================================== --- head/include/assert.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/assert.h Tue Feb 16 19:39:50 2010 (r203964) @@ -15,11 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/ctype.h ============================================================================== --- head/include/ctype.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/ctype.h Tue Feb 16 19:39:50 2010 (r203964) @@ -18,11 +18,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/db.h ============================================================================== --- head/include/db.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/db.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/dirent.h ============================================================================== --- head/include/dirent.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/dirent.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/dlfcn.h ============================================================================== --- head/include/dlfcn.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/dlfcn.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/err.h ============================================================================== --- head/include/err.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/err.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/fnmatch.h ============================================================================== --- head/include/fnmatch.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/fnmatch.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/fstab.h ============================================================================== --- head/include/fstab.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/fstab.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/fts.h ============================================================================== --- head/include/fts.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/fts.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/glob.h ============================================================================== --- head/include/glob.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/glob.h Tue Feb 16 19:39:50 2010 (r203964) @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/grp.h ============================================================================== --- head/include/grp.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/grp.h Tue Feb 16 19:39:50 2010 (r203964) @@ -15,11 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/limits.h ============================================================================== --- head/include/limits.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/limits.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/locale.h ============================================================================== --- head/include/locale.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/locale.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/memory.h ============================================================================== --- head/include/memory.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/memory.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,6 +27,8 @@ * SUCH DAMAGE. * * @(#)memory.h 8.1 (Berkeley) 6/2/93 + * + * $FreeBSD$ */ #include Modified: head/include/mpool.h ============================================================================== --- head/include/mpool.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/mpool.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/ndbm.h ============================================================================== --- head/include/ndbm.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/ndbm.h Tue Feb 16 19:39:50 2010 (r203964) @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/netdb.h ============================================================================== --- head/include/netdb.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/netdb.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/nlist.h ============================================================================== --- head/include/nlist.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/nlist.h Tue Feb 16 19:39:50 2010 (r203964) @@ -15,11 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/paths.h ============================================================================== --- head/include/paths.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/paths.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/pwd.h ============================================================================== --- head/include/pwd.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/pwd.h Tue Feb 16 19:39:50 2010 (r203964) @@ -15,11 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/ranlib.h ============================================================================== --- head/include/ranlib.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/ranlib.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,6 +27,8 @@ * SUCH DAMAGE. * * @(#)ranlib.h 8.1 (Berkeley) 6/2/93 + * + * $FreeBSD$ */ #ifndef _RANLIB_H_ Modified: head/include/regex.h ============================================================================== --- head/include/regex.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/regex.h Tue Feb 16 19:39:50 2010 (r203964) @@ -14,11 +14,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/regexp.h ============================================================================== --- head/include/regexp.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/regexp.h Tue Feb 16 19:39:50 2010 (r203964) @@ -14,11 +14,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/resolv.h ============================================================================== --- head/include/resolv.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/resolv.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/runetype.h ============================================================================== --- head/include/runetype.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/runetype.h Tue Feb 16 19:39:50 2010 (r203964) @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/setjmp.h ============================================================================== --- head/include/setjmp.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/setjmp.h Tue Feb 16 19:39:50 2010 (r203964) @@ -15,11 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/signal.h ============================================================================== --- head/include/signal.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/signal.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/stab.h ============================================================================== --- head/include/stab.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/stab.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,6 +27,8 @@ * SUCH DAMAGE. * * @(#)stab.h 8.1 (Berkeley) 6/2/93 + * + * $FreeBSD$ */ #ifndef _STAB_H_ Modified: head/include/stddef.h ============================================================================== --- head/include/stddef.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/stddef.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/stdio.h Tue Feb 16 19:39:50 2010 (r203964) @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/stdlib.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/string.h ============================================================================== --- head/include/string.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/string.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/sysexits.h ============================================================================== --- head/include/sysexits.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/sysexits.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,6 +27,8 @@ * SUCH DAMAGE. * * @(#)sysexits.h 8.1 (Berkeley) 6/2/93 + * + * $FreeBSD$ */ #ifndef _SYSEXITS_H_ Modified: head/include/tar.h ============================================================================== --- head/include/tar.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/tar.h Tue Feb 16 19:39:50 2010 (r203964) @@ -13,11 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -34,6 +30,8 @@ * SUCH DAMAGE. * * @(#)tar.h 8.2 (Berkeley) 1/4/94 + * + * $FreeBSD$ */ #ifndef _TAR_H Modified: head/include/termios.h ============================================================================== --- head/include/termios.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/termios.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/time.h ============================================================================== --- head/include/time.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/time.h Tue Feb 16 19:39:50 2010 (r203964) @@ -15,11 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/timeconv.h ============================================================================== --- head/include/timeconv.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/timeconv.h Tue Feb 16 19:39:50 2010 (r203964) @@ -15,11 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/ttyent.h ============================================================================== --- head/include/ttyent.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/ttyent.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/unistd.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/utime.h ============================================================================== --- head/include/utime.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/utime.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/vis.h ============================================================================== --- head/include/vis.h Tue Feb 16 19:28:10 2010 (r203963) +++ head/include/vis.h Tue Feb 16 19:39:50 2010 (r203964) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 19:46:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C83471065679; Tue, 16 Feb 2010 19:46:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B467E8FC19; Tue, 16 Feb 2010 19:46: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 o1GJkkUA017651; Tue, 16 Feb 2010 19:46:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GJkkS6017639; Tue, 16 Feb 2010 19:46:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002161946.o1GJkkS6017639@svn.freebsd.org> From: Warner Losh Date: Tue, 16 Feb 2010 19:46: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: r203965 - in head/include: arpa protocols X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 19:46:47 -0000 Author: imp Date: Tue Feb 16 19:46:46 2010 New Revision: 203965 URL: http://svn.freebsd.org/changeset/base/203965 Log: Remove clause 3 from Berkeley copyrights. Add a few $FreeBSD$'s. Modified: head/include/arpa/ftp.h head/include/arpa/inet.h head/include/arpa/nameser.h head/include/arpa/nameser_compat.h head/include/arpa/telnet.h head/include/arpa/tftp.h head/include/protocols/dumprestore.h head/include/protocols/routed.h head/include/protocols/rwhod.h head/include/protocols/talkd.h head/include/protocols/timed.h Modified: head/include/arpa/ftp.h ============================================================================== --- head/include/arpa/ftp.h Tue Feb 16 19:39:50 2010 (r203964) +++ head/include/arpa/ftp.h Tue Feb 16 19:46:46 2010 (r203965) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,6 +27,8 @@ * SUCH DAMAGE. * * @(#)ftp.h 8.1 (Berkeley) 6/2/93 + * + * $FreeBSD$ */ #ifndef _ARPA_FTP_H_ Modified: head/include/arpa/inet.h ============================================================================== --- head/include/arpa/inet.h Tue Feb 16 19:39:50 2010 (r203964) +++ head/include/arpa/inet.h Tue Feb 16 19:46:46 2010 (r203965) @@ -12,11 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/arpa/nameser.h ============================================================================== --- head/include/arpa/nameser.h Tue Feb 16 19:39:50 2010 (r203964) +++ head/include/arpa/nameser.h Tue Feb 16 19:46:46 2010 (r203965) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/arpa/nameser_compat.h ============================================================================== --- head/include/arpa/nameser_compat.h Tue Feb 16 19:39:50 2010 (r203964) +++ head/include/arpa/nameser_compat.h Tue Feb 16 19:46:46 2010 (r203965) @@ -9,11 +9,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/arpa/telnet.h ============================================================================== --- head/include/arpa/telnet.h Tue Feb 16 19:39:50 2010 (r203964) +++ head/include/arpa/telnet.h Tue Feb 16 19:46:46 2010 (r203965) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/arpa/tftp.h ============================================================================== --- head/include/arpa/tftp.h Tue Feb 16 19:39:50 2010 (r203964) +++ head/include/arpa/tftp.h Tue Feb 16 19:46:46 2010 (r203965) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/protocols/dumprestore.h ============================================================================== --- head/include/protocols/dumprestore.h Tue Feb 16 19:39:50 2010 (r203964) +++ head/include/protocols/dumprestore.h Tue Feb 16 19:46:46 2010 (r203965) @@ -15,11 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/protocols/routed.h ============================================================================== --- head/include/protocols/routed.h Tue Feb 16 19:39:50 2010 (r203964) +++ head/include/protocols/routed.h Tue Feb 16 19:46:46 2010 (r203965) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgment: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/include/protocols/rwhod.h ============================================================================== --- head/include/protocols/rwhod.h Tue Feb 16 19:39:50 2010 (r203964) +++ head/include/protocols/rwhod.h Tue Feb 16 19:46:46 2010 (r203965) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,6 +27,8 @@ * SUCH DAMAGE. * * @(#)rwhod.h 8.1 (Berkeley) 6/2/93 + * + * $FreeBSD$ */ #ifndef _PROTOCOLS_RWHOD_H_ Modified: head/include/protocols/talkd.h ============================================================================== --- head/include/protocols/talkd.h Tue Feb 16 19:39:50 2010 (r203964) +++ head/include/protocols/talkd.h Tue Feb 16 19:46:46 2010 (r203965) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,6 +27,8 @@ * SUCH DAMAGE. * * @(#)talkd.h 8.1 (Berkeley) 6/2/93 + * + * $FreeBSD$ */ #ifndef _PROTOCOLS_TALKD_H_ Modified: head/include/protocols/timed.h ============================================================================== --- head/include/protocols/timed.h Tue Feb 16 19:39:50 2010 (r203964) +++ head/include/protocols/timed.h Tue Feb 16 19:46:46 2010 (r203965) @@ -10,11 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 19:59:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A7F8106568F; Tue, 16 Feb 2010 19:59: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 67C058FC1B; Tue, 16 Feb 2010 19:59: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 o1GJxAnF020366; Tue, 16 Feb 2010 19:59:10 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GJxArP020364; Tue, 16 Feb 2010 19:59:10 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201002161959.o1GJxArP020364@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 16 Feb 2010 19:59: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: r203966 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 19:59:10 -0000 Author: jh Date: Tue Feb 16 19:59:10 2010 New Revision: 203966 URL: http://svn.freebsd.org/changeset/base/203966 Log: Improve descriptions for tmpfs mount options. The descriptions have been mostly obtained from NetBSD mount_tmpfs(8) manual page. Obtained from: NetBSD Discussed with: delphij Modified: head/share/man/man5/tmpfs.5 Modified: head/share/man/man5/tmpfs.5 ============================================================================== --- head/share/man/man5/tmpfs.5 Tue Feb 16 19:46:46 2010 (r203965) +++ head/share/man/man5/tmpfs.5 Tue Feb 16 19:59:10 2010 (r203966) @@ -1,4 +1,4 @@ -.\" +.\"- .\" Copyright (c) 2007 Xin LI .\" All rights reserved. .\" @@ -22,9 +22,34 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" +.\"- +.\" Copyright (c) 2005, 2006 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" .\" $FreeBSD$ .\" -.Dd January 29, 2010 +.Dd February 16, 2010 .Dt TMPFS 5 .Os .Sh NAME @@ -59,17 +84,28 @@ mounting file systems: .Bl -tag -width indent .It Cm gid -root group id. +Specifies the group ID of the root inode of the file system. +Defaults to the mount point's GID. .It Cm uid -root user id. +Specifies the user ID of the root inode of the file system. +Defaults to the mount point's UID. .It Cm mode -permissions in octal format. +Specifies the mode (in octal notation) of the root inode of the file system. +Defaults to the mount point's mode. .It Cm inodes -maximum number of inodes. +Specifies the maximum number of nodes available to the file system. +If not specified, the file system chooses a reasonable maximum based on +the file system size, which can be limited with the +.Cm size +option. .It Cm size -maximum size (in bytes) for the file system. +Specifies the total file system size in bytes. +If zero (the default) or a value larger than SIZE_MAX - PAGE_SIZE +is given, the available amount of memory (including +main memory and swap space) will be used. .It Cm maxfilesize -maximum file size (in bytes). +Specifies the maximum file size in bytes. +Defaults to the maximum possible value. .El .Sh EXAMPLES To mount a From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 20:00:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A836E10656A9; Tue, 16 Feb 2010 20:00:20 +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 7CEA18FC1B; Tue, 16 Feb 2010 20:00: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 o1GK0KP6020723; Tue, 16 Feb 2010 20:00:20 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GK0KgX020720; Tue, 16 Feb 2010 20:00:20 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201002162000.o1GK0KgX020720@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 16 Feb 2010 20:00: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: r203967 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 20:00:20 -0000 Author: jh Date: Tue Feb 16 20:00:20 2010 New Revision: 203967 URL: http://svn.freebsd.org/changeset/base/203967 Log: Xref mdmfs(8). Modified: head/share/man/man5/tmpfs.5 Modified: head/share/man/man5/tmpfs.5 ============================================================================== --- head/share/man/man5/tmpfs.5 Tue Feb 16 19:59:10 2010 (r203966) +++ head/share/man/man5/tmpfs.5 Tue Feb 16 20:00:20 2010 (r203967) @@ -117,6 +117,7 @@ memory file system: .Xr nmount 2 , .Xr unmount 2 , .Xr fstab 5 , +.Xr mdmfs 8 , .Xr mount 8 .Sh HISTORY The From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 20:00:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73BEB1065693; Tue, 16 Feb 2010 20:00:21 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FA588FC22; Tue, 16 Feb 2010 20:00: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 o1GK0L69020751; Tue, 16 Feb 2010 20:00:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GK0Lhb020744; Tue, 16 Feb 2010 20:00:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002162000.o1GK0Lhb020744@svn.freebsd.org> From: Marius Strobl Date: Tue, 16 Feb 2010 20:00: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: r203968 - in head/sys: modules/nfs_common modules/nfsclient modules/nfsserver nfs nfsclient nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 20:00:21 -0000 Author: marius Date: Tue Feb 16 20:00:21 2010 New Revision: 203968 URL: http://svn.freebsd.org/changeset/base/203968 Log: Factor out the code shared between NFS client and server into its own module. With r203732 it became apparent that creating the sysctl nodes twice causes at least a warning, however the whole code shouldn't be present twice in the first place. Discussed with: rmacklem Added: head/sys/modules/nfs_common/ head/sys/modules/nfs_common/Makefile (contents, props changed) Modified: head/sys/modules/nfsclient/Makefile head/sys/modules/nfsserver/Makefile head/sys/nfs/nfs_common.c head/sys/nfsclient/nfs_vfsops.c head/sys/nfsserver/nfs_srvsubs.c Added: head/sys/modules/nfs_common/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/nfs_common/Makefile Tue Feb 16 20:00:21 2010 (r203968) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../nfs + +KMOD= nfs_common +SRCS= nfs_common.c opt_nfs.h vnode_if.h + +.include Modified: head/sys/modules/nfsclient/Makefile ============================================================================== --- head/sys/modules/nfsclient/Makefile Tue Feb 16 20:00:20 2010 (r203967) +++ head/sys/modules/nfsclient/Makefile Tue Feb 16 20:00:21 2010 (r203968) @@ -1,11 +1,11 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../nfsclient ${.CURDIR}/../../nfs ${.CURDIR}/../../rpc +.PATH: ${.CURDIR}/../../nfsclient ${.CURDIR}/../../rpc KMOD= nfsclient SRCS= vnode_if.h \ nfs_bio.c nfs_lock.c nfs_node.c nfs_subs.c nfs_nfsiod.c \ - nfs_vfsops.c nfs_vnops.c nfs_common.c nfs_krpc.c \ + nfs_vfsops.c nfs_vnops.c nfs_krpc.c \ opt_inet.h opt_nfs.h opt_bootp.h opt_nfsroot.h SRCS+= opt_inet6.h opt_kdtrace.h opt_kgssapi.h Modified: head/sys/modules/nfsserver/Makefile ============================================================================== --- head/sys/modules/nfsserver/Makefile Tue Feb 16 20:00:20 2010 (r203967) +++ head/sys/modules/nfsserver/Makefile Tue Feb 16 20:00:21 2010 (r203968) @@ -1,9 +1,9 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../nfsserver ${.CURDIR}/../../nfs +.PATH: ${.CURDIR}/../../nfsserver KMOD= nfsserver SRCS= vnode_if.h \ - nfs_fha.c nfs_serv.c nfs_srvkrpc.c nfs_srvsubs.c nfs_common.c \ + nfs_fha.c nfs_serv.c nfs_srvkrpc.c nfs_srvsubs.c \ opt_mac.h \ opt_kgssapi.h \ opt_nfs.h Modified: head/sys/nfs/nfs_common.c ============================================================================== --- head/sys/nfs/nfs_common.c Tue Feb 16 20:00:20 2010 (r203967) +++ head/sys/nfs/nfs_common.c Tue Feb 16 20:00:21 2010 (r203968) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -79,15 +80,15 @@ nfstype nfsv3_type[9] = { static void *nfsm_dissect_xx_sub(int s, struct mbuf **md, caddr_t *dpos, int how); -SYSCTL_DECL(_vfs_nfs); +SYSCTL_NODE(_vfs, OID_AUTO, nfs_common, CTLFLAG_RD, 0, "NFS common support"); static int nfs_realign_test; -SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_test, CTLFLAG_RD, &nfs_realign_test, - 0, "Number of realign tests done"); +SYSCTL_INT(_vfs_nfs_common, OID_AUTO, realign_test, CTLFLAG_RD, + &nfs_realign_test, 0, "Number of realign tests done"); static int nfs_realign_count; -SYSCTL_INT(_vfs_nfs, OID_AUTO, realign_count, CTLFLAG_RD, &nfs_realign_count, - 0, "Number of mbuf realignments done"); +SYSCTL_INT(_vfs_nfs_common, OID_AUTO, realign_count, CTLFLAG_RD, + &nfs_realign_count, 0, "Number of mbuf realignments done"); u_quad_t nfs_curusec(void) @@ -404,3 +405,12 @@ nfs_realign(struct mbuf **pm, int how) } return (0); } + +static moduledata_t nfs_common_mod = { + "nfs_common", + NULL, + NULL +}; + +DECLARE_MODULE(nfs_common, nfs_common_mod, SI_SUB_VFS, SI_ORDER_ANY); +MODULE_VERSION(nfs_common, 1); Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Tue Feb 16 20:00:20 2010 (r203967) +++ head/sys/nfsclient/nfs_vfsops.c Tue Feb 16 20:00:21 2010 (r203968) @@ -147,6 +147,7 @@ MODULE_DEPEND(nfs, krpc, 1, 1, 1); #ifdef KGSSAPI MODULE_DEPEND(nfs, kgssapi, 1, 1, 1); #endif +MODULE_DEPEND(nfs, nfs_common, 1, 1, 1); static struct nfs_rpcops nfs_rpcops = { nfs_readrpc, Modified: head/sys/nfsserver/nfs_srvsubs.c ============================================================================== --- head/sys/nfsserver/nfs_srvsubs.c Tue Feb 16 20:00:20 2010 (r203967) +++ head/sys/nfsserver/nfs_srvsubs.c Tue Feb 16 20:00:21 2010 (r203968) @@ -560,6 +560,7 @@ DECLARE_MODULE(nfsserver, nfsserver_mod, MODULE_VERSION(nfsserver, 1); MODULE_DEPEND(nfsserver, nfssvc, 1, 1, 1); MODULE_DEPEND(nfsserver, krpc, 1, 1, 1); +MODULE_DEPEND(nfsserver, nfs_common, 1, 1, 1); /* * Set up nameidata for a lookup() call and do it. From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 20:46:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 590421065692; Tue, 16 Feb 2010 20:46:23 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 471F58FC0C; Tue, 16 Feb 2010 20:46: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 o1GKkNZd030872; Tue, 16 Feb 2010 20:46:23 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GKkNra030870; Tue, 16 Feb 2010 20:46:23 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002162046.o1GKkNra030870@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 16 Feb 2010 20:46: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: r203969 - head/lib/libc/stdlib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 20:46:23 -0000 Author: marcel Date: Tue Feb 16 20:46:22 2010 New Revision: 203969 URL: http://svn.freebsd.org/changeset/base/203969 Log: Define TLS_MODEL for PowerPC as well. Since PowerPC uses variant I, like ia64, leave it empty (default model). Modified: head/lib/libc/stdlib/malloc.c Modified: head/lib/libc/stdlib/malloc.c ============================================================================== --- head/lib/libc/stdlib/malloc.c Tue Feb 16 20:00:21 2010 (r203968) +++ head/lib/libc/stdlib/malloc.c Tue Feb 16 20:46:22 2010 (r203969) @@ -250,6 +250,7 @@ __FBSDID("$FreeBSD$"); #endif #ifdef __powerpc__ # define LG_QUANTUM 4 +# define TLS_MODEL /* default */ #endif #ifdef __s390x__ # define LG_QUANTUM 4 From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 21:39:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A05701065695; Tue, 16 Feb 2010 21:39:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 900D18FC2C; Tue, 16 Feb 2010 21:39: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 o1GLdKTt042680; Tue, 16 Feb 2010 21:39:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GLdKqO042678; Tue, 16 Feb 2010 21:39:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002162139.o1GLdKqO042678@svn.freebsd.org> From: Warner Losh Date: Tue, 16 Feb 2010 21:39: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: r203970 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 21:39:20 -0000 Author: imp Date: Tue Feb 16 21:39:20 2010 New Revision: 203970 URL: http://svn.freebsd.org/changeset/base/203970 Log: The NetBSD Foundation has granted permission for people to remove clause 3 and 4 from their software. Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Tue Feb 16 20:46:22 2010 (r203969) +++ head/sbin/ifconfig/ifieee80211.c Tue Feb 16 21:39:20 2010 (r203970) @@ -43,13 +43,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 21:43:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AD94106566B; Tue, 16 Feb 2010 21:43:58 +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 2793C8FC14; Tue, 16 Feb 2010 21:43: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 o1GLhwJ6043761; Tue, 16 Feb 2010 21:43:58 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GLhvxg043748; Tue, 16 Feb 2010 21:43:57 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002162143.o1GLhvxg043748@svn.freebsd.org> From: Warner Losh Date: Tue, 16 Feb 2010 21:43: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: r203971 - in head/usr.bin: gencat getent nl stat usbhidaction usbhidctl xlint/lint1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 21:43:58 -0000 Author: imp Date: Tue Feb 16 21:43:57 2010 New Revision: 203971 URL: http://svn.freebsd.org/changeset/base/203971 Log: The NetBSD Foundation has granted permission to remove clause 3 and 4 from their software. Obtained from: NetBSD Modified: head/usr.bin/gencat/gencat.c head/usr.bin/getent/getent.1 head/usr.bin/getent/getent.c head/usr.bin/nl/nl.1 head/usr.bin/nl/nl.c head/usr.bin/stat/stat.1 head/usr.bin/stat/stat.c head/usr.bin/usbhidaction/usbhidaction.1 head/usr.bin/usbhidaction/usbhidaction.c head/usr.bin/usbhidctl/usbhid.c head/usr.bin/usbhidctl/usbhidctl.1 head/usr.bin/xlint/lint1/makeman Modified: head/usr.bin/gencat/gencat.c ============================================================================== --- head/usr.bin/gencat/gencat.c Tue Feb 16 21:39:20 2010 (r203970) +++ head/usr.bin/gencat/gencat.c Tue Feb 16 21:43:57 2010 (r203971) @@ -18,13 +18,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.bin/getent/getent.1 ============================================================================== --- head/usr.bin/getent/getent.1 Tue Feb 16 21:39:20 2010 (r203970) +++ head/usr.bin/getent/getent.1 Tue Feb 16 21:43:57 2010 (r203971) @@ -14,13 +14,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.bin/getent/getent.c ============================================================================== --- head/usr.bin/getent/getent.c Tue Feb 16 21:39:20 2010 (r203970) +++ head/usr.bin/getent/getent.c Tue Feb 16 21:43:57 2010 (r203971) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.bin/nl/nl.1 ============================================================================== --- head/usr.bin/nl/nl.1 Tue Feb 16 21:39:20 2010 (r203970) +++ head/usr.bin/nl/nl.1 Tue Feb 16 21:43:57 2010 (r203971) @@ -14,13 +14,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.bin/nl/nl.c ============================================================================== --- head/usr.bin/nl/nl.c Tue Feb 16 21:39:20 2010 (r203970) +++ head/usr.bin/nl/nl.c Tue Feb 16 21:43:57 2010 (r203971) @@ -13,13 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.bin/stat/stat.1 ============================================================================== --- head/usr.bin/stat/stat.1 Tue Feb 16 21:39:20 2010 (r203970) +++ head/usr.bin/stat/stat.1 Tue Feb 16 21:43:57 2010 (r203971) @@ -14,13 +14,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Tue Feb 16 21:39:20 2010 (r203970) +++ head/usr.bin/stat/stat.c Tue Feb 16 21:43:57 2010 (r203971) @@ -13,13 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.bin/usbhidaction/usbhidaction.1 ============================================================================== --- head/usr.bin/usbhidaction/usbhidaction.1 Tue Feb 16 21:39:20 2010 (r203970) +++ head/usr.bin/usbhidaction/usbhidaction.1 Tue Feb 16 21:43:57 2010 (r203971) @@ -15,13 +15,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.bin/usbhidaction/usbhidaction.c ============================================================================== --- head/usr.bin/usbhidaction/usbhidaction.c Tue Feb 16 21:39:20 2010 (r203970) +++ head/usr.bin/usbhidaction/usbhidaction.c Tue Feb 16 21:43:57 2010 (r203971) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.bin/usbhidctl/usbhid.c ============================================================================== --- head/usr.bin/usbhidctl/usbhid.c Tue Feb 16 21:39:20 2010 (r203970) +++ head/usr.bin/usbhidctl/usbhid.c Tue Feb 16 21:43:57 2010 (r203971) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.bin/usbhidctl/usbhidctl.1 ============================================================================== --- head/usr.bin/usbhidctl/usbhidctl.1 Tue Feb 16 21:39:20 2010 (r203970) +++ head/usr.bin/usbhidctl/usbhidctl.1 Tue Feb 16 21:43:57 2010 (r203971) @@ -15,13 +15,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.bin/xlint/lint1/makeman ============================================================================== --- head/usr.bin/xlint/lint1/makeman Tue Feb 16 21:39:20 2010 (r203970) +++ head/usr.bin/xlint/lint1/makeman Tue Feb 16 21:43:57 2010 (r203971) @@ -15,13 +15,6 @@ # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. -# 3. All advertising materials mentioning features or use of this software -# must display the following acknowledgement: -# This product includes software developed by the NetBSD -# Foundation, Inc. and its contributors. -# 4. Neither the name of The NetBSD Foundation nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 21:47:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 152CA106566B; Tue, 16 Feb 2010 21:47:06 +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 02EBA8FC0C; Tue, 16 Feb 2010 21:47: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 o1GLl56u044502; Tue, 16 Feb 2010 21:47:05 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GLl5LP044492; Tue, 16 Feb 2010 21:47:05 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002162147.o1GLl5LP044492@svn.freebsd.org> From: Warner Losh Date: Tue, 16 Feb 2010 21:47: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: r203972 - in head/usr.sbin: eeprom makefs makefs/compat rpcbind usbdevs yppoll X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 21:47:06 -0000 Author: imp Date: Tue Feb 16 21:47:05 2010 New Revision: 203972 URL: http://svn.freebsd.org/changeset/base/203972 Log: The NetBSD Foundation has given permission to remove clause 3 and 4 from their liceense. Obtained from: NetBSD Modified: head/usr.sbin/eeprom/eeprom.8 head/usr.sbin/eeprom/eeprom.c head/usr.sbin/makefs/compat/pwcache.c head/usr.sbin/makefs/compat/strsuftoll.c head/usr.sbin/makefs/getid.c head/usr.sbin/rpcbind/util.c head/usr.sbin/usbdevs/usbdevs.8 head/usr.sbin/usbdevs/usbdevs.c head/usr.sbin/yppoll/yppoll.8 Modified: head/usr.sbin/eeprom/eeprom.8 ============================================================================== --- head/usr.sbin/eeprom/eeprom.8 Tue Feb 16 21:43:57 2010 (r203971) +++ head/usr.sbin/eeprom/eeprom.8 Tue Feb 16 21:47:05 2010 (r203972) @@ -13,13 +13,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.sbin/eeprom/eeprom.c ============================================================================== --- head/usr.sbin/eeprom/eeprom.c Tue Feb 16 21:43:57 2010 (r203971) +++ head/usr.sbin/eeprom/eeprom.c Tue Feb 16 21:47:05 2010 (r203972) @@ -13,13 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.sbin/makefs/compat/pwcache.c ============================================================================== --- head/usr.sbin/makefs/compat/pwcache.c Tue Feb 16 21:43:57 2010 (r203971) +++ head/usr.sbin/makefs/compat/pwcache.c Tue Feb 16 21:47:05 2010 (r203972) @@ -45,13 +45,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.sbin/makefs/compat/strsuftoll.c ============================================================================== --- head/usr.sbin/makefs/compat/strsuftoll.c Tue Feb 16 21:43:57 2010 (r203971) +++ head/usr.sbin/makefs/compat/strsuftoll.c Tue Feb 16 21:47:05 2010 (r203972) @@ -14,13 +14,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.sbin/makefs/getid.c ============================================================================== --- head/usr.sbin/makefs/getid.c Tue Feb 16 21:43:57 2010 (r203971) +++ head/usr.sbin/makefs/getid.c Tue Feb 16 21:47:05 2010 (r203972) @@ -46,13 +46,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.sbin/rpcbind/util.c ============================================================================== --- head/usr.sbin/rpcbind/util.c Tue Feb 16 21:43:57 2010 (r203971) +++ head/usr.sbin/rpcbind/util.c Tue Feb 16 21:47:05 2010 (r203972) @@ -18,13 +18,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -185,6 +178,8 @@ addrmerge(struct netbuf *caller, char *s if (ifsa == NULL || ifsa->sa_family != hint_sa->sa_family || !(ifap->ifa_flags & IFF_UP)) continue; + if (!addr_is_bound(ifsa)) + continue; if (!(ifap->ifa_flags & IFF_LOOPBACK) && !listen_addr(ifsa)) continue; Modified: head/usr.sbin/usbdevs/usbdevs.8 ============================================================================== --- head/usr.sbin/usbdevs/usbdevs.8 Tue Feb 16 21:43:57 2010 (r203971) +++ head/usr.sbin/usbdevs/usbdevs.8 Tue Feb 16 21:47:05 2010 (r203972) @@ -12,13 +12,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.sbin/usbdevs/usbdevs.c ============================================================================== --- head/usr.sbin/usbdevs/usbdevs.c Tue Feb 16 21:43:57 2010 (r203971) +++ head/usr.sbin/usbdevs/usbdevs.c Tue Feb 16 21:47:05 2010 (r203972) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/usr.sbin/yppoll/yppoll.8 ============================================================================== --- head/usr.sbin/yppoll/yppoll.8 Tue Feb 16 21:43:57 2010 (r203971) +++ head/usr.sbin/yppoll/yppoll.8 Tue Feb 16 21:47:05 2010 (r203972) @@ -12,13 +12,6 @@ .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. -.\" 3. All advertising materials mentioning features or use of this software -.\" must display the following acknowledgement: -.\" This product includes software developed by the NetBSD -.\" Foundation, Inc. and its contributors. -.\" 4. Neither the name of The NetBSD Foundation nor the names of its -.\" contributors may be used to endorse or promote products derived -.\" from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 21:49:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2AB61065670; Tue, 16 Feb 2010 21:49:36 +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 E2C368FC19; Tue, 16 Feb 2010 21:49: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 o1GLnaOX045062; Tue, 16 Feb 2010 21:49:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GLnaDY045060; Tue, 16 Feb 2010 21:49:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002162149.o1GLnaDY045060@svn.freebsd.org> From: Warner Losh Date: Tue, 16 Feb 2010 21:49: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: r203973 - head/libexec/rtld-elf/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 21:49:37 -0000 Author: imp Date: Tue Feb 16 21:49:36 2010 New Revision: 203973 URL: http://svn.freebsd.org/changeset/base/203973 Log: The NetBSD Foundation has granted permission to remove clauses 3 and 4. Obtained from: NetBSD Modified: head/libexec/rtld-elf/arm/rtld_start.S Modified: head/libexec/rtld-elf/arm/rtld_start.S ============================================================================== --- head/libexec/rtld-elf/arm/rtld_start.S Tue Feb 16 21:47:05 2010 (r203972) +++ head/libexec/rtld-elf/arm/rtld_start.S Tue Feb 16 21:49:36 2010 (r203973) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 21:59:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F6411065695; Tue, 16 Feb 2010 21:59:18 +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 1DF1D8FC14; Tue, 16 Feb 2010 21:59: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 o1GLxHXf047266; Tue, 16 Feb 2010 21:59:17 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GLxH5p047249; Tue, 16 Feb 2010 21:59:17 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002162159.o1GLxH5p047249@svn.freebsd.org> From: Warner Losh Date: Tue, 16 Feb 2010 21:59: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: r203974 - in head/sys/arm: arm include sa11x0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 21:59:19 -0000 Author: imp Date: Tue Feb 16 21:59:17 2010 New Revision: 203974 URL: http://svn.freebsd.org/changeset/base/203974 Log: The NetBSD Foundation has granted permission to remove clauses 3 and 4. Obtained from: NetBSD Modified: head/sys/arm/arm/pmap.c head/sys/arm/arm/support.S head/sys/arm/include/_inttypes.h head/sys/arm/include/_stdint.h head/sys/arm/include/bus.h head/sys/arm/include/bus_dma.h head/sys/arm/include/ucontext.h head/sys/arm/sa11x0/sa11x0.c head/sys/arm/sa11x0/sa11x0_dmacreg.h head/sys/arm/sa11x0/sa11x0_gpioreg.h head/sys/arm/sa11x0/sa11x0_irq.S head/sys/arm/sa11x0/sa11x0_irqhandler.c head/sys/arm/sa11x0/sa11x0_ostreg.h head/sys/arm/sa11x0/sa11x0_ppcreg.h head/sys/arm/sa11x0/sa11x0_reg.h head/sys/arm/sa11x0/sa11x0_var.h Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Tue Feb 16 21:49:36 2010 (r203973) +++ head/sys/arm/arm/pmap.c Tue Feb 16 21:59:17 2010 (r203974) @@ -77,13 +77,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/arm/arm/support.S ============================================================================== --- head/sys/arm/arm/support.S Tue Feb 16 21:49:36 2010 (r203973) +++ head/sys/arm/arm/support.S Tue Feb 16 21:59:17 2010 (r203974) @@ -72,13 +72,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/arm/include/_inttypes.h ============================================================================== --- head/sys/arm/include/_inttypes.h Tue Feb 16 21:49:36 2010 (r203973) +++ head/sys/arm/include/_inttypes.h Tue Feb 16 21:59:17 2010 (r203974) @@ -13,13 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/arm/include/_stdint.h ============================================================================== --- head/sys/arm/include/_stdint.h Tue Feb 16 21:49:36 2010 (r203973) +++ head/sys/arm/include/_stdint.h Tue Feb 16 21:59:17 2010 (r203974) @@ -14,13 +14,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/arm/include/bus.h ============================================================================== --- head/sys/arm/include/bus.h Tue Feb 16 21:49:36 2010 (r203973) +++ head/sys/arm/include/bus.h Tue Feb 16 21:59:17 2010 (r203974) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/arm/include/bus_dma.h ============================================================================== --- head/sys/arm/include/bus_dma.h Tue Feb 16 21:49:36 2010 (r203973) +++ head/sys/arm/include/bus_dma.h Tue Feb 16 21:59:17 2010 (r203974) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/arm/include/ucontext.h ============================================================================== --- head/sys/arm/include/ucontext.h Tue Feb 16 21:49:36 2010 (r203973) +++ head/sys/arm/include/ucontext.h Tue Feb 16 21:59:17 2010 (r203974) @@ -15,13 +15,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/arm/sa11x0/sa11x0.c ============================================================================== --- head/sys/arm/sa11x0/sa11x0.c Tue Feb 16 21:49:36 2010 (r203973) +++ head/sys/arm/sa11x0/sa11x0.c Tue Feb 16 21:59:17 2010 (r203974) @@ -14,13 +14,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. */ /*- * Copyright (c) 1999 Modified: head/sys/arm/sa11x0/sa11x0_dmacreg.h ============================================================================== --- head/sys/arm/sa11x0/sa11x0_dmacreg.h Tue Feb 16 21:49:36 2010 (r203973) +++ head/sys/arm/sa11x0/sa11x0_dmacreg.h Tue Feb 16 21:59:17 2010 (r203974) @@ -14,13 +14,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/arm/sa11x0/sa11x0_gpioreg.h ============================================================================== --- head/sys/arm/sa11x0/sa11x0_gpioreg.h Tue Feb 16 21:49:36 2010 (r203973) +++ head/sys/arm/sa11x0/sa11x0_gpioreg.h Tue Feb 16 21:59:17 2010 (r203974) @@ -14,13 +14,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/arm/sa11x0/sa11x0_irq.S ============================================================================== --- head/sys/arm/sa11x0/sa11x0_irq.S Tue Feb 16 21:49:36 2010 (r203973) +++ head/sys/arm/sa11x0/sa11x0_irq.S Tue Feb 16 21:59:17 2010 (r203974) @@ -16,13 +16,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Mark Brinicombe - * for the NetBSD Project. - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF Modified: head/sys/arm/sa11x0/sa11x0_irqhandler.c ============================================================================== --- head/sys/arm/sa11x0/sa11x0_irqhandler.c Tue Feb 16 21:49:36 2010 (r203973) +++ head/sys/arm/sa11x0/sa11x0_irqhandler.c Tue Feb 16 21:59:17 2010 (r203974) @@ -19,13 +19,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/arm/sa11x0/sa11x0_ostreg.h ============================================================================== --- head/sys/arm/sa11x0/sa11x0_ostreg.h Tue Feb 16 21:49:36 2010 (r203973) +++ head/sys/arm/sa11x0/sa11x0_ostreg.h Tue Feb 16 21:59:17 2010 (r203974) @@ -14,13 +14,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/arm/sa11x0/sa11x0_ppcreg.h ============================================================================== --- head/sys/arm/sa11x0/sa11x0_ppcreg.h Tue Feb 16 21:49:36 2010 (r203973) +++ head/sys/arm/sa11x0/sa11x0_ppcreg.h Tue Feb 16 21:59:17 2010 (r203974) @@ -14,13 +14,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: head/sys/arm/sa11x0/sa11x0_reg.h ============================================================================== --- head/sys/arm/sa11x0/sa11x0_reg.h Tue Feb 16 21:49:36 2010 (r203973) +++ head/sys/arm/sa11x0/sa11x0_reg.h Tue Feb 16 21:59:17 2010 (r203974) @@ -14,13 +14,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED Modified: head/sys/arm/sa11x0/sa11x0_var.h ============================================================================== --- head/sys/arm/sa11x0/sa11x0_var.h Tue Feb 16 21:49:36 2010 (r203973) +++ head/sys/arm/sa11x0/sa11x0_var.h Tue Feb 16 21:59:17 2010 (r203974) @@ -14,13 +14,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 22:53:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E6C31065670; Tue, 16 Feb 2010 22:53:18 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E83D8FC12; Tue, 16 Feb 2010 22:53: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 o1GMrILs059325; Tue, 16 Feb 2010 22:53:18 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GMrIfm059322; Tue, 16 Feb 2010 22:53:18 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002162253.o1GMrIfm059322@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 16 Feb 2010 22:53: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: r203977 - head/usr.bin/unzip X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 22:53:18 -0000 Author: gavin Date: Tue Feb 16 22:53:18 2010 New Revision: 203977 URL: http://svn.freebsd.org/changeset/base/203977 Log: Implement the rename query, for when a file with the same name as the one about to be extracted already exists. The question, and interpretation of the response is deliberately compatible with Info-Zip. This change was originally obtained from NetBSD, but has three changes: - better compatibility with Info-Zip in the handling of ^D - Use getdelim() rather than getline() - bug fix: != changed to == in the "file rename" code I suspect the latter is also a bug in NetBSD, but I can't easily confirm this. PR: bin/143307 Reviewed by: rdivacky (change to unzip.c only) Obtained from: NetBSD src/usr.bin/unzip/unzip.c 1.8 MFC after: 1 month Modified: head/usr.bin/unzip/unzip.1 head/usr.bin/unzip/unzip.c Modified: head/usr.bin/unzip/unzip.1 ============================================================================== --- head/usr.bin/unzip/unzip.1 Tue Feb 16 22:23:33 2010 (r203976) +++ head/usr.bin/unzip/unzip.1 Tue Feb 16 22:53:18 2010 (r203977) @@ -158,17 +158,6 @@ utility is only able to process ZIP arch Depending on the installed version of .Xr libarchive , this may or may not include self-extracting archives. -.Sh BUGS -The -.Nm -utility currently does not support asking the user whether to -overwrite or skip a file that already exists on disk. -To be on the safe side, it will fail if it encounters a file that -already exists and neither the -.Fl n -nor the -.Fl o -command line option was specified. .Sh SEE ALSO .Xr libarchive 3 .Sh HISTORY Modified: head/usr.bin/unzip/unzip.c ============================================================================== --- head/usr.bin/unzip/unzip.c Tue Feb 16 22:23:33 2010 (r203976) +++ head/usr.bin/unzip/unzip.c Tue Feb 16 22:53:18 2010 (r203977) @@ -411,17 +411,65 @@ extract_dir(struct archive *a, struct ar static unsigned char buffer[8192]; static char spinner[] = { '|', '/', '-', '\\' }; +static int +handle_existing_file(char **path) +{ + size_t alen; + ssize_t len; + char buf[4]; + + for (;;) { + fprintf(stderr, + "replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: ", + *path); + if (fgets(buf, sizeof(buf), stdin) == 0) { + clearerr(stdin); + printf("NULL\n(EOF or read error, " + "treating as \"[N]one\"...)\n"); + n_opt = 1; + return -1; + } + switch (*buf) { + case 'A': + o_opt = 1; + /* FALLTHROUGH */ + case 'y': + case 'Y': + (void)unlink(*path); + return 1; + case 'N': + n_opt = 1; + /* FALLTHROUGH */ + case 'n': + return -1; + case 'r': + case 'R': + printf("New name: "); + fflush(stdout); + free(*path); + *path = NULL; + alen = 0; + len = getdelim(path, &alen, '\n', stdin); + if ((*path)[len - 1] == '\n') + (*path)[len - 1] = '\0'; + return 0; + default: + break; + } + } +} + /* * Extract a regular file. */ static void -extract_file(struct archive *a, struct archive_entry *e, const char *path) +extract_file(struct archive *a, struct archive_entry *e, char **path) { int mode; time_t mtime; struct stat sb; struct timeval tv[2]; - int cr, fd, text, warn; + int cr, fd, text, warn, check; ssize_t len; unsigned char *p, *q, *end; @@ -431,32 +479,36 @@ extract_file(struct archive *a, struct a mtime = archive_entry_mtime(e); /* look for existing file of same name */ - if (lstat(path, &sb) == 0) { +recheck: + if (lstat(*path, &sb) == 0) { if (u_opt || f_opt) { /* check if up-to-date */ if (S_ISREG(sb.st_mode) && sb.st_mtime >= mtime) return; - (void)unlink(path); + (void)unlink(*path); } else if (o_opt) { /* overwrite */ - (void)unlink(path); + (void)unlink(*path); } else if (n_opt) { /* do not overwrite */ return; } else { - /* XXX ask user */ - errorx("not implemented"); + check = handle_existing_file(path); + if (check == 0) + goto recheck; + if (check == -1) + return; /* do not overwrite */ } } else { if (f_opt) return; } - if ((fd = open(path, O_RDWR|O_CREAT|O_TRUNC, mode)) < 0) - error("open('%s')", path); + if ((fd = open(*path, O_RDWR|O_CREAT|O_TRUNC, mode)) < 0) + error("open('%s')", *path); /* loop over file contents and write to disk */ - info(" extracting: %s", path); + info(" extracting: %s", *path); text = a_opt; warn = 0; cr = 0; @@ -473,7 +525,7 @@ extract_file(struct archive *a, struct a if (a_opt && cr) { if (len == 0 || buffer[0] != '\n') if (write(fd, "\r", 1) != 1) - error("write('%s')", path); + error("write('%s')", *path); cr = 0; } @@ -504,7 +556,7 @@ extract_file(struct archive *a, struct a /* simple case */ if (!a_opt || !text) { if (write(fd, buffer, len) != len) - error("write('%s')", path); + error("write('%s')", *path); continue; } @@ -514,7 +566,7 @@ extract_file(struct archive *a, struct a if (!warn && !isascii(*q)) { warningx("%s may be corrupted due" " to weak text file detection" - " heuristic", path); + " heuristic", *path); warn = 1; } if (q[0] != '\r') @@ -527,7 +579,7 @@ extract_file(struct archive *a, struct a break; } if (write(fd, p, q - p) != q - p) - error("write('%s')", path); + error("write('%s')", *path); } } if (tty) @@ -542,9 +594,9 @@ extract_file(struct archive *a, struct a tv[1].tv_sec = mtime; tv[1].tv_usec = 0; if (futimes(fd, tv) != 0) - error("utimes('%s')", path); + error("utimes('%s')", *path); if (close(fd) != 0) - error("close('%s')", path); + error("close('%s')", *path); } /* @@ -620,7 +672,7 @@ extract(struct archive *a, struct archiv if (S_ISDIR(filetype)) extract_dir(a, e, realpathname); else - extract_file(a, e, realpathname); + extract_file(a, e, &realpathname); free(realpathname); free(pathname); From owner-svn-src-head@FreeBSD.ORG Tue Feb 16 22:55:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB543106566C; Tue, 16 Feb 2010 22:55:38 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C30828FC18; Tue, 16 Feb 2010 22:55: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 o1GMtcZd059866; Tue, 16 Feb 2010 22:55:38 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GMtcSb059864; Tue, 16 Feb 2010 22:55:38 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002162255.o1GMtcSb059864@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 16 Feb 2010 22:55: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: r203978 - head/usr.bin/unzip X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 22:55:39 -0000 Author: gavin Date: Tue Feb 16 22:55:38 2010 New Revision: 203978 URL: http://svn.freebsd.org/changeset/base/203978 Log: Bump .Dd for r203977 MFC after: 1 month Modified: head/usr.bin/unzip/unzip.1 Modified: head/usr.bin/unzip/unzip.1 ============================================================================== --- head/usr.bin/unzip/unzip.1 Tue Feb 16 22:53:18 2010 (r203977) +++ head/usr.bin/unzip/unzip.1 Tue Feb 16 22:55:38 2010 (r203978) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 7, 2009 +.Dd February 16, 2010 .Dt UNZIP 1 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 04:45:18 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC40E106568D; Wed, 17 Feb 2010 04:45:18 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-bw0-f223.google.com (mail-bw0-f223.google.com [209.85.218.223]) by mx1.freebsd.org (Postfix) with ESMTP id E40ED8FC20; Wed, 17 Feb 2010 04:45:17 +0000 (UTC) Received: by bwz23 with SMTP id 23so1685004bwz.13 for ; Tue, 16 Feb 2010 20:45:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=yZHyDHXtyzsvlki8MH4rOy6GBXBAVt45HqWC5mfw0cI=; b=ENZaYYh+JiK5G+NnedIopA2ECiGbIjJUKsLqoHqe2vR2q80mo1D1KtPAQSF3gdmMNW vhdfxjdZupvJH2CVvltWso0JSUxmeJAUTtiscWCmZD6oqF0SawrCkMYgVuSLAVb6usl3 xmqJb23y85zSdTEK2uEzscsK6jbUIBzWo/VvU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Kxfj/9f0RMZxGuA/1y/lHvI+mlZbw9YcRYz2gPlXEK0qD+xaAcPX9YI6k6fGk/r2Wi tAoGlufuWjJ2EmrdB1CCho0zVth406rE6KQcHTtAQeJiQmJrEvCGrrZnpgXuAcTHdcYS yueebX1KXk/CYeWvT57US5WAWzc2xRmddoRn8= MIME-Version: 1.0 Received: by 10.204.10.140 with SMTP id p12mr4379062bkp.54.1266381916380; Tue, 16 Feb 2010 20:45:16 -0800 (PST) In-Reply-To: <201002162147.o1GLl5LP044492@svn.freebsd.org> References: <201002162147.o1GLl5LP044492@svn.freebsd.org> Date: Wed, 17 Feb 2010 07:45:16 +0300 Message-ID: From: pluknet To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: base64 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r203972 - in head/usr.sbin: eeprom makefs makefs/compat rpcbind usbdevs yppoll X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 04:45:19 -0000 T24gMTcgRmVicnVhcnkgMjAxMCAwMDo0NywgV2FybmVyIExvc2ggPGltcEBmcmVlYnNkLm9yZz4g d3JvdGU6ClsuLi5dCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQo+IC0tLSBoZWFkL3Vzci5zYmluL3Jw Y2JpbmQvdXRpbC5jIKAgoCCgIKBUdWUgRmViIDE2IDIxOjQzOjU3IDIwMTAgoCCgIKAgoChyMjAz OTcxKQo+ICsrKyBoZWFkL3Vzci5zYmluL3JwY2JpbmQvdXRpbC5jIKAgoCCgIKBUdWUgRmViIDE2 IDIxOjQ3OjA1IDIwMTAgoCCgIKAgoChyMjAzOTcyKQpbLi4uXQo+IEBAIC0xODUsNiArMTc4LDgg QEAgYWRkcm1lcmdlKHN0cnVjdCBuZXRidWYgKmNhbGxlciwgY2hhciAqcwo+IKAgoCCgIKAgoCCg IKAgoGlmIChpZnNhID09IE5VTEwgfHwgaWZzYS0+c2FfZmFtaWx5ICE9IGhpbnRfc2EtPnNhX2Zh bWlseSB8fAo+IKAgoCCgIKAgoCCgIKAgoCCgIKAhKGlmYXAtPmlmYV9mbGFncyAmIElGRl9VUCkp Cj4goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBjb250aW51ZTsKPiArIKAgoCCgIKAgoCCgIKAgaWYg KCFhZGRyX2lzX2JvdW5kKGlmc2EpKQo+ICsgoCCgIKAgoCCgIKAgoCCgIKAgoCCgIGNvbnRpbnVl Owo+Cj4goCCgIKAgoCCgIKAgoCCgaWYgKCEoaWZhcC0+aWZhX2ZsYWdzICYgSUZGX0xPT1BCQUNL KSAmJiAhbGlzdGVuX2FkZHIoaWZzYSkpCj4goCCgIKAgoCCgIKAgoCCgIKAgoCCgIKBjb250aW51 ZTsKPgoKSGksIFdhcm5lci4KCldhcyB0aGlzIGNoYW5nZSBpbnRlbnRpb25hbD8KVGhhbmtzLgoK LS0gCndiciwKcGx1a25ldAo= From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 06:11:06 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F025106568D; Wed, 17 Feb 2010 06:11:06 +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 F28C18FC1A; Wed, 17 Feb 2010 06:11: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 o1H6B5jZ055870; Wed, 17 Feb 2010 06:11:05 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1H6B5oG055868; Wed, 17 Feb 2010 06:11:05 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002170611.o1H6B5oG055868@svn.freebsd.org> From: Warner Losh Date: Wed, 17 Feb 2010 06:11: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: r203984 - head/usr.sbin/rpcbind X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 06:11:06 -0000 Author: imp Date: Wed Feb 17 06:11:05 2010 New Revision: 203984 URL: http://svn.freebsd.org/changeset/base/203984 Log: Revert bogus change that snuck into r203972. Modified: head/usr.sbin/rpcbind/util.c Modified: head/usr.sbin/rpcbind/util.c ============================================================================== --- head/usr.sbin/rpcbind/util.c Wed Feb 17 03:11:56 2010 (r203983) +++ head/usr.sbin/rpcbind/util.c Wed Feb 17 06:11:05 2010 (r203984) @@ -178,8 +178,6 @@ addrmerge(struct netbuf *caller, char *s if (ifsa == NULL || ifsa->sa_family != hint_sa->sa_family || !(ifap->ifa_flags & IFF_UP)) continue; - if (!addr_is_bound(ifsa)) - continue; if (!(ifap->ifa_flags & IFF_LOOPBACK) && !listen_addr(ifsa)) continue; From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 06:43:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15DBF106566B; Wed, 17 Feb 2010 06:43:38 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03CAC8FC19; Wed, 17 Feb 2010 06:43: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 o1H6hbol063172; Wed, 17 Feb 2010 06:43:37 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1H6hbhc063167; Wed, 17 Feb 2010 06:43:37 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201002170643.o1H6hbhc063167@svn.freebsd.org> From: Neel Natu Date: Wed, 17 Feb 2010 06:43: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: r203985 - in head/sys/mips: mips sibyte X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 06:43:38 -0000 Author: neel Date: Wed Feb 17 06:43:37 2010 New Revision: 203985 URL: http://svn.freebsd.org/changeset/base/203985 Log: Various fixes to get the SWARM config working on a big-endian Sibyte CPU. Getting the little-endian PCI bus working on the big-endian CPU proved to be quite challenging. We let the PCI devices be mapped in the "match byte lanes" address window. This is where they are mapped by the CFE and DMA transfers generated to or from addresses within this window are not subject to automatic byte-swapping. However any access by the driver to memory-mapped pci space is redirected via the "match bit lanes" address window. We get the benefit of automatic byte swapping through this address window and drivers don't need to change to deal with CPU big-endianness. Added: head/sys/mips/sibyte/sb_bus_space.h (contents, props changed) Modified: head/sys/mips/mips/bus_space_generic.c head/sys/mips/sibyte/sb_asm.S head/sys/mips/sibyte/sb_zbpci.c Modified: head/sys/mips/mips/bus_space_generic.c ============================================================================== --- head/sys/mips/mips/bus_space_generic.c Wed Feb 17 06:11:05 2010 (r203984) +++ head/sys/mips/mips/bus_space_generic.c Wed Feb 17 06:43:37 2010 (r203985) @@ -206,6 +206,14 @@ static struct bus_space generic_space = #define wr8(a, v) oct_write8(a, v) #define wr16(a, v) oct_write16(a, v) #define wr32(a, v) oct_write32(a, v) +#elif defined(CPU_SB1) && _BYTE_ORDER == _BIG_ENDIAN +#include +#define rd8(a) sb_big_endian_read8(a) +#define rd16(a) sb_big_endian_read16(a) +#define rd32(a) sb_big_endian_read32(a) +#define wr8(a, v) sb_big_endian_write8(a, v) +#define wr16(a, v) sb_big_endian_write16(a, v) +#define wr32(a, v) sb_big_endian_write32(a, v) #else #define rd8(a) readb(a) #define rd16(a) readw(a) Modified: head/sys/mips/sibyte/sb_asm.S ============================================================================== --- head/sys/mips/sibyte/sb_asm.S Wed Feb 17 06:11:05 2010 (r203984) +++ head/sys/mips/sibyte/sb_asm.S Wed Feb 17 06:43:37 2010 (r203985) @@ -28,6 +28,7 @@ #include #include +#include /* * We compile a 32-bit kernel to run on the SB-1 processor which is a 64-bit @@ -50,7 +51,7 @@ LEAF(sb_load64) ld v1, 0(a0) /* result = *(uint64_t *)ptr */ move v0, v1 -#if defined(TARGET_BIG_ENDIAN) +#if _BYTE_ORDER == _BIG_ENDIAN dsll32 v1, v1, 0 dsrl32 v1, v1, 0 /* v1 = lower_uint32(result) */ jr ra @@ -68,7 +69,7 @@ END(sb_load64) * Return value: void */ LEAF(sb_store64) -#if defined(TARGET_BIG_ENDIAN) +#if _BYTE_ORDER == _BIG_ENDIAN dsll32 a2, a2, 0 /* a2 = upper_uint32(val) */ dsll32 a3, a3, 0 /* a3 = lower_uint32(val) */ dsrl32 a3, a3, 0 Added: head/sys/mips/sibyte/sb_bus_space.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/sibyte/sb_bus_space.h Wed Feb 17 06:43:37 2010 (r203985) @@ -0,0 +1,43 @@ +/*- + * Copyright (c) 2010 Neelkanth Natu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _SB_BUS_SPACE_H_ +#define _SB_BUS_SPACE_H_ + +#include + +#if _BYTE_ORDER == _BIG_ENDIAN +uint8_t sb_big_endian_read8(bus_addr_t addr); +uint16_t sb_big_endian_read16(bus_addr_t addr); +uint32_t sb_big_endian_read32(bus_addr_t addr); +void sb_big_endian_write8(bus_addr_t addr, uint8_t val); +void sb_big_endian_write16(bus_addr_t addr, uint16_t val); +void sb_big_endian_write32(bus_addr_t addr, uint32_t val); +#endif + +#endif Modified: head/sys/mips/sibyte/sb_zbpci.c ============================================================================== --- head/sys/mips/sibyte/sb_zbpci.c Wed Feb 17 06:11:05 2010 (r203984) +++ head/sys/mips/sibyte/sb_zbpci.c Wed Feb 17 06:43:37 2010 (r203985) @@ -50,6 +50,7 @@ #include "pcib_if.h" +#include "sb_bus_space.h" #include "sb_scd.h" __FBSDID("$FreeBSD$"); @@ -63,6 +64,15 @@ static const vm_paddr_t CFG_PADDR_BASE = static const u_long PCI_IOSPACE_ADDR = 0xFC000000; static const u_long PCI_IOSPACE_SIZE = 0x02000000; +#define PCI_MATCH_BYTE_LANES_START 0x40000000 +#define PCI_MATCH_BYTE_LANES_END 0x5FFFFFFF +#define PCI_MATCH_BYTE_LANES_SIZE 0x20000000 + +#define PCI_MATCH_BIT_LANES_MASK (1 << 29) +#define PCI_MATCH_BIT_LANES_START 0x60000000 +#define PCI_MATCH_BIT_LANES_END 0x7FFFFFFF +#define PCI_MATCH_BIT_LANES_SIZE 0x20000000 + static struct rman port_rman; static int @@ -112,6 +122,19 @@ zbpci_attach(device_t dev) panic("Cannot allocate resource for config space accesses."); /* + * Allocate the entire "match bit lanes" address space. + */ +#if _BYTE_ORDER == _BIG_ENDIAN + rid = 2; + res = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid, + PCI_MATCH_BIT_LANES_START, + PCI_MATCH_BIT_LANES_END, + PCI_MATCH_BIT_LANES_SIZE, 0); + if (res == NULL) + panic("Cannot allocate resource for pci match bit lanes."); +#endif /* _BYTE_ORDER ==_BIG_ENDIAN */ + + /* * Allocate KVA for accessing PCI config space. */ va = kmem_alloc_nofault(kernel_map, PAGE_SIZE * mp_ncpus); @@ -177,21 +200,61 @@ static int zbpci_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { + int error; void *vaddr; - u_long paddr, psize; + u_long orig_paddr, paddr, psize; + + paddr = rman_get_start(res); + psize = rman_get_size(res); + orig_paddr = paddr; + +#if _BYTE_ORDER == _BIG_ENDIAN + /* + * The CFE allocates PCI memory resources that map to the + * "match byte lanes" address space. This address space works + * best for DMA transfers because it does not do any automatic + * byte swaps when data crosses the pci-cpu interface. + * + * This also makes it sub-optimal for accesses to PCI device + * registers because it exposes the little-endian nature of + * the PCI bus to the big-endian CPU. The Sibyte has another + * address window called the "match bit lanes" window which + * automatically swaps bytes when data crosses the pci-cpu + * interface. + * + * We "assume" that any bus_space memory accesses done by the + * CPU to a PCI device are register/configuration accesses and + * are done through the "match bit lanes" window. Any DMA + * transfers will continue to be through the "match byte lanes" + * window because the PCI BAR registers will not be changed. + */ + if (type == SYS_RES_MEMORY) { + if (paddr >= PCI_MATCH_BYTE_LANES_START && + paddr + psize - 1 <= PCI_MATCH_BYTE_LANES_END) { + paddr |= PCI_MATCH_BIT_LANES_MASK; + rman_set_start(res, paddr); + rman_set_end(res, paddr + psize - 1); + } + } +#endif if (type != SYS_RES_IOPORT) { - return (bus_generic_activate_resource(bus, child, type, - rid, res)); + error = bus_generic_activate_resource(bus, child, type, + rid, res); +#if _BYTE_ORDER == _BIG_ENDIAN + if (type == SYS_RES_MEMORY) { + rman_set_start(res, orig_paddr); + rman_set_end(res, orig_paddr + psize - 1); + } +#endif + return (error); } /* * Map the I/O space resource through the memory window starting * at PCI_IOSPACE_ADDR. */ - paddr = rman_get_start(res) + PCI_IOSPACE_ADDR; - psize = rman_get_size(res); - vaddr = pmap_mapdev(paddr, psize); + vaddr = pmap_mapdev(paddr + PCI_IOSPACE_ADDR, psize); rman_set_virtual(res, vaddr); rman_set_bustag(res, mips_bus_space_generic); @@ -280,6 +343,9 @@ zbpci_config_space_va(int bus, int slot, va_page = zbpci_config_space[cpu].vaddr; pa = CFG_PADDR_BASE | (bus << 16) | (slot << 11) | (func << 8) | reg; +#if _BYTE_ORDER == _BIG_ENDIAN + pa = pa ^ (4 - bytes); +#endif pa_page = pa & ~(PAGE_SIZE - 1); if (zbpci_config_space[cpu].paddr != pa_page) { pmap_kremove(va_page); @@ -397,3 +463,82 @@ DEFINE_CLASS_1(zbpci, zbpci_driver, zbpc static devclass_t zbpci_devclass; DRIVER_MODULE(zbpci, zbbus, zbpci_driver, zbpci_devclass, 0, 0); + +/* + * Big endian bus space routines + */ +#if _BYTE_ORDER == _BIG_ENDIAN + +/* + * The CPU correctly deals with the big-endian to little-endian swap if + * we are accessing 4 bytes at a time. However if we want to read 1 or 2 + * bytes then we need to fudge the address generated by the CPU such that + * it generates the right byte enables on the PCI bus. + */ +static bus_addr_t +sb_match_bit_lane_addr(bus_addr_t addr, int bytes) +{ + vm_offset_t pa; + + pa = vtophys(addr); + + if (pa >= PCI_MATCH_BIT_LANES_START && pa <= PCI_MATCH_BIT_LANES_END) + return (addr ^ (4 - bytes)); + else + return (addr); +} + +uint8_t +sb_big_endian_read8(bus_addr_t addr) +{ + bus_addr_t addr2; + + addr2 = sb_match_bit_lane_addr(addr, 1); + return (readb(addr2)); +} + +uint16_t +sb_big_endian_read16(bus_addr_t addr) +{ + bus_addr_t addr2; + + addr2 = sb_match_bit_lane_addr(addr, 2); + return (readw(addr2)); +} + +uint32_t +sb_big_endian_read32(bus_addr_t addr) +{ + bus_addr_t addr2; + + addr2 = sb_match_bit_lane_addr(addr, 4); + return (readl(addr2)); +} + +void +sb_big_endian_write8(bus_addr_t addr, uint8_t val) +{ + bus_addr_t addr2; + + addr2 = sb_match_bit_lane_addr(addr, 1); + writeb(addr2, val); +} + +void +sb_big_endian_write16(bus_addr_t addr, uint16_t val) +{ + bus_addr_t addr2; + + addr2 = sb_match_bit_lane_addr(addr, 2); + writew(addr2, val); +} + +void +sb_big_endian_write32(bus_addr_t addr, uint32_t val) +{ + bus_addr_t addr2; + + addr2 = sb_match_bit_lane_addr(addr, 4); + writel(addr2, val); +} +#endif /* _BIG_ENDIAN */ From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 09:11:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17CDD1065670; Wed, 17 Feb 2010 09:11:22 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 079198FC0C; Wed, 17 Feb 2010 09:11: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 o1H9BLYS095998; Wed, 17 Feb 2010 09:11:21 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1H9BL6m095996; Wed, 17 Feb 2010 09:11:21 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201002170911.o1H9BL6m095996@svn.freebsd.org> From: Poul-Henning Kamp Date: Wed, 17 Feb 2010 09:11: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: r203990 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 09:11:22 -0000 Author: phk Date: Wed Feb 17 09:11:21 2010 New Revision: 203990 URL: http://svn.freebsd.org/changeset/base/203990 Log: Mention EISDIR as a possible errno. Modified: head/lib/libc/sys/unlink.2 Modified: head/lib/libc/sys/unlink.2 ============================================================================== --- head/lib/libc/sys/unlink.2 Wed Feb 17 09:09:12 2010 (r203989) +++ head/lib/libc/sys/unlink.2 Wed Feb 17 09:11:21 2010 (r203990) @@ -114,6 +114,8 @@ succeeds unless: .Bl -tag -width Er .It Bq Er ENOTDIR A component of the path prefix is not a directory. +.It Bq Er EISDIR +The named file is a directory. .It Bq Er ENAMETOOLONG A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters. From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 13:06:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C7041065679; Wed, 17 Feb 2010 13:06:07 +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 2C03A8FC13; Wed, 17 Feb 2010 13:06: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 o1HD67Yh050327; Wed, 17 Feb 2010 13:06:07 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1HD675S050325; Wed, 17 Feb 2010 13:06:07 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201002171306.o1HD675S050325@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 17 Feb 2010 13:06: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: r204003 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 13:06:07 -0000 Author: luigi Date: Wed Feb 17 13:06:06 2010 New Revision: 204003 URL: http://svn.freebsd.org/changeset/base/204003 Log: remove recursive lock/unlock calls, we do them already before entering the switch. Reported by: Marta Carbone Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_sockopt.c Wed Feb 17 11:19:21 2010 (r204002) +++ head/sys/netinet/ipfw/ip_fw_sockopt.c Wed Feb 17 13:06:06 2010 (r204003) @@ -343,27 +343,22 @@ del_entry(struct ip_fw_chain *chain, u_i break; case 2: /* move rules with given number to new set */ - IPFW_UH_WLOCK(chain); for (i = 0; i < chain->n_rules; i++) { rule = chain->map[i]; if (rule->rulenum == rulenum) rule->set = new_set; } - IPFW_UH_WUNLOCK(chain); break; case 3: /* move rules with given set number to new set */ - IPFW_UH_WLOCK(chain); for (i = 0; i < chain->n_rules; i++) { rule = chain->map[i]; if (rule->set == rulenum) rule->set = new_set; } - IPFW_UH_WUNLOCK(chain); break; case 4: /* swap two sets */ - IPFW_UH_WLOCK(chain); for (i = 0; i < chain->n_rules; i++) { rule = chain->map[i]; if (rule->set == rulenum) @@ -371,7 +366,6 @@ del_entry(struct ip_fw_chain *chain, u_i else if (rule->set == new_set) rule->set = rulenum; } - IPFW_UH_WUNLOCK(chain); break; } rule = chain->reap; From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 16:45:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B8F0106566B; Wed, 17 Feb 2010 16:45:04 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2B26B8FC0A; Wed, 17 Feb 2010 16:45: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 o1HGj47v098545; Wed, 17 Feb 2010 16:45:04 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1HGj41k098543; Wed, 17 Feb 2010 16:45:04 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002171645.o1HGj41k098543@svn.freebsd.org> From: Ruslan Ermilov Date: Wed, 17 Feb 2010 16:45: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: r204008 - head/lib/libjail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 16:45:04 -0000 Author: ru Date: Wed Feb 17 16:45:03 2010 New Revision: 204008 URL: http://svn.freebsd.org/changeset/base/204008 Log: realloc() with a proper amount of memory. MFC after: 3 days Modified: head/lib/libjail/jail.c Modified: head/lib/libjail/jail.c ============================================================================== --- head/lib/libjail/jail.c Wed Feb 17 15:44:01 2010 (r204007) +++ head/lib/libjail/jail.c Wed Feb 17 16:45:03 2010 (r204008) @@ -191,7 +191,7 @@ jailparam_all(struct jailparam **jpp) /* Add the parameter to the list */ if (njp >= nlist) { nlist *= 2; - jp = realloc(jp, nlist * sizeof(jp)); + jp = realloc(jp, nlist * sizeof(*jp)); if (jp == NULL) { jailparam_free(jp, njp); return (-1); From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 17:03:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96874106566B; Wed, 17 Feb 2010 17:03:04 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C99A8FC19; Wed, 17 Feb 2010 17:03: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 o1HH343H002680; Wed, 17 Feb 2010 17:03:04 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1HH34Zk002678; Wed, 17 Feb 2010 17:03:04 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201002171703.o1HH34Zk002678@svn.freebsd.org> From: Rafal Jaworowski Date: Wed, 17 Feb 2010 17:03: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: r204009 - head/sys/dev/mge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 17:03:04 -0000 Author: raj Date: Wed Feb 17 17:03:04 2010 New Revision: 204009 URL: http://svn.freebsd.org/changeset/base/204009 Log: Assorted fixes for mge(4). - Use proper map for the busdma sync on mge descriptor. - Remove unnecesary busdma sync. - Eliminate redundant locking in mge_reinit_rx() (just assert). - Kill unused variable. Submitted by: Grzegorz Bernacki Obtained from: Semihalf MFC after: 1 week Modified: head/sys/dev/mge/if_mge.c Modified: head/sys/dev/mge/if_mge.c ============================================================================== --- head/sys/dev/mge/if_mge.c Wed Feb 17 16:45:03 2010 (r204008) +++ head/sys/dev/mge/if_mge.c Wed Feb 17 17:03:04 2010 (r204009) @@ -457,10 +457,7 @@ mge_allocate_dma(struct mge_softc *sc) { int error; struct mge_desc_wrapper *dw; - int num, i; - - - num = MGE_TX_DESC_NUM + MGE_RX_DESC_NUM; + int i; /* Allocate a busdma tag and DMA safe memory for TX/RX descriptors. */ error = bus_dma_tag_create(NULL, /* parent */ @@ -543,7 +540,7 @@ mge_reinit_rx(struct mge_softc *sc) struct mge_desc_wrapper *dw; int i; - MGE_RECEIVE_LOCK(sc); + MGE_RECEIVE_LOCK_ASSERT(sc); mge_free_desc(sc, sc->mge_rx_desc, MGE_RX_DESC_NUM, sc->mge_rx_dtag, 1); @@ -564,8 +561,6 @@ mge_reinit_rx(struct mge_softc *sc) /* Enable RX queue */ MGE_WRITE(sc, MGE_RX_QUEUE_CMD, MGE_ENABLE_RXQ(MGE_RX_DEFAULT_QUEUE)); - - MGE_RECEIVE_UNLOCK(sc); } #ifdef DEVICE_POLLING @@ -1375,9 +1370,6 @@ mge_encap(struct mge_softc *sc, struct m dw = &sc->mge_tx_desc[desc_no]; mapp = dw->buffer_dmap; - bus_dmamap_sync(sc->mge_desc_dtag, mapp, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - /* Create mapping in DMA memory */ error = bus_dmamap_load_mbuf_sg(sc->mge_tx_dtag, mapp, m0, segs, &nsegs, BUS_DMA_NOWAIT); @@ -1401,7 +1393,7 @@ mge_encap(struct mge_softc *sc, struct m mge_offload_setup_descriptor(sc, dw); } - bus_dmamap_sync(sc->mge_desc_dtag, mapp, + bus_dmamap_sync(sc->mge_desc_dtag, dw->desc_dmap, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); sc->tx_desc_curr = (++sc->tx_desc_curr) % MGE_TX_DESC_NUM; From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 17:54:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D30A01065670; Wed, 17 Feb 2010 17:54:46 +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 A45CF8FC19; Wed, 17 Feb 2010 17:54:46 +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 3F40F46B5B; Wed, 17 Feb 2010 12:54:46 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 8848E8A01F; Wed, 17 Feb 2010 12:54:45 -0500 (EST) From: John Baldwin To: Ulrich Spoerlein Date: Wed, 17 Feb 2010 11:43:57 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20100120; KDE/4.3.1; amd64; ; ) References: <201002151510.o1FFAMgv035651@svn.freebsd.org> In-Reply-To: <201002151510.o1FFAMgv035651@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201002171143.57885.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 17 Feb 2010 12:54:45 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r203926 - in head/games/fortune: fortune strfile unstr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 17:54:46 -0000 On Monday 15 February 2010 10:10:22 am Ulrich Spoerlein wrote: > Author: uqs > Date: Mon Feb 15 15:10:21 2010 > New Revision: 203926 > URL: http://svn.freebsd.org/changeset/base/203926 > > Log: > fortune(6) switch to 3-clause BSDL; style(9) > > This reduces the diff to other *BSD and makes it possible to actually > see the code differences. > > Approved by: ed (Co-mentor) There appear to be a lot of unrelated changes to at least fortune.c in this commit. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 17:54:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF0A41065676; Wed, 17 Feb 2010 17:54:47 +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 BBA338FC13; Wed, 17 Feb 2010 17:54:47 +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 651AD46B5C; Wed, 17 Feb 2010 12:54:47 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 8E8BC8A021; Wed, 17 Feb 2010 12:54:46 -0500 (EST) From: John Baldwin To: ticso@cicely.de Date: Wed, 17 Feb 2010 11:50:16 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20100120; KDE/4.3.1; amd64; ; ) References: <20100210203519.GA44831@FreeBSD.org> <20100215.171425.646090028373155752.imp@bsdimp.com> <20100216133032.GH43625@cicely7.cicely.de> In-Reply-To: <20100216133032.GH43625@cicely7.cicely.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201002171150.16645.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 17 Feb 2010 12:54:46 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: danfe@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, avg@freebsd.org, attilio@freebsd.org, svn-src-head@freebsd.org, "M. Warner Losh" Subject: Re: svn commit: r203758 - in head/sys: amd64/conf arm/conf i386/conf ia64/conf mips/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 17:54:48 -0000 On Tuesday 16 February 2010 8:30:32 am Bernd Walter wrote: > On Mon, Feb 15, 2010 at 05:14:25PM -0700, M. Warner Losh wrote: > > In message: <4B79CE84.3060901@freebsd.org> > > Andriy Gapon writes: > > : At least in the i386/amd64 kernel config files typically we have: > > : optionsOPTION > > : And it is the case for the quoted above amd64 context. > > > > That's the standard way to add options in all kernel config files, > > although there's pockets here and there which don't quite comply. > > Interesting - I wasn't aware of this, but it surely makes sense. There's a comment in sys/conf/NOTES: # # NOTES conventions and style guide: # # Large block comments should begin and end with a line containing only a # comment character. # # To describe a particular object, a block comment (if it exists) should # come first. Next should come device, options, and hints lines in that # order. All device and option lines must be described by a comment that # doesn't just expand the device or option name. Use only a concise # comment on the same line if possible. Very detailed descriptions of # devices and subsystems belong in man pages. # # A space followed by a tab separates 'options' from an option name. Two # spaces followed by a tab separate 'device' from a device name. Comments # after an option or device should use one space after the comment character. # To comment out a negative option that disables code and thus should not be # enabled for LINT builds, precede 'options' with "#!". # -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 18:47:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88A3B106566C; Wed, 17 Feb 2010 18:47:23 +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 1FD838FC1D; Wed, 17 Feb 2010 18:47:22 +0000 (UTC) Received: from c122-106-163-215.carlnfd1.nsw.optusnet.com.au (c122-106-163-215.carlnfd1.nsw.optusnet.com.au [122.106.163.215]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o1HIlKZ4023649 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Feb 2010 05:47:21 +1100 Date: Thu, 18 Feb 2010 05:47:19 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Poul-Henning Kamp In-Reply-To: <201002170911.o1H9BL6m095996@svn.freebsd.org> Message-ID: <20100218044931.S95007@delplex.bde.org> References: <201002170911.o1H9BL6m095996@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: r203990 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 18:47:23 -0000 On Wed, 17 Feb 2010, Poul-Henning Kamp wrote: > Log: > Mention EISDIR as a possible errno. It's not a possible error. > Modified: > head/lib/libc/sys/unlink.2 > > Modified: head/lib/libc/sys/unlink.2 > ============================================================================== > --- head/lib/libc/sys/unlink.2 Wed Feb 17 09:09:12 2010 (r203989) > +++ head/lib/libc/sys/unlink.2 Wed Feb 17 09:11:21 2010 (r203990) > @@ -114,6 +114,8 @@ succeeds unless: > .Bl -tag -width Er > .It Bq Er ENOTDIR > A component of the path prefix is not a directory. > +.It Bq Er EISDIR > +The named file is a directory. > .It Bq Er ENAMETOOLONG > A component of a pathname exceeded 255 characters, > or an entire path name exceeded 1023 characters. According to the POSIX spec (old draft, current version is the same): %%% 48397 [EPERM] The file named by path is a directory, and either the calling process does not 48398 have appropriate privileges, or the implementation prohibits using unlink( ) 48399 on directories. [EISDIR] [not mentioned for unlink()] %%% According to unlink.2: %%% [EPERM] The named file is a directory. [EISDIR] [previously not mentioned] %%% According to the source code: in kern_unlinkat(): % if (vp->v_type == VDIR && oldinum == 0) { % error = EPERM; /* POSIX */ % } else if (oldinum != 0 && % ((error = vn_stat(vp, &sb, td->td_ucred, NOCRED, td)) == 0) && % sb.st_ino != oldinum) { % error = EIDRM; /* Identifier removed */ % } else { `oldinum' is always 0 for unlink(2). Thus the code matches the specified and previously-documented behaviour. FreeBSD is still choosing to implement the second possibility of the spec (that the implementation prohibits using unlink() on directories) (except the first possibility allows this too -- appropriate privilege can mean "more privilege than anyone has"). The difference may be a difference in FreeBSD since trying to use appropriate privilege may have side effects, but it isn't required to be a difference in POSIX. `oldinum' is also always 0 for unlinkat(2). It seems to be only nonzero for the ffs_fsck sysctl. I guess this sysctl is undocumented and its EIDRM error is even less documented. The oldinum code has bad style: - weird indentation for both continued lines. Far from KNF (-ci4). Closer to -lp, but off-by 1 char for that. - banal comment. The "POSIX" comment for oldinum == 0 is banal and misleading too. POSIX does specify the errno as EPERM, but the only possibly-surprising thing about this errno is that it occurs for the superuser too, not what it is. Once upon a time, FreeBSD implemented the first possibility, with appropriate privilege meaning that only the superuser can try to unlink() (might still fail due to a leaf file system not liking it). Then the errno of EPERM was generic for lack of appropriate privelege and not commented on. Only the superuse case changed, and the comment misleads by documenting something banal instead of that. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 18:51:35 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86A95106566B; Wed, 17 Feb 2010 18:51:35 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2001:470:9a47::1]) by mx1.freebsd.org (Postfix) with ESMTP id 21C648FC12; Wed, 17 Feb 2010 18:51:34 +0000 (UTC) Received: from acme.spoerlein.net (localhost.spoerlein.net [IPv6:::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id o1HIpXeF058535 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 17 Feb 2010 19:51:33 +0100 (CET) (envelope-from uqs@FreeBSD.org) Received: (from uqs@localhost) by acme.spoerlein.net (8.14.4/8.14.4/Submit) id o1HIpXTl058534; Wed, 17 Feb 2010 19:51:33 +0100 (CET) (envelope-from uqs@FreeBSD.org) Date: Wed, 17 Feb 2010 19:51:33 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: John Baldwin Message-ID: <20100217185133.GL57731@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201002151510.o1FFAMgv035651@svn.freebsd.org> <201002171143.57885.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201002171143.57885.jhb@freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r203926 - in head/games/fortune: fortune strfile unstr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 18:51:35 -0000 On Wed, 17.02.2010 at 11:43:57 -0500, John Baldwin wrote: > On Monday 15 February 2010 10:10:22 am Ulrich Spoerlein wrote: > > Author: uqs > > Date: Mon Feb 15 15:10:21 2010 > > New Revision: 203926 > > URL: http://svn.freebsd.org/changeset/base/203926 > > > > Log: > > fortune(6) switch to 3-clause BSDL; style(9) > > > > This reduces the diff to other *BSD and makes it possible to actually > > see the code differences. > > > > Approved by: ed (Co-mentor) > > There appear to be a lot of unrelated changes to at least fortune.c in this > commit. Hi John, care to elaborate? The commit log says that style(9) has been applied and it is a diff reduction commit in general. That said, the only object code altering change is the replacing of exit(0) with return(0) at the end of main(). There's nothing definitive in style(9) about that ... Cheers, Uli From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 18:58:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56F19106568D; Wed, 17 Feb 2010 18:58:28 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 196168FC15; Wed, 17 Feb 2010 18:58:27 +0000 (UTC) Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3]) by phk.freebsd.dk (Postfix) with ESMTP id BA49C7E993; Wed, 17 Feb 2010 18:58:26 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.14.3/8.14.3) with ESMTP id o1HIwP3K006414; Wed, 17 Feb 2010 18:58:26 GMT (envelope-from phk@critter.freebsd.dk) To: Bruce Evans From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 18 Feb 2010 05:47:19 +1100." <20100218044931.S95007@delplex.bde.org> Date: Wed, 17 Feb 2010 18:58:25 +0000 Message-ID: <6413.1266433105@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r203990 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 18:58:28 -0000 In message <20100218044931.S95007@delplex.bde.org>, Bruce Evans writes: >On Wed, 17 Feb 2010, Poul-Henning Kamp wrote: > >> Log: >> Mention EISDIR as a possible errno. > >It's not a possible error. critter phk> cat > a.c #include #include int main(int argc, char **argv) { if (unlink("/")) err(1, "Told you so"); return (0); } critter phk> cc a.c critter phk> ./a.out a.out: Told you so: Is a directory critter phk> -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 19:13:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15242106568D; Wed, 17 Feb 2010 19:13:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 8A5228FC26; Wed, 17 Feb 2010 19:13:49 +0000 (UTC) Received: from besplex.bde.org (c122-106-163-215.carlnfd1.nsw.optusnet.com.au [122.106.163.215]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o1HJDjc0021896 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Feb 2010 06:13:47 +1100 Date: Thu, 18 Feb 2010 06:13:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans In-Reply-To: <20100218044931.S95007@delplex.bde.org> Message-ID: <20100218055229.Q1735@besplex.bde.org> References: <201002170911.o1H9BL6m095996@svn.freebsd.org> <20100218044931.S95007@delplex.bde.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, Poul-Henning Kamp Subject: Re: svn commit: r203990 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 19:13:50 -0000 On Thu, 18 Feb 2010, Bruce Evans wrote: > On Wed, 17 Feb 2010, Poul-Henning Kamp wrote: > >> Log: >> Mention EISDIR as a possible errno. > > It's not a possible error. > >> ... Related bug: unlink(1) bogusly prints a messages that looks like strerror(EISDIR). It doesn't even try unlink(2) on directories, but prints this message from a private string. %%% Script started on Thu Feb 18 05:49:45 2010 ttyp0:bde@besplex:/tmp/z> mkdir z ttyp0:bde@besplex:/tmp/z> /bin/unlink z unlink: z: is a directory ttyp0:bde@besplex:/tmp/z> truss /bin/unlink z lstat("z",0xbfbfe840) = 0 (0x0) unlink: write(2,0xbfbfe0b0,8) = 8 (0x8) z: is a directorywrite(2,0xbfbfe0d0,17) = 17 (0x11) write(2,0x80a6753,1) = 1 (0x1) exit(0x1) process exit, rval = 256 %%% Here I use /bin/unlink since the unlink in $PATH is missing the bug. /bin/unlink is a link to /bin/rm. rm(1) takes a -d flag which should do the right thing for unlink, but this flag is neither settable nor forced for unlink(1). The above behaviour of unlink(1) is not permitted by POSIX or unlink(1)'s man page: POSIX (old draft, no change in current version): %%% 36900 The unlink utility shall perform the function call: 36901 unlink(file); 36902 A user may need appropriate privilege to invoke the unlink utility. %%% Man page: %%% When the utility is called as unlink, only one argument, which must not be a directory, may be supplied. No options may be supplied in this sim- ple mode of operation, which performs an unlink(2) operation on the passed argument. STANDARDS The rm command conforms to IEEE Std 1003.2 (``POSIX.2''). The simplified unlink command conforms to Version 2 of the Single UNIX Specification (``SUSv2''). %%% Oops, the man page actually says that the arg must not be a directory. POSIX doesn't make this restriction, except by possibly requiring appropriate privilege, which can be interpreted as "more privilege than exists" if the file is a directory so as to make FreeBSD conform (except the error must involve unlink(1) not being invokable in this case :-). POSIX doesn't specify the form of the diagnostic message for any case. Anyway, unlink(1) shouldn't fall into rm(1)'s error handling to to print its diagnostic. It should use a special message (matching its man page) for directories, or just try unlink(2). rm(1)'s current special message should say something about directory removal requiring -d, and not look like strerror(EISDIR). Or since directory removal is prohibited by the kernel, the -d option can never work, so it should have been removed ~10 years ago when the kernel was changed to prohibit it. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 20:25:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5883510656AE; Wed, 17 Feb 2010 20:25:58 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 169368FC21; Wed, 17 Feb 2010 20:25:57 +0000 (UTC) Received: by pxi12 with SMTP id 12so5105351pxi.33 for ; Wed, 17 Feb 2010 12:25:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=g8V05duK29zLGbrB6RmVYN72OVZ4sgspfE0UtXip8aw=; b=dEZkluGqVu1SVKZgkfR7FCI01Jf41TpazNGLX8Ff5tckGP9vWGXNEKPNM5B7L1jlR2 RRbVJBYaOpKrwUC7N/Wxfne2J0EH/2BGpPC4YRkylRnCZM3aWOzVBC9q7A/j4F44h0bj IO8SDW/8wjPgRV4vqRXcevHyZZf1eG6SCGsYA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=HgLSwVZZgps8bFvPWTNinH1wZEdCXrmvqZ5cnCp/aTmRjPPW8qV7B6u3bVGeVDW1eV qA0nnk6iG5RMq0vcyx1UmPc10zUw4q/zDWlsUqcnjfK4IhfrLgHw5otchZsYlj6tay9r YlDPkb6Dh9tM2fh+DJxaOI6dd/pc8v9+Pr+sk= MIME-Version: 1.0 Received: by 10.143.24.10 with SMTP id b10mr1830610wfj.253.1266438356370; Wed, 17 Feb 2010 12:25:56 -0800 (PST) In-Reply-To: <20100218055229.Q1735@besplex.bde.org> References: <201002170911.o1H9BL6m095996@svn.freebsd.org> <20100218044931.S95007@delplex.bde.org> <20100218055229.Q1735@besplex.bde.org> Date: Wed, 17 Feb 2010 12:25:56 -0800 Message-ID: <7d6fde3d1002171225n5b6ebc2eyb85ffbfacb594da9@mail.gmail.com> From: Garrett Cooper To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Poul-Henning Kamp Subject: Re: svn commit: r203990 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 20:25:58 -0000 On Wed, Feb 17, 2010 at 11:13 AM, Bruce Evans wrote: > On Thu, 18 Feb 2010, Bruce Evans wrote: > >> On Wed, 17 Feb 2010, Poul-Henning Kamp wrote: >> >>> Log: >>> =A0Mention EISDIR as a possible errno. >> >> It's not a possible error. >> >>> ... > > Related bug: unlink(1) bogusly prints a messages that looks like > strerror(EISDIR). =A0It doesn't even try unlink(2) on directories, > but prints this message from a private string. > > %%% > Script started on Thu Feb 18 05:49:45 2010 > ttyp0:bde@besplex:/tmp/z> mkdir z > ttyp0:bde@besplex:/tmp/z> /bin/unlink z > unlink: z: is a directory > ttyp0:bde@besplex:/tmp/z> truss /bin/unlink z > lstat("z",0xbfbfe840) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0=3D 0 (0x0) > unlink: write(2,0xbfbfe0b0,8) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0=3D 8 (0x8) > z: is a directorywrite(2,0xbfbfe0d0,17) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0=3D 17 (0x11) > > write(2,0x80a6753,1) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =3D 1 (0x1) > exit(0x1) process exit, rval =3D 256 > %%% > > Here I use /bin/unlink since the unlink in $PATH is missing the bug. > > /bin/unlink is a link to /bin/rm. =A0rm(1) takes a -d flag which should > do the right thing for unlink, but this flag is neither settable nor > forced for unlink(1). > > The above behaviour of unlink(1) is not permitted by POSIX or unlink(1)'s > man page: > > POSIX (old draft, no change in current version): > %%% > 36900 =A0 =A0 =A0 =A0 =A0 =A0The unlink utility shall perform the functio= n call: > 36901 =A0 =A0 =A0 =A0 =A0 =A0unlink(file); > 36902 =A0 =A0 =A0 =A0 =A0 =A0A user may need appropriate privilege to inv= oke the unlink > utility. > %%% > > Man page: > %%% > =A0 =A0 When the utility is called as unlink, only one argument, which mu= st not > =A0 =A0 be a directory, may be supplied. =A0No options may be supplied in= this > sim- > =A0 =A0 ple mode of operation, which performs an unlink(2) operation on t= he > =A0 =A0 passed argument. > > STANDARDS > =A0 =A0 The rm command conforms to IEEE Std 1003.2 (``POSIX.2''). > > =A0 =A0 The simplified unlink command conforms to Version 2 of the Single= UNIX > =A0 =A0 Specification (``SUSv2''). > %%% > > Oops, the man page actually says that the arg must not be a directory. > > POSIX doesn't make this restriction, except by possibly requiring > appropriate privilege, which can be interpreted as "more privilege > than exists" if the file is a directory so as to make FreeBSD conform > (except the error must involve unlink(1) not being invokable in this > case :-). =A0POSIX doesn't specify the form of the diagnostic message for > any case. > > Anyway, unlink(1) shouldn't fall into rm(1)'s error handling to to > print its diagnostic. =A0It should use a special message (matching its > man page) for directories, or just try unlink(2). > > rm(1)'s current special message should say something about directory > removal requiring -d, and not look like strerror(EISDIR). =A0Or since > directory removal is prohibited by the kernel, the -d option can never > work, so it should have been removed ~10 years ago when the kernel was > changed to prohibit it. 1. Where is EISDIR used in rm(1)? [garrcoop@garrcoop-fbsd /usr/src/sys]$ grep EISDIR ../bin/rm/rm.c [garrcoop@garrcoop-fbsd /usr/src/sys]$ uname -a FreeBSD garrcoop-fbsd.cisco.com 8.0-STABLE FreeBSD 8.0-STABLE #2: Wed Feb 3 16:57:07 PST 2010 garrcoop@garrcoop-fbsd.cisco.com:/usr/obj/usr/src/sys/LAPPY_X86 i386 2. phk's example in a latter email used unlink(2), not unlink(1). Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 20:31:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 580AF106568B; Wed, 17 Feb 2010 20:31:12 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1B5B58FC19; Wed, 17 Feb 2010 20:31:11 +0000 (UTC) Received: by pxi12 with SMTP id 12so5109328pxi.33 for ; Wed, 17 Feb 2010 12:31:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=z3IQKdeHLrUfWAkvdY8mhKFATQ6fb2Wts/C/Er73NNc=; b=QmFmE1OMMZF3/oC3Z9EKqhTo7FF6I5YsmSEFZIr17e/5DRK19WwfcWYn+TaLCWOh2/ 1QFeOe0ktI8ldBDdWRKEvTaHFth+CT31wPbZrisYt9z57l3AH5M0Kqc9WP3zb0/Eey9x uU94wHa3/PLS6y4hNyjhCtkxpt8OmAPp9UC4w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=hJtjUiyvv3C2wc18uMFGSimaepyItzAzi7AkGzxxKTABRD1XAR7uOWNZGN3saerL9f KN1JmCAA1gPnH6CdrqV4aUQVua0DOgQ5sXlDCSGWrBoTlgRJbmMdGxxhGe5dKPMi95DX 51B9OUmT5FuAAAezhQgAbGbAKi6eqwxr1FXWM= MIME-Version: 1.0 Received: by 10.142.247.33 with SMTP id u33mr5648801wfh.219.1266438671529; Wed, 17 Feb 2010 12:31:11 -0800 (PST) In-Reply-To: <201002170911.o1H9BL6m095996@svn.freebsd.org> References: <201002170911.o1H9BL6m095996@svn.freebsd.org> Date: Wed, 17 Feb 2010 12:31:11 -0800 Message-ID: <7d6fde3d1002171231u163ce4ao18478f4af6180d1b@mail.gmail.com> From: Garrett Cooper To: Poul-Henning Kamp Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r203990 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 20:31:12 -0000 On Wed, Feb 17, 2010 at 1:11 AM, Poul-Henning Kamp wrote: > Author: phk > Date: Wed Feb 17 09:11:21 2010 > New Revision: 203990 > URL: http://svn.freebsd.org/changeset/base/203990 > > Log: > =A0Mention EISDIR as a possible errno. > > Modified: > =A0head/lib/libc/sys/unlink.2 > > Modified: head/lib/libc/sys/unlink.2 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libc/sys/unlink.2 =A0Wed Feb 17 09:09:12 2010 =A0 =A0 =A0 = =A0(r203989) > +++ head/lib/libc/sys/unlink.2 =A0Wed Feb 17 09:11:21 2010 =A0 =A0 =A0 = =A0(r203990) > @@ -114,6 +114,8 @@ succeeds unless: > =A0.Bl -tag -width Er > =A0.It Bq Er ENOTDIR > =A0A component of the path prefix is not a directory. > +.It Bq Er EISDIR > +The named file is a directory. > =A0.It Bq Er ENAMETOOLONG > =A0A component of a pathname exceeded 255 characters, > =A0or an entire path name exceeded 1023 characters. This is wrong as per POSIX (): [EPERM] The file named by path is a directory, and either the calling process does not have appropriate privileges, or the implementation prohibits using unlink() on directories. ... and the current manpage ... [EPERM] The named file is a directory. The manpage needs to be modified to note that, or the offender needs to be fixed. Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 20:31:56 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C12731065679; Wed, 17 Feb 2010 20:31:56 +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 597488FC18; Wed, 17 Feb 2010 20:31:56 +0000 (UTC) Received: from besplex.bde.org (c122-106-163-215.carlnfd1.nsw.optusnet.com.au [122.106.163.215]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o1HKVpPi012911 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Feb 2010 07:31:53 +1100 Date: Thu, 18 Feb 2010 07:31:51 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Poul-Henning Kamp In-Reply-To: <6413.1266433105@critter.freebsd.dk> Message-ID: <20100218064545.J2074@besplex.bde.org> References: <6413.1266433105@critter.freebsd.dk> 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: r203990 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 20:31:56 -0000 On Wed, 17 Feb 2010, Poul-Henning Kamp wrote: > In message <20100218044931.S95007@delplex.bde.org>, Bruce Evans writes: >> On Wed, 17 Feb 2010, Poul-Henning Kamp wrote: >> >>> Log: >>> Mention EISDIR as a possible errno. >> >> It's not a possible error. > > critter phk> cat > a.c > #include > #include > > int > main(int argc, char **argv) > { > if (unlink("/")) > err(1, "Told you so"); > return (0); > } > critter phk> cc a.c > critter phk> ./a.out > a.out: Told you so: Is a directory > critter phk> Better fix the kernel bug than break the documentation then. The bug is very old -- it happens in ~5.2, where the code is a bit easier to understand: % int % kern_unlink(struct thread *td, char *path, enum uio_seg pathseg) % { % struct mount *mp; % struct vnode *vp; % int error; % struct nameidata nd; % % restart: % bwillwrite(); % NDINIT(&nd, DELETE, NOFOLLOW | LOCKPARENT | LOCKLEAF, pathseg, path, % td); % if ((error = namei(&nd)) != 0) % return (error); namei() returns EISDIR for "/" (due to DELETE and and the special handling of the degenerate case which includes "/" and not much else, else the bug would affect more cases). Then we return the wrong errno before we test VDIR. % vp = nd.ni_vp; % if (vp->v_type == VDIR) % error = EPERM; % else { Untested fix for ~5.2. Also fixes some style bugs. % Index: vfs_syscalls.c % =================================================================== % RCS file: /home/ncvs/src/sys/kern/vfs_syscalls.c,v % retrieving revision 1.354 % diff -u -2 -r1.354 vfs_syscalls.c % --- vfs_syscalls.c 24 Jun 2004 17:22:29 -0000 1.354 % +++ vfs_syscalls.c 17 Feb 2010 20:01:09 -0000 % @@ -1614,10 +1605,11 @@ % restart: % bwillwrite(); % - NDINIT(&nd, DELETE, LOCKPARENT|LOCKLEAF, pathseg, path, td); % + NDINIT(&nd, DELETE, NOFOLLOW | LOCKPARENT | LOCKLEAF, pathseg, path, % + td); Style fixes: - spell out NOFOLLOW (NOFOLLOW is 0, so omitting it is just confusing). This bug is in about 3 other vfs syscalls. - there are spaces around binary operators in KNF. These spaces are especially important for the "|" operator since this operator looks more like an alphanumeric character than most operator symbols, but they are most often omitted for this operator :-(. % if ((error = namei(&nd)) != 0) % - return (error); % + return (error == EISDIR ? EPERM : error); Fix the EISDIR bug. % vp = nd.ni_vp; % if (vp->v_type == VDIR) % - error = EPERM; /* POSIX */ % + error = EPERM; Remove banal/misleading comment. The new fixup needs a comment more than this, but I don't want to add one. % else { % /* ISTR trying to avoid the special handling for the degenerate case in namei() and lookup() (2 almost identical copies of it). The correct fix may be there. From lookup() in ~5.2: % /* % * Check for degenerate name (e.g. / or "") % * which is a way of talking about a directory, % * e.g. like "/." or ".". % */ % if (cnp->cn_nameptr[0] == '\0') { % if (dp->v_type != VDIR) { % error = ENOTDIR; % goto bad; % } % if (cnp->cn_nameiop != LOOKUP) { % error = EISDIR; % goto bad; % } Cases with trailing slashes are handled by removing the slash, but this doesn't work for "/" since we don't want to end up with the fully degenerate name of "". Cases starting with this fully degnerate name haven't been permitted since ~1988 when POSIX disallowed it, but the comment in the code hasn't caught up with this. The comment gives these cases as examples only, but I think that is another bug and that this is a complete list of degenerate names so the comment should say "i.e.,". After catching up with 1988 and removing "" from the list, only "/" remains. This is not really degenerate and can hopefully be handled more directly and simply. The != VDIR case in the above might already be unreachable. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 20:41:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35AE01065672; Wed, 17 Feb 2010 20:41:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id BC8698FC0C; Wed, 17 Feb 2010 20:41:15 +0000 (UTC) Received: from besplex.bde.org (c122-106-163-215.carlnfd1.nsw.optusnet.com.au [122.106.163.215]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o1HKfClT004453 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 18 Feb 2010 07:41:13 +1100 Date: Thu, 18 Feb 2010 07:41:12 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper In-Reply-To: <7d6fde3d1002171225n5b6ebc2eyb85ffbfacb594da9@mail.gmail.com> Message-ID: <20100218073347.O2621@besplex.bde.org> References: <201002170911.o1H9BL6m095996@svn.freebsd.org> <20100218044931.S95007@delplex.bde.org> <20100218055229.Q1735@besplex.bde.org> <7d6fde3d1002171225n5b6ebc2eyb85ffbfacb594da9@mail.gmail.com> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-828759399-1266439272=:2621" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Poul-Henning Kamp , Bruce Evans Subject: Re: svn commit: r203990 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 20:41:16 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-828759399-1266439272=:2621 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Wed, 17 Feb 2010, Garrett Cooper wrote: > On Wed, Feb 17, 2010 at 11:13 AM, Bruce Evans wrot= e: >> On Thu, 18 Feb 2010, Bruce Evans wrote: >>>> ... >> >> Related bug: unlink(1) bogusly prints a messages that looks like >> strerror(EISDIR). =A0It doesn't even try unlink(2) on directories, >> but prints this message from a private string. >> ... >> Anyway, unlink(1) shouldn't fall into rm(1)'s error handling to to >> print its diagnostic. =A0It should use a special message (matching its >> man page) for directories, or just try unlink(2). >> >> rm(1)'s current special message should say something about directory >> removal requiring -d, and not look like strerror(EISDIR). =A0Or since >> directory removal is prohibited by the kernel, the -d option can never >> work, so it should have been removed ~10 years ago when the kernel was >> changed to prohibit it. > > 1. Where is EISDIR used in rm(1)? Nowhere. As described above, unlink[rm](1) prints a message that looks like sterror(EISDIR) from a private string. It doesn't even fake the string properly (the real message capitalizes "Is"). > 2. phk's example in a latter email used unlink(2), not unlink(1). My first reply was about unlink(2). My second reply was originally about the related bug in unlink(1) but expanded to cover related bugs in rm(1). Bruce --0-828759399-1266439272=:2621-- From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 21:01:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1DE31065676; Wed, 17 Feb 2010 21:01:33 +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 B1AE58FC13; Wed, 17 Feb 2010 21:01:33 +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 5BA1346B23; Wed, 17 Feb 2010 16:01:33 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 7F20A8A01F; Wed, 17 Feb 2010 16:01:32 -0500 (EST) From: John Baldwin To: Ulrich =?iso-8859-1?q?Sp=F6rlein?= Date: Wed, 17 Feb 2010 15:56:08 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20100120; KDE/4.3.1; amd64; ; ) References: <201002151510.o1FFAMgv035651@svn.freebsd.org> <201002171143.57885.jhb@freebsd.org> <20100217185133.GL57731@acme.spoerlein.net> In-Reply-To: <20100217185133.GL57731@acme.spoerlein.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201002171556.08395.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 17 Feb 2010 16:01:32 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r203926 - in head/games/fortune: fortune strfile unstr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 21:01:34 -0000 On Wednesday 17 February 2010 1:51:33 pm Ulrich Sp=F6rlein wrote: > On Wed, 17.02.2010 at 11:43:57 -0500, John Baldwin wrote: > > On Monday 15 February 2010 10:10:22 am Ulrich Spoerlein wrote: > > > Author: uqs > > > Date: Mon Feb 15 15:10:21 2010 > > > New Revision: 203926 > > > URL: http://svn.freebsd.org/changeset/base/203926 > > >=20 > > > Log: > > > fortune(6) switch to 3-clause BSDL; style(9) > > > =20 > > > This reduces the diff to other *BSD and makes it possible to actual= ly > > > see the code differences. > > > =20 > > > Approved by: ed (Co-mentor) > >=20 > > There appear to be a lot of unrelated changes to at least fortune.c in = this=20 > > commit. >=20 > Hi John, >=20 > care to elaborate? The commit log says that style(9) has been applied > and it is a diff reduction commit in general. >=20 > That said, the only object code altering change is the replacing of > exit(0) with return(0) at the end of main(). There's nothing definitive > in style(9) about that ... Oh, I missed the 'style(9)' bit. A full sentence and even separate line items such as: =2D Switch to a 3-clause BSD license. =2D Various style(9) fixes. might help to reduce any confusion in the future. =2D-=20 John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 21:16:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8E381065692; Wed, 17 Feb 2010 21:16:41 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 903A88FC18; Wed, 17 Feb 2010 21:16:41 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 65D051FFC22; Wed, 17 Feb 2010 21:16:40 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 01A0D844C2; Wed, 17 Feb 2010 22:16:39 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Ulrich =?utf-8?Q?Sp=C3=B6rlein?= References: <201002151510.o1FFAMgv035651@svn.freebsd.org> <201002171143.57885.jhb@freebsd.org> <20100217185133.GL57731@acme.spoerlein.net> Date: Wed, 17 Feb 2010 22:16:39 +0100 In-Reply-To: <20100217185133.GL57731@acme.spoerlein.net> ("Ulrich =?utf-8?Q?Sp=C3=B6rlein=22's?= message of "Wed, 17 Feb 2010 19:51:33 +0100") Message-ID: <861vgjzhoo.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 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, John Baldwin Subject: Re: svn commit: r203926 - in head/games/fortune: fortune strfile unstr X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 21:16:41 -0000 Ulrich Sp=C3=B6rlein writes: > That said, the only object code altering change is the replacing of > exit(0) with return(0) at the end of main(). That's a regression. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 22:22:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 435301065679; Wed, 17 Feb 2010 22:22:21 +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 32D628FC0C; Wed, 17 Feb 2010 22:22: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 o1HMMLm3073902; Wed, 17 Feb 2010 22:22:21 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1HMML9A073900; Wed, 17 Feb 2010 22:22:21 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201002172222.o1HMML9A073900@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 17 Feb 2010 22:22: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: r204016 - head/tools/regression/bin/sh/expansion X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 22:22:21 -0000 Author: jilles Date: Wed Feb 17 22:22:20 2010 New Revision: 204016 URL: http://svn.freebsd.org/changeset/base/204016 Log: sh: arith: Test an octal constant as well. Modified: head/tools/regression/bin/sh/expansion/arith2.0 Modified: head/tools/regression/bin/sh/expansion/arith2.0 ============================================================================== --- head/tools/regression/bin/sh/expansion/arith2.0 Wed Feb 17 22:10:47 2010 (r204015) +++ head/tools/regression/bin/sh/expansion/arith2.0 Wed Feb 17 22:22:20 2010 (r204016) @@ -22,6 +22,7 @@ check "4611686018427387904" 461168601842 check "0x4000000000000000" 4611686018427387904 check "0400000000000000000000" 4611686018427387904 check "0x4Ab0000000000000" 5381801554707742720 +check "010" 8 # try out all operators v=42 From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 22:25:23 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17E55106566B; Wed, 17 Feb 2010 22:25:23 +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 0776E8FC19; Wed, 17 Feb 2010 22:25: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 o1HMPMJK074610; Wed, 17 Feb 2010 22:25:22 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1HMPMdt074608; Wed, 17 Feb 2010 22:25:22 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201002172225.o1HMPMdt074608@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 17 Feb 2010 22:25: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: r204017 - head/tools/regression/bin/sh/expansion X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 22:25:23 -0000 Author: jilles Date: Wed Feb 17 22:25:22 2010 New Revision: 204017 URL: http://svn.freebsd.org/changeset/base/204017 Log: sh: arith: Add a test for a bug in the dash arith code, which I plan to import at some point. Our current code handles it fine and it should stay that way. Added: head/tools/regression/bin/sh/expansion/arith3.0 (contents, props changed) Added: head/tools/regression/bin/sh/expansion/arith3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/arith3.0 Wed Feb 17 22:25:22 2010 (r204017) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +failures=0 + +check() { + if [ $(($1)) != $2 ]; then + failures=$((failures+1)) + echo "For $1, expected $2 actual $(($1))" + fi +} + +check "1 << 1 + 1 | 1" 5 + +exit $((failures != 0)) From owner-svn-src-head@FreeBSD.ORG Wed Feb 17 22:28:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D58BE106566B; Wed, 17 Feb 2010 22:28:37 +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 C59C08FC13; Wed, 17 Feb 2010 22:28: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 o1HMSb31075395; Wed, 17 Feb 2010 22:28:37 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1HMSbxA075393; Wed, 17 Feb 2010 22:28:37 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201002172228.o1HMSbxA075393@svn.freebsd.org> From: Ed Maste Date: Wed, 17 Feb 2010 22:28: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: r204019 - head/sys/dev/aac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 22:28:37 -0000 Author: emaste Date: Wed Feb 17 22:28:37 2010 New Revision: 204019 URL: http://svn.freebsd.org/changeset/base/204019 Log: Include command type in COMMAND TIMEOUT messages to aid in debugging. Modified: head/sys/dev/aac/aac.c Modified: head/sys/dev/aac/aac.c ============================================================================== --- head/sys/dev/aac/aac.c Wed Feb 17 22:28:32 2010 (r204018) +++ head/sys/dev/aac/aac.c Wed Feb 17 22:28:37 2010 (r204019) @@ -2352,8 +2352,9 @@ aac_timeout(struct aac_softc *sc) /* && !(cm->cm_flags & AAC_CMD_TIMEDOUT) */) { cm->cm_flags |= AAC_CMD_TIMEDOUT; device_printf(sc->aac_dev, - "COMMAND %p TIMEOUT AFTER %d SECONDS\n", - cm, (int)(time_uptime-cm->cm_timestamp)); + "COMMAND %p (TYPE %d) TIMEOUT AFTER %d SECONDS\n", + cm, cm->cm_fib->Header.Command, + (int)(time_uptime-cm->cm_timestamp)); AAC_PRINT_FIB(sc, cm->cm_fib); timedout++; } From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 01:44:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 833DD1065672; Thu, 18 Feb 2010 01:44:48 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 724478FC16; Thu, 18 Feb 2010 01:44: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 o1I1imMQ018731; Thu, 18 Feb 2010 01:44:48 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1I1imGp018729; Thu, 18 Feb 2010 01:44:48 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002180144.o1I1imGp018729@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 18 Feb 2010 01:44: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: r204024 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 01:44:48 -0000 Author: marcel Date: Thu Feb 18 01:44:48 2010 New Revision: 204024 URL: http://svn.freebsd.org/changeset/base/204024 Log: Unbreak WARNS=6 builds for C++ code: -Wold-style-definition is not accepted by the C++ compiler. Filter it out. Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Thu Feb 18 01:15:58 2010 (r204023) +++ head/share/mk/sys.mk Thu Feb 18 01:44:48 2010 (r204024) @@ -66,7 +66,7 @@ CFLAGS += -g .endif CXX ?= c++ -CXXFLAGS ?= ${CFLAGS:N-std=*:N-Wnested-externs:N-W*-prototypes:N-Wno-pointer-sign} +CXXFLAGS ?= ${CFLAGS:N-std=*:N-Wnested-externs:N-W*-prototypes:N-Wno-pointer-sign:N-Wold-style-definition} PO_CXXFLAGS ?= ${CXXFLAGS} CPP ?= cpp From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 02:06:58 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14D97106566C; Thu, 18 Feb 2010 02:06:58 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03AF58FC12; Thu, 18 Feb 2010 02:06: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 o1I26vUl023581; Thu, 18 Feb 2010 02:06:57 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1I26vjl023579; Thu, 18 Feb 2010 02:06:57 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002180206.o1I26vjl023579@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 18 Feb 2010 02:06: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: r204025 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 02:06:58 -0000 Author: marcel Date: Thu Feb 18 02:06:57 2010 New Revision: 204025 URL: http://svn.freebsd.org/changeset/base/204025 Log: Allow suppression of -Wcast-align for WARNS>=4 by defining NO_WCAST_ALIGN. The headers of the standard C++ library are not 64-bit clean and trigger the warning. This prevents use of WARNS>=4 on ia64 for example. Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Thu Feb 18 01:44:48 2010 (r204024) +++ head/share/mk/bsd.sys.mk Thu Feb 18 02:06:57 2010 (r204025) @@ -43,7 +43,10 @@ CWARNFLAGS += -W -Wno-unused-parameter - . endif . if ${WARNS} >= 4 CWARNFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch\ - -Wshadow -Wcast-align -Wunused-parameter + -Wshadow -Wunused-parameter +. if !defined(NO_WCAST_ALIGN) +CWARNFLAGS += -Wcast-align +. endif . endif # BDECFLAGS . if ${WARNS} >= 6 From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 03:32:52 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFF1D106566B; Thu, 18 Feb 2010 03:32:51 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8558A8FC0C; Thu, 18 Feb 2010 03:32: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 o1I3WpVH042685; Thu, 18 Feb 2010 03:32:51 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1I3WpBd042683; Thu, 18 Feb 2010 03:32:51 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002180332.o1I3WpBd042683@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 18 Feb 2010 03:32: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: r204027 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 03:32:52 -0000 Author: marcel Date: Thu Feb 18 03:32:51 2010 New Revision: 204027 URL: http://svn.freebsd.org/changeset/base/204027 Log: Also add DEBUG_FLAGS to CXXFLAGS if defined. Modified: head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Thu Feb 18 02:37:23 2010 (r204026) +++ head/share/mk/bsd.prog.mk Thu Feb 18 03:32:51 2010 (r204027) @@ -17,6 +17,7 @@ NO_WERROR= .if defined(DEBUG_FLAGS) CFLAGS+=${DEBUG_FLAGS} +CXXFLAGS+=${DEBUG_FLAGS} .if !defined(NO_CTF) && (${DEBUG_FLAGS:M-g} != "") CTFFLAGS+= -g From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 05:14:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 665B1106566B; Thu, 18 Feb 2010 05:14:36 +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 566868FC12; Thu, 18 Feb 2010 05:14: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 o1I5EaX5065027; Thu, 18 Feb 2010 05:14:36 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1I5EaP3065025; Thu, 18 Feb 2010 05:14:36 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002180514.o1I5EaP3065025@svn.freebsd.org> From: Warner Losh Date: Thu, 18 Feb 2010 05:14: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: r204030 - head/usr.bin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 05:14:36 -0000 Author: imp Date: Thu Feb 18 05:14:36 2010 New Revision: 204030 URL: http://svn.freebsd.org/changeset/base/204030 Log: bc and dc are not BSD version, not GNU version. Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu Feb 18 05:12:05 2010 (r204029) +++ head/usr.bin/Makefile Thu Feb 18 05:14:36 2010 (r204030) @@ -5,7 +5,7 @@ # XXX MISSING: deroff diction graph learn plot # spell spline struct xsend -# XXX Use GNU versions: apropos bc dc diff grep ld man patch whatis +# XXX Use GNU versions: apropos diff grep ld man patch whatis # Moved to secure: bdes # From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 05:19:17 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FA781065679; Thu, 18 Feb 2010 05:19:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id A4E9A8FC28; Thu, 18 Feb 2010 05:19:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o1I59Jh7059667; Wed, 17 Feb 2010 22:09:19 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 17 Feb 2010 22:09:35 -0700 (MST) Message-Id: <20100217.220935.1104512900358221705.imp@bsdimp.com> To: marcel@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <201002180206.o1I26vjl023579@svn.freebsd.org> References: <201002180206.o1I26vjl023579@svn.freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r204025 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 05:19:17 -0000 In message: <201002180206.o1I26vjl023579@svn.freebsd.org> Marcel Moolenaar writes: : Allow suppression of -Wcast-align for WARNS>=4 by defining : NO_WCAST_ALIGN. The headers of the standard C++ library are : not 64-bit clean and trigger the warning. This prevents use : of WARNS>=4 on ia64 for example. Even 32-bit ARM has issues with alignment and things like data puning of types like sockaddr. Warner From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 05:49:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 915B4106566B; Thu, 18 Feb 2010 05:49:53 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E8FF8FC0C; Thu, 18 Feb 2010 05:49: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 o1I5nr8k072844; Thu, 18 Feb 2010 05:49:53 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1I5nruS072838; Thu, 18 Feb 2010 05:49:53 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201002180549.o1I5nruS072838@svn.freebsd.org> From: Neel Natu Date: Thu, 18 Feb 2010 05:49: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: r204031 - in head: share/mk sys/conf sys/kern sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 05:49:53 -0000 Author: neel Date: Thu Feb 18 05:49:52 2010 New Revision: 204031 URL: http://svn.freebsd.org/changeset/base/204031 Log: Kernel module support for mips. Reviewed by: gonzo Tested by: Alexandr Rybalko (ray@dlink.ua) Modified: head/share/mk/bsd.cpu.mk head/sys/conf/files.mips head/sys/conf/kmod.mk head/sys/kern/link_elf_obj.c head/sys/mips/mips/elf_machdep.c Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Thu Feb 18 05:14:36 2010 (r204030) +++ head/share/mk/bsd.cpu.mk Thu Feb 18 05:49:52 2010 (r204031) @@ -203,11 +203,9 @@ LD += -EB .if ${MACHINE_ARCH} == "mips" . if defined(TARGET_BIG_ENDIAN) CFLAGS += -EB -LDFLAGS += -Wl,-EB LD += -EB . else CFLAGS += -EL -LDFLAGS += -Wl,-EL LD += -EL . endif CFLAGS += -msoft-float -G0 -mno-dsp -mabicalls Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Thu Feb 18 05:14:36 2010 (r204030) +++ head/sys/conf/files.mips Thu Feb 18 05:49:52 2010 (r204031) @@ -89,6 +89,8 @@ libkern/umoddi3.c optional isa_mips32 #libkern/mips/strcmp.S standard #libkern/mips/strncmp.S standard +kern/link_elf_obj.c standard + dev/cfe/cfe_api.c optional cfe dev/cfe/cfe_console.c optional cfe_console dev/cfe/cfe_env.c optional cfe_env Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Thu Feb 18 05:14:36 2010 (r204030) +++ head/sys/conf/kmod.mk Thu Feb 18 05:49:52 2010 (r204031) @@ -128,6 +128,10 @@ CFLAGS+= -fno-omit-frame-pointer CFLAGS+= -mlongcall -fno-omit-frame-pointer .endif +.if ${MACHINE_ARCH} == "mips" +CFLAGS+= -G0 -fno-pic -mno-abicalls -mlong-calls +.endif + .if defined(FIRMWS) .if !exists(@) ${KMOD:S/$/.c/}: @ @@ -174,7 +178,7 @@ ${PROG}.symbols: ${FULLPROG} ${OBJCOPY} --only-keep-debug ${FULLPROG} ${.TARGET} .endif -.if ${MACHINE_ARCH} != amd64 +.if ${MACHINE_ARCH} != amd64 && ${MACHINE_ARCH} != mips ${FULLPROG}: ${KMOD}.kld ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${KMOD}.kld .if !defined(DEBUG_FLAGS) @@ -187,7 +191,7 @@ EXPORT_SYMS?= NO CLEANFILES+= export_syms .endif -.if ${MACHINE_ARCH} != amd64 +.if ${MACHINE_ARCH} != amd64 && ${MACHINE_ARCH} != mips ${KMOD}.kld: ${OBJS} .else ${FULLPROG}: ${OBJS} @@ -206,7 +210,8 @@ ${FULLPROG}: ${OBJS} export_syms | xargs -J% ${OBJCOPY} % ${.TARGET} .endif .endif -.if !defined(DEBUG_FLAGS) && ${MACHINE_ARCH} == amd64 +.if !defined(DEBUG_FLAGS) && \ + (${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == mips) ${OBJCOPY} --strip-debug ${.TARGET} .endif Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Thu Feb 18 05:14:36 2010 (r204030) +++ head/sys/kern/link_elf_obj.c Thu Feb 18 05:49:52 2010 (r204031) @@ -853,8 +853,8 @@ link_elf_load_file(linker_class_t cls, c panic("lost relatab"); if (mapbase != (vm_offset_t)ef->address + mapsize) panic("mapbase 0x%lx != address %p + mapsize 0x%lx (0x%lx)\n", - mapbase, ef->address, mapsize, - (vm_offset_t)ef->address + mapsize); + (u_long)mapbase, ef->address, (u_long)mapsize, + (u_long)(vm_offset_t)ef->address + mapsize); /* Local intra-module relocations */ link_elf_reloc_local(lf); Modified: head/sys/mips/mips/elf_machdep.c ============================================================================== --- head/sys/mips/mips/elf_machdep.c Thu Feb 18 05:14:36 2010 (r204030) +++ head/sys/mips/mips/elf_machdep.c Thu Feb 18 05:49:52 2010 (r204031) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #ifdef __mips_n64 struct sysentvec elf64_freebsd_sysvec = { @@ -163,7 +164,12 @@ elf_reloc_internal(linker_file_t lf, Elf Elf_Addr addend = (Elf_Addr)0; Elf_Word rtype = (Elf_Word)0, symidx; const Elf_Rel *rel; - const Elf_Rela *rela; + + /* + * Stash R_MIPS_HI16 info so we can use it when processing R_MIPS_LO16 + */ + static Elf_Addr ahl; + static Elf_Addr *where_hi16; switch (type) { case ELF_RELOC_REL: @@ -173,108 +179,63 @@ elf_reloc_internal(linker_file_t lf, Elf rtype = ELF_R_TYPE(rel->r_info); symidx = ELF_R_SYM(rel->r_info); break; - case ELF_RELOC_RELA: - rela = (const Elf_Rela *)data; - where = (Elf_Addr *) (relocbase + rela->r_offset); - addend = rela->r_addend; - rtype = ELF_R_TYPE(rela->r_info); - symidx = ELF_R_SYM(rela->r_info); - break; default: panic("unknown reloc type %d\n", type); } - if (local) { -#if 0 /* TBD */ - if (rtype == R_386_RELATIVE) { /* A + B */ - addr = elf_relocaddr(lf, relocbase + addend); - if (*where != addr) - *where = addr; - } - return (0); -#endif - } - switch (rtype) { + case R_MIPS_NONE: /* none */ + break; - case R_MIPS_NONE: /* none */ - break; + case R_MIPS_32: /* S + A */ + addr = lookup(lf, symidx, 1); + if (addr == 0) + return (-1); + addr += addend; + if (*where != addr) + *where = addr; + break; - case R_MIPS_16: /* S + sign-extend(A) */ - /* - * There shouldn't be R_MIPS_16 relocs in kernel objects. - */ - printf("kldload: unexpected R_MIPS_16 relocation\n"); - return -1; - break; - - case R_MIPS_32: /* S + A - P */ - addr = lookup(lf, symidx, 1); - if (addr == 0) - return -1; - addr += addend; - if (*where != addr) - *where = addr; - break; - - case R_MIPS_REL32: /* A - EA + S */ - /* - * There shouldn't be R_MIPS_REL32 relocs in kernel objects? - */ - printf("kldload: unexpected R_MIPS_REL32 relocation\n"); - return -1; - break; - - case R_MIPS_26: /* ((A << 2) | (P & 0xf0000000) + S) >> 2 */ - break; - - case R_MIPS_HI16: - /* extern/local: ((AHL + S) - ((short)(AHL + S)) >> 16 */ - /* _gp_disp: ((AHL + GP - P) - (short)(AHL + GP - P)) >> 16 */ - break; - - case R_MIPS_LO16: - /* extern/local: AHL + S */ - /* _gp_disp: AHL + GP - P + 4 */ - break; - - case R_MIPS_GPREL16: - /* extern/local: ((AHL + S) - ((short)(AHL + S)) >> 16 */ - /* _gp_disp: ((AHL + GP - P) - (short)(AHL + GP - P)) >> 16 */ - break; - - case R_MIPS_LITERAL: /* sign-extend(A) + L */ - break; - - case R_MIPS_GOT16: /* external: G */ - /* local: tbd */ - break; - - case R_MIPS_PC16: /* sign-extend(A) + S - P */ - break; - - case R_MIPS_CALL16: /* G */ - break; - - case R_MIPS_GPREL32: /* A + S + GP0 - GP */ - break; - - case R_MIPS_GOTHI16: /* (G - (short)G) >> 16 + A */ - break; - - case R_MIPS_GOTLO16: /* G & 0xffff */ - break; - - case R_MIPS_CALLHI16: /* (G - (short)G) >> 16 + A */ - break; - - case R_MIPS_CALLLO16: /* G & 0xffff */ - break; - - default: - printf("kldload: unexpected relocation type %d\n", - rtype); + case R_MIPS_26: /* ((A << 2) | (P & 0xf0000000) + S) >> 2 */ + addr = lookup(lf, symidx, 1); + if (addr == 0) return (-1); + + addend &= 0x03ffffff; + addend <<= 2; + + addr += ((Elf_Addr)where & 0xf0000000) | addend; + addr >>= 2; + + *where &= ~0x03ffffff; + *where |= addr & 0x03ffffff; + break; + + case R_MIPS_HI16: /* ((AHL + S) - ((short)(AHL + S)) >> 16 */ + ahl = addend << 16; + where_hi16 = where; + break; + + case R_MIPS_LO16: /* AHL + S */ + ahl += (int16_t)addend; + addr = lookup(lf, symidx, 1); + if (addr == 0) + return (-1); + + addend &= 0xffff0000; + addend |= (uint16_t)(ahl + addr); + *where = addend; + + addend = *where_hi16; + addend &= 0xffff0000; + addend |= ((ahl + addr) - (int16_t)(ahl + addr)) >> 16; + *where_hi16 = addend; + break; + + default: + printf("kldload: unexpected relocation type %d\n", + rtype); + return (-1); } return(0); } @@ -299,6 +260,11 @@ int elf_cpu_load_file(linker_file_t lf __unused) { + /* + * Sync the I and D caches to make sure our relocations are visible. + */ + mips_icache_sync_all(); + return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 06:54:59 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B23D1106568B; Thu, 18 Feb 2010 06:54:59 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from monday.kientzle.com (kientzle.com [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id 4CC708FC12; Thu, 18 Feb 2010 06:54:58 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.3/8.14.3) id o1I6t6PO071100; Thu, 18 Feb 2010 06:55:06 GMT (envelope-from kientzle@freebsd.org) Received: from dark.x.kientzle.com (fw2.kientzle.com [10.123.1.2]) by kientzle.com with SMTP id xhu7gah9jcrtcpu2wm2i34q6mn; Thu, 18 Feb 2010 06:55:06 +0000 (UTC) (envelope-from kientzle@freebsd.org) Message-ID: <4B7CE47E.4090500@freebsd.org> Date: Wed, 17 Feb 2010 22:55:58 -0800 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.21) Gecko/20090601 SeaMonkey/1.1.16 MIME-Version: 1.0 To: Garrett Cooper References: <201002170911.o1H9BL6m095996@svn.freebsd.org> <7d6fde3d1002171231u163ce4ao18478f4af6180d1b@mail.gmail.com> In-Reply-To: <7d6fde3d1002171231u163ce4ao18478f4af6180d1b@mail.gmail.com> 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, Poul-Henning Kamp Subject: Re: svn commit: r203990 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 06:54:59 -0000 Garrett Cooper wrote: > On Wed, Feb 17, 2010 at 1:11 AM, Poul-Henning Kamp wrote: >> Author: phk >> Date: Wed Feb 17 09:11:21 2010 >> New Revision: 203990 >> URL: http://svn.freebsd.org/changeset/base/203990 >> >> Log: >> Mention EISDIR as a possible errno. >> >> Modified: >> head/lib/libc/sys/unlink.2 > > This is wrong as per POSIX > (): > > [EPERM] > The file named by path is a directory, and either the calling process > does not have appropriate privileges, or the implementation prohibits > using unlink() on directories. On a not-entirely-unrelated note, I wonder if any of the POSIX experts around know whether POSIX specifies an errno value for this call: open("/", O_WRONLY | O_EXCL | O_CREAT, 0777) I ran into this puzzler back when I was trying to optimize the restore sequence for libarchive. As near as I've been able to tell, POSIX is ambiguous here: It requires EISDIR for open(O_WRONLY) on a dir and EEXIST for open(O_EXCL | O_CREAT) on an existing item but without any clear guidance on which of those takes priority in this case. Anyone think they know the answer? Cheers, Tim From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 09:55:46 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EEA2106566C; Thu, 18 Feb 2010 09:55:46 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by mx1.freebsd.org (Postfix) with ESMTP id 5BC508FC15; Thu, 18 Feb 2010 09:55:46 +0000 (UTC) Received: from a91-153-117-195.elisa-laajakaista.fi (a91-153-117-195.elisa-laajakaista.fi [91.153.117.195]) by gw03.mail.saunalahti.fi (Postfix) with SMTP id 9EC2A2167C8; Thu, 18 Feb 2010 11:55:39 +0200 (EET) Date: Thu, 18 Feb 2010 11:55:39 +0200 From: Jaakko Heinonen To: Bruce Evans Message-ID: <20100218095538.GA2318@a91-153-117-195.elisa-laajakaista.fi> References: <6413.1266433105@critter.freebsd.dk> <20100218064545.J2074@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100218064545.J2074@besplex.bde.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, Poul-Henning Kamp , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r203990 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 09:55:46 -0000 On 2010-02-18, Bruce Evans wrote: > > critter phk> ./a.out > > a.out: Told you so: Is a directory > > Better fix the kernel bug than break the documentation then. Seconded. > namei() returns EISDIR for "/" (due to DELETE and and the special handling > of the degenerate case which includes "/" and not much else, else the bug > would affect more cases). This causes a problem also for mkdir(2), rmdir(2) and rename(2). All of them incorrectly return EISDIR for "/". An open PR and some discussion: http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/59739 http://lists.freebsd.org/pipermail/freebsd-hackers/2009-November/029958.html -- Jaakko From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 13:46:54 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92C5A1065676; Thu, 18 Feb 2010 13:46:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81DF88FC13; Thu, 18 Feb 2010 13:46: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 o1IDks28080755; Thu, 18 Feb 2010 13:46:54 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IDks96080753; Thu, 18 Feb 2010 13:46:54 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201002181346.o1IDks96080753@svn.freebsd.org> From: Michael Tuexen Date: Thu, 18 Feb 2010 13:46: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: r204040 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 13:46:54 -0000 Author: tuexen Date: Thu Feb 18 13:46:54 2010 New Revision: 204040 URL: http://svn.freebsd.org/changeset/base/204040 Log: Use uint32_t instead of u_long. MFC after: 1 week Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Thu Feb 18 11:07:36 2010 (r204039) +++ head/sys/netinet/sctp_indata.c Thu Feb 18 13:46:54 2010 (r204040) @@ -3513,7 +3513,7 @@ sctp_handle_segments(struct mbuf *m, int static void sctp_check_for_revoked(struct sctp_tcb *stcb, struct sctp_association *asoc, uint32_t cumack, - u_long biggest_tsn_acked) + uint32_t biggest_tsn_acked) { struct sctp_tmit_chunk *tp1; int tot_revoked = 0; @@ -3595,7 +3595,7 @@ sctp_check_for_revoked(struct sctp_tcb * static void sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, struct sctp_association *asoc, - u_long biggest_tsn_acked, u_long biggest_tsn_newly_acked, u_long this_sack_lowest_newack, int accum_moved) + uint32_t biggest_tsn_acked, uint32_t biggest_tsn_newly_acked, uint32_t this_sack_lowest_newack, int accum_moved) { struct sctp_tmit_chunk *tp1; int strike_flag = 0; @@ -4781,7 +4781,7 @@ again: static void sctp_check_for_nr_revoked(struct sctp_tcb *stcb, struct sctp_association *asoc, uint32_t cumack, - u_long biggest_tsn_acked) + uint32_t biggest_tsn_acked) { struct sctp_tmit_chunk *tp1; From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 14:28:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EA3E1065670; Thu, 18 Feb 2010 14:28:39 +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 0DF3A8FC16; Thu, 18 Feb 2010 14:28: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 o1IEScoM090108; Thu, 18 Feb 2010 14:28:38 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IEScJO090104; Thu, 18 Feb 2010 14:28:38 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201002181428.o1IEScJO090104@svn.freebsd.org> From: Ed Schouten Date: Thu, 18 Feb 2010 14:28: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: r204041 - in head/sys: amd64/amd64 i386/i386 i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 14:28:39 -0000 Author: ed Date: Thu Feb 18 14:28:38 2010 New Revision: 204041 URL: http://svn.freebsd.org/changeset/base/204041 Log: Allow the pmap code to be built with GCC from FreeBSD 7 again. This patch basically gives us the best of both worlds. Instead of forcing the compiler to emulate GNU-style inline semantics even though we're using ISO C99, it will only use GNU-style inlining when the compiler is configured that way (__GNUC_GNU_INLINE__). Tested by: jhb Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c head/sys/i386/xen/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Feb 18 13:46:54 2010 (r204040) +++ head/sys/amd64/amd64/pmap.c Thu Feb 18 14:28:38 2010 (r204041) @@ -151,7 +151,11 @@ __FBSDID("$FreeBSD$"); #endif #if !defined(DIAGNOSTIC) +#ifdef __GNUC_GNU_INLINE__ +#define PMAP_INLINE inline +#else #define PMAP_INLINE extern inline +#endif #else #define PMAP_INLINE #endif Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Feb 18 13:46:54 2010 (r204040) +++ head/sys/i386/i386/pmap.c Thu Feb 18 14:28:38 2010 (r204041) @@ -162,7 +162,11 @@ __FBSDID("$FreeBSD$"); #endif #if !defined(DIAGNOSTIC) +#ifdef __GNUC_GNU_INLINE__ +#define PMAP_INLINE inline +#else #define PMAP_INLINE extern inline +#endif #else #define PMAP_INLINE #endif Modified: head/sys/i386/xen/pmap.c ============================================================================== --- head/sys/i386/xen/pmap.c Thu Feb 18 13:46:54 2010 (r204040) +++ head/sys/i386/xen/pmap.c Thu Feb 18 14:28:38 2010 (r204041) @@ -173,7 +173,11 @@ __FBSDID("$FreeBSD$"); #endif #if !defined(PMAP_DIAGNOSTIC) +#ifdef __GNUC_GNU_INLINE__ +#define PMAP_INLINE inline +#else #define PMAP_INLINE extern inline +#endif #else #define PMAP_INLINE #endif From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 14:48:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FC62106568B; Thu, 18 Feb 2010 14:48:42 +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 23F278FC12; Thu, 18 Feb 2010 14:48:42 +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 D26CA46B39; Thu, 18 Feb 2010 09:48:41 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 32D4F8A026; Thu, 18 Feb 2010 09:48:41 -0500 (EST) From: John Baldwin To: Ed Schouten Date: Thu, 18 Feb 2010 09:48:29 -0500 User-Agent: KMail/1.12.1 (FreeBSD/7.2-CBSD-20100120; KDE/4.3.1; amd64; ; ) References: <201002181428.o1IEScJO090104@svn.freebsd.org> In-Reply-To: <201002181428.o1IEScJO090104@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201002180948.29343.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 18 Feb 2010 09:48:41 -0500 (EST) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.5 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204041 - in head/sys: amd64/amd64 i386/i386 i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 14:48:42 -0000 On Thursday 18 February 2010 9:28:38 am Ed Schouten wrote: > Author: ed > Date: Thu Feb 18 14:28:38 2010 > New Revision: 204041 > URL: http://svn.freebsd.org/changeset/base/204041 > > Log: > Allow the pmap code to be built with GCC from FreeBSD 7 again. > > This patch basically gives us the best of both worlds. Instead of > forcing the compiler to emulate GNU-style inline semantics even though > we're using ISO C99, it will only use GNU-style inlining when the > compiler is configured that way (__GNUC_GNU_INLINE__). > > Tested by: jhb Thanks! -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 15:00:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA49B106566B; Thu, 18 Feb 2010 15:00:43 +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 D8A978FC15; Thu, 18 Feb 2010 15:00: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 o1IF0hbi097284; Thu, 18 Feb 2010 15:00:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IF0hIM097281; Thu, 18 Feb 2010 15:00:43 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002181500.o1IF0hIM097281@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 18 Feb 2010 15:00: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: r204042 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 15:00:44 -0000 Author: nwhitehorn Date: Thu Feb 18 15:00:43 2010 New Revision: 204042 URL: http://svn.freebsd.org/changeset/base/204042 Log: Fix a bug where pages being removed from memory entirely no longer have PVOs, and so the modified state of the page can no longer be communicated to the VM layer, causing pages not to be flushed to swap when needed, in turn causing memory corruption. Also make several correctness adjustments to I-Cache synchronization and TLB invalidation for 64-bit Book-S CPUs. Obtained from: projects/ppc64 Discussed with: grehan MFC after: 2 weeks Modified: head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Thu Feb 18 14:28:38 2010 (r204041) +++ head/sys/powerpc/aim/mmu_oea.c Thu Feb 18 15:00:43 2010 (r204042) @@ -1729,6 +1729,10 @@ moea_remove_all(mmu_t mmu, vm_page_t m) moea_pvo_remove(pvo, -1); PMAP_UNLOCK(pmap); } + if ((m->flags & PG_WRITEABLE) && moea_is_modified(mmu, m)) { + moea_attr_clear(m, LPTE_CHG); + vm_page_dirty(m); + } vm_page_flag_clear(m, PG_WRITEABLE); } @@ -2203,10 +2207,8 @@ moea_query_bit(vm_page_t m, int ptebit) struct pvo_entry *pvo; struct pte *pt; -#if 0 if (moea_attr_fetch(m) & ptebit) return (TRUE); -#endif LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { MOEA_PVO_CHECK(pvo); /* sanity check */ Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Thu Feb 18 14:28:38 2010 (r204041) +++ head/sys/powerpc/aim/mmu_oea64.c Thu Feb 18 15:00:43 2010 (r204042) @@ -172,6 +172,7 @@ va_to_vsid(pmap_t pm, vm_offset_t va) return ((pm->pm_sr[(uintptr_t)va >> ADDR_SR_SHFT]) & SR_VSID_MASK); } +#define PTESYNC() __asm __volatile("ptesync"); #define TLBSYNC() __asm __volatile("tlbsync; ptesync"); #define SYNC() __asm __volatile("sync"); #define EIEIO() __asm __volatile("eieio"); @@ -194,6 +195,7 @@ TLBIE(pmap_t pmap, vm_offset_t va) { vpn = (uint64_t)(va & ADDR_PIDX); if (pmap != NULL) vpn |= (va_to_vsid(pmap,va) << 28); + vpn &= ~(0xffffULL << 48); vpn_hi = (uint32_t)(vpn >> 32); vpn_lo = (uint32_t)vpn; @@ -201,8 +203,7 @@ TLBIE(pmap_t pmap, vm_offset_t va) { mtx_lock_spin(&tlbie_mutex); __asm __volatile("\ mfmsr %0; \ - clrldi %1,%0,49; \ - mtmsr %1; \ + mr %1, %0; \ insrdi %1,%5,1,0; \ mtmsrd %1; \ ptesync; \ @@ -215,7 +216,8 @@ TLBIE(pmap_t pmap, vm_offset_t va) { eieio; \ tlbsync; \ ptesync;" - : "=r"(msr), "=r"(scratch) : "r"(vpn_hi), "r"(vpn_lo), "r"(32), "r"(1)); + : "=r"(msr), "=r"(scratch) : "r"(vpn_hi), "r"(vpn_lo), "r"(32), "r"(1) + : "memory"); mtx_unlock_spin(&tlbie_mutex); } @@ -226,13 +228,13 @@ TLBIE(pmap_t pmap, vm_offset_t va) { #define VSID_TO_SR(vsid) ((vsid) & 0xf) #define VSID_TO_HASH(vsid) (((vsid) >> 4) & 0xfffff) -#define PVO_PTEGIDX_MASK 0x007 /* which PTEG slot */ -#define PVO_PTEGIDX_VALID 0x008 /* slot is valid */ -#define PVO_WIRED 0x010 /* PVO entry is wired */ -#define PVO_MANAGED 0x020 /* PVO entry is managed */ -#define PVO_BOOTSTRAP 0x080 /* PVO entry allocated during +#define PVO_PTEGIDX_MASK 0x007UL /* which PTEG slot */ +#define PVO_PTEGIDX_VALID 0x008UL /* slot is valid */ +#define PVO_WIRED 0x010UL /* PVO entry is wired */ +#define PVO_MANAGED 0x020UL /* PVO entry is managed */ +#define PVO_BOOTSTRAP 0x080UL /* PVO entry allocated during bootstrap */ -#define PVO_FAKE 0x100 /* fictitious phys page */ +#define PVO_FAKE 0x100UL /* fictitious phys page */ #define PVO_VADDR(pvo) ((pvo)->pvo_vaddr & ~ADDR_POFF) #define PVO_ISFAKE(pvo) ((pvo)->pvo_vaddr & PVO_FAKE) #define PVO_PTEGIDX_GET(pvo) ((pvo)->pvo_vaddr & PVO_PTEGIDX_MASK) @@ -512,23 +514,6 @@ moea64_attr_save(vm_page_t m, u_int64_t m->md.mdpg_attrs |= ptebit; } -static __inline int -moea64_pte_compare(const struct lpte *pt, const struct lpte *pvo_pt) -{ - if (pt->pte_hi == pvo_pt->pte_hi) - return (1); - - return (0); -} - -static __inline int -moea64_pte_match(struct lpte *pt, uint64_t vsid, vm_offset_t va, int which) -{ - return (pt->pte_hi & ~LPTE_VALID) == - ((vsid << LPTE_VSID_SHIFT) | - ((uint64_t)(va >> ADDR_API_SHFT64) & LPTE_API) | which); -} - static __inline void moea64_pte_create(struct lpte *pt, uint64_t vsid, vm_offset_t va, uint64_t pte_lo) @@ -583,7 +568,7 @@ moea64_pte_set(struct lpte *pt, struct l pt->pte_lo = pvo_pt->pte_lo; EIEIO(); pt->pte_hi = pvo_pt->pte_hi; - SYNC(); + PTESYNC(); moea64_pte_valid++; } @@ -602,7 +587,6 @@ moea64_pte_unset(struct lpte *pt, struct * Invalidate the pte. */ pt->pte_hi &= ~LPTE_VALID; - TLBIE(pmap,va); /* @@ -621,6 +605,8 @@ moea64_pte_change(struct lpte *pt, struc */ moea64_pte_unset(pt, pvo_pt, pmap, va); moea64_pte_set(pt, pvo_pt); + if (pmap == kernel_pmap) + isync(); } static __inline uint64_t @@ -701,7 +687,7 @@ moea64_bridge_cpu_bootstrap(mmu_t mmup, for (i = 0; i < 16; i++) { mtsrin(i << ADDR_SR_SHFT, kernel_pmap->pm_sr[i]); } - __asm __volatile ("sync; mtsdr1 %0; isync" + __asm __volatile ("ptesync; mtsdr1 %0; isync" :: "r"((u_int)moea64_pteg_table | (32 - cntlzw(moea64_pteg_mask >> 11)))); tlbia(); @@ -1135,7 +1121,7 @@ void moea64_set_scratchpage_pa(int which EIEIO(); moea64_scratchpage_pte[which]->pte_hi |= LPTE_VALID; - TLBIE(kernel_pmap, moea64_scratchpage_va[which]); + PTESYNC(); isync(); } void @@ -1155,8 +1141,6 @@ moea64_copy_page(mmu_t mmu, vm_page_t ms kcopy((void *)moea64_scratchpage_va[0], (void *)moea64_scratchpage_va[1], PAGE_SIZE); - __syncicache((void *)moea64_scratchpage_va[1],PAGE_SIZE); - mtx_unlock(&moea64_scratchpage_mtx); } @@ -1174,8 +1158,6 @@ moea64_zero_page_area(mmu_t mmu, vm_page moea64_set_scratchpage_pa(0,pa); bzero((caddr_t)moea64_scratchpage_va[0] + off, size); - __syncicache((void *)moea64_scratchpage_va[0],PAGE_SIZE); - mtx_unlock(&moea64_scratchpage_mtx); } @@ -1266,9 +1248,6 @@ moea64_enter_locked(pmap_t pmap, vm_offs error = moea64_pvo_enter(pmap, zone, pvo_head, va, VM_PAGE_TO_PHYS(m), pte_lo, pvo_flags); - if (pmap == kernel_pmap) - TLBIE(pmap, va); - /* * Flush the page from the instruction cache if this page is * mapped executable and cacheable. @@ -1281,6 +1260,7 @@ moea64_enter_locked(pmap_t pmap, vm_offs static void moea64_syncicache(pmap_t pmap, vm_offset_t va, vm_offset_t pa, vm_size_t sz) { + /* * This is much trickier than on older systems because * we can't sync the icache on physical addresses directly @@ -1303,8 +1283,9 @@ moea64_syncicache(pmap_t pmap, vm_offset mtx_lock(&moea64_scratchpage_mtx); - moea64_set_scratchpage_pa(1,pa); - __syncicache((void *)moea64_scratchpage_va[1], sz); + moea64_set_scratchpage_pa(1,pa & ~ADDR_POFF); + __syncicache((void *)(moea64_scratchpage_va[1] + + (va & ADDR_POFF)), sz); mtx_unlock(&moea64_scratchpage_mtx); } @@ -1441,8 +1422,6 @@ moea64_uma_page_alloc(uma_zone_t zone, i &moea64_pvo_kunmanaged, va, VM_PAGE_TO_PHYS(m), LPTE_M, PVO_WIRED | PVO_BOOTSTRAP); - TLBIE(kernel_pmap, va); - if (needed_lock) PMAP_UNLOCK(kernel_pmap); @@ -1531,7 +1510,7 @@ moea64_remove_write(mmu_t mmu, vm_page_t lo |= pvo->pvo_pte.lpte.pte_lo; pvo->pvo_pte.lpte.pte_lo &= ~LPTE_CHG; moea64_pte_change(pt, &pvo->pvo_pte.lpte, - pvo->pvo_pmap, pvo->pvo_vaddr); + pvo->pvo_pmap, PVO_VADDR(pvo)); } UNLOCK_TABLE(); } @@ -1590,8 +1569,6 @@ moea64_kenter(mmu_t mmu, vm_offset_t va, &moea64_pvo_kunmanaged, va, pa, pte_lo, PVO_WIRED | VM_PROT_EXECUTE); - TLBIE(kernel_pmap, va); - if (error != 0 && error != ENOENT) panic("moea64_kenter: failed to enter va %#x pa %#x: %d", va, pa, error); @@ -1823,7 +1800,7 @@ moea64_protect(mmu_t mmu, pmap_t pm, vm_ */ if (pt != NULL) { moea64_pte_change(pt, &pvo->pvo_pte.lpte, - pvo->pvo_pmap, pvo->pvo_vaddr); + pvo->pvo_pmap, PVO_VADDR(pvo)); if ((pvo->pvo_pte.lpte.pte_lo & (LPTE_I | LPTE_G | LPTE_NOEXEC)) == 0) { moea64_syncicache(pm, sva, @@ -1927,6 +1904,10 @@ moea64_remove_all(mmu_t mmu, vm_page_t m moea64_pvo_remove(pvo, -1); PMAP_UNLOCK(pmap); } + if ((m->flags & PG_WRITEABLE) && moea64_is_modified(mmu, m)) { + moea64_attr_clear(m, LPTE_CHG); + vm_page_dirty(m); + } vm_page_flag_clear(m, PG_WRITEABLE); } @@ -2107,7 +2088,7 @@ moea64_pvo_enter(pmap_t pm, uma_zone_t z first = 1; LIST_INSERT_HEAD(pvo_head, pvo, pvo_vlink); - if (pvo->pvo_pte.lpte.pte_lo & PVO_WIRED) + if (pvo->pvo_vaddr & PVO_WIRED) pm->pm_stats.wired_count++; pm->pm_stats.resident_count++; @@ -2122,6 +2103,9 @@ moea64_pvo_enter(pmap_t pm, uma_zone_t z moea64_pte_overflow++; } + if (pm == kernel_pmap) + isync(); + UNLOCK_TABLE(); return (first ? ENOENT : 0); @@ -2140,7 +2124,7 @@ moea64_pvo_remove(struct pvo_entry *pvo, pt = moea64_pvo_to_pte(pvo, pteidx); if (pt != NULL) { moea64_pte_unset(pt, &pvo->pvo_pte.lpte, pvo->pvo_pmap, - pvo->pvo_vaddr); + PVO_VADDR(pvo)); PVO_PTEGIDX_CLR(pvo); } else { moea64_pte_overflow--; @@ -2151,7 +2135,7 @@ moea64_pvo_remove(struct pvo_entry *pvo, * Update our statistics. */ pvo->pvo_pmap->pm_stats.resident_count--; - if (pvo->pvo_pte.lpte.pte_lo & PVO_WIRED) + if (pvo->pvo_vaddr & PVO_WIRED) pvo->pvo_pmap->pm_stats.wired_count--; /* @@ -2178,7 +2162,7 @@ moea64_pvo_remove(struct pvo_entry *pvo, */ LIST_REMOVE(pvo, pvo_olink); if (!(pvo->pvo_vaddr & PVO_BOOTSTRAP)) - uma_zfree(pvo->pvo_vaddr & PVO_MANAGED ? moea64_mpvo_zone : + uma_zfree((pvo->pvo_vaddr & PVO_MANAGED) ? moea64_mpvo_zone : moea64_upvo_zone, pvo); moea64_pvo_entries--; moea64_pvo_remove_calls++; @@ -2237,8 +2221,8 @@ moea64_pvo_to_pte(const struct pvo_entry int ptegidx; uint64_t vsid; - vsid = va_to_vsid(pvo->pvo_pmap, pvo->pvo_vaddr); - ptegidx = va_to_pteg(vsid, pvo->pvo_vaddr); + vsid = va_to_vsid(pvo->pvo_pmap, PVO_VADDR(pvo)); + ptegidx = va_to_pteg(vsid, PVO_VADDR(pvo)); pteidx = moea64_pvo_pte_index(pvo, ptegidx); } @@ -2325,10 +2309,8 @@ moea64_query_bit(vm_page_t m, u_int64_t struct pvo_entry *pvo; struct lpte *pt; -#if 0 if (moea64_attr_fetch(m) & ptebit) return (TRUE); -#endif LIST_FOREACH(pvo, vm_page_to_pvoh(m), pvo_vlink) { MOEA_PVO_CHECK(pvo); /* sanity check */ From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 15:45:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AD17106566B; Thu, 18 Feb 2010 15:45:44 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 217568FC17; Thu, 18 Feb 2010 15:45: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 o1IFjiOH007350; Thu, 18 Feb 2010 15:45:44 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IFjiAq007348; Thu, 18 Feb 2010 15:45:44 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201002181545.o1IFjiAq007348@svn.freebsd.org> From: Ken Smith Date: Thu, 18 Feb 2010 15:45: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: r204044 - head/release/scripts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 15:45:44 -0000 Author: kensmith Date: Thu Feb 18 15:45:43 2010 New Revision: 204044 URL: http://svn.freebsd.org/changeset/base/204044 Log: Provide a script that can be used to create the memstick images. For now it isn't being integrated into 'make release' because for the forseeable future the memstick images will be identical to what's on the DVD except for which package set is provided. If/when what's on the memstick diverges from what's on the DVD it would make more sense to generate a "memstick" directory in $CHROOT/R/cdrom and build the memstick image along with the ISO images. Reviewed by: jhb, ru, Garrett Cooper (yanefbsd at gmail dot com) Added: head/release/scripts/make-memstick.sh (contents, props changed) Added: head/release/scripts/make-memstick.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/release/scripts/make-memstick.sh Thu Feb 18 15:45:43 2010 (r204044) @@ -0,0 +1,83 @@ +#!/bin/sh +# +# This script generates a "memstick image" (image that can be copied to a +# USB memory stick) from a directory tree. Note that the script does not +# clean up after itself very well for error conditions on purpose so the +# problem can be diagnosed (full filesystem most likely but ...). +# +# Usage: make-memstick.sh +# +# $FreeBSD$ +# + +PATH=/bin:/usr/bin:/sbin:/usr/sbin +export PATH + +BLOCKSIZE=10240 + +if [ $# -ne 2 ]; then + echo "make-memstick.sh /path/to/directory /path/to/image/file" + exit 1 +fi + +tempfile="${2}.$$" + +if [ ! -d ${1} ]; then + echo "${1} must be a directory" + exit 1 +fi + +if [ -e ${2} ]; then + echo "won't overwrite ${2}" + exit 1 +fi + +rm -f ${tempfile} +makefs ${tempfile} ${1} +if [ $? -ne 0 ]; then + echo "makefs failed" + exit 1 +fi + +# +# Use $BLOCKSIZE for transfers to improve efficiency. When calculating +# how many blocks to transfer "+ 2" is to account for truncation in the +# division and to provide space for the label. +# + +filesize=`stat -f "%z" ${tempfile}` +blocks=$(($filesize / ${BLOCKSIZE} + 2)) +dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks} +if [ $? -ne 0 ]; then + echo "creation of image file failed" + exit 1 +fi + +unit=`mdconfig -a -t vnode -f ${2}` +if [ $? -ne 0 ]; then + echo "mdconfig failed" + exit 1 +fi + +fdisk -BIq /dev/${unit} +if [ $? -ne 0 ]; then + echo "fdisk failed" + exit 1 +fi + +bsdlabel -B -w /dev/${unit} +if [ $? -ne 0 ]; then + echo "bsdlabel failed" + exit 1 +fi + +dd if=${tempfile} of=/dev/${unit}a bs=$BLOCKSIZE conv=sync +if [ $? -ne 0 ]; then + echo "copying filesystem into image file failed" + exit 1 +fi + +mdconfig -d -u ${unit} + +rm -f ${tempfile} + From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 16:05:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 052361065698; Thu, 18 Feb 2010 16:05:10 +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 E99658FC16; Thu, 18 Feb 2010 16:05: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 o1IG59gu011736; Thu, 18 Feb 2010 16:05:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IG59IQ011734; Thu, 18 Feb 2010 16:05:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002181605.o1IG59IQ011734@svn.freebsd.org> From: Warner Losh Date: Thu, 18 Feb 2010 16:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204045 - head/usr.bin/kdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 16:05:10 -0000 Author: imp Date: Thu Feb 18 16:05:09 2010 New Revision: 204045 URL: http://svn.freebsd.org/changeset/base/204045 Log: The kdump data stream is an unaligned data stream for stat and sockaddr structures. As such, we have top copy the data structure into a local buffer before we can reference it, otherwise we have unaligned references (these are fixed up automatically on some CPUs, but not on others). We do this unconditionally to make the code easier to read and understand. Submitted by: Grzegorz Bernacki Modified: head/usr.bin/kdump/kdump.c Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Thu Feb 18 15:45:43 2010 (r204044) +++ head/usr.bin/kdump/kdump.c Thu Feb 18 16:05:09 2010 (r204045) @@ -1328,6 +1328,8 @@ ktrstruct(char *buf, size_t buflen) char *name, *data; size_t namelen, datalen; int i; + struct stat sb; + struct sockaddr_storage ss; for (name = buf, namelen = 0; namelen < buflen && name[namelen] != '\0'; @@ -1348,12 +1350,16 @@ ktrstruct(char *buf, size_t buflen) if (strcmp(name, "stat") == 0) { if (datalen != sizeof(struct stat)) goto invalid; - ktrstat((struct stat *)data); + memcpy(&sb, data, datalen); + ktrstat(&sb); } else if (strcmp(name, "sockaddr") == 0) { + if (datalen > sizeof(ss)) + goto invalid; + memcpy(&ss, data, datalen); if (datalen < sizeof(struct sockaddr) || - datalen != ((struct sockaddr *)(data))->sa_len) + datalen != ss.ss_len) goto invalid; - ktrsockaddr((struct sockaddr *)data); + ktrsockaddr((struct sockaddr *)&ss); } else { printf("unknown structure\n"); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 18:35:10 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ADF41065676; Thu, 18 Feb 2010 18:35:10 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A1D78FC18; Thu, 18 Feb 2010 18:35: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 o1IIZAnZ044913; Thu, 18 Feb 2010 18:35:10 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IIZARB044911; Thu, 18 Feb 2010 18:35:10 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201002181835.o1IIZARB044911@svn.freebsd.org> From: Matt Jacob Date: Thu, 18 Feb 2010 18:35: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: r204050 - head/sys/dev/isp X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 18:35:10 -0000 Author: mjacob Date: Thu Feb 18 18:35:09 2010 New Revision: 204050 URL: http://svn.freebsd.org/changeset/base/204050 Log: Don't try and re-use a handle, even if the firmware tells you that's what is logged in. PR: kern/144026 MFC after: 1 week Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Thu Feb 18 17:11:06 2010 (r204049) +++ head/sys/dev/isp/isp.c Thu Feb 18 18:35:09 2010 (r204050) @@ -2182,9 +2182,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uin msg = "no Exchange Control Block"; break; case PLOGX_IOCBERR_FAILED: - ISP_SNPRINTF(buf, sizeof (buf), - "reason 0x%x (last LOGIN state 0x%x)", - parm1 & 0xff, (parm1 >> 8) & 0xff); + ISP_SNPRINTF(buf, sizeof (buf), "reason 0x%x (last LOGIN state 0x%x)", parm1 & 0xff, (parm1 >> 8) & 0xff); msg = buf; break; case PLOGX_IOCBERR_NOFABRIC: @@ -2194,8 +2192,7 @@ isp_plogx(ispsoftc_t *isp, int chan, uin msg = "firmware not ready"; break; case PLOGX_IOCBERR_NOLOGIN: - ISP_SNPRINTF(buf, sizeof (buf), "not logged in (last state 0x%x)", - parm1); + ISP_SNPRINTF(buf, sizeof (buf), "not logged in (last state 0x%x)", parm1); msg = buf; rval = MBOX_NOT_LOGGED_IN; break; @@ -2207,21 +2204,18 @@ isp_plogx(ispsoftc_t *isp, int chan, uin msg = "no PCB allocated"; break; case PLOGX_IOCBERR_EINVAL: - ISP_SNPRINTF(buf, sizeof (buf), "invalid parameter at offset 0x%x", - parm1); + ISP_SNPRINTF(buf, sizeof (buf), "invalid parameter at offset 0x%x", parm1); msg = buf; break; case PLOGX_IOCBERR_PORTUSED: lev = ISP_LOGSANCFG|ISP_LOGDEBUG0; - ISP_SNPRINTF(buf, sizeof (buf), - "already logged in with N-Port handle 0x%x", parm1); + ISP_SNPRINTF(buf, sizeof (buf), "already logged in with N-Port handle 0x%x", parm1); msg = buf; rval = MBOX_PORT_ID_USED | (parm1 << 16); break; case PLOGX_IOCBERR_HNDLUSED: lev = ISP_LOGSANCFG|ISP_LOGDEBUG0; - ISP_SNPRINTF(buf, sizeof (buf), - "handle already used for PortID 0x%06x", parm1); + ISP_SNPRINTF(buf, sizeof (buf), "handle already used for PortID 0x%06x", parm1); msg = buf; rval = MBOX_LOOP_ID_USED; break; @@ -2232,15 +2226,12 @@ isp_plogx(ispsoftc_t *isp, int chan, uin msg = "no FLOGI_ACC"; break; default: - ISP_SNPRINTF(buf, sizeof (buf), "status %x from %x", - plp->plogx_status, flags); + ISP_SNPRINTF(buf, sizeof (buf), "status %x from %x", plp->plogx_status, flags); msg = buf; break; } if (msg) { - isp_prt(isp, ISP_LOGERR, - "Chan %d PLOGX PortID 0x%06x to N-Port handle 0x%x: %s", - chan, portid, handle, msg); + isp_prt(isp, ISP_LOGERR, "Chan %d PLOGX PortID 0x%06x to N-Port handle 0x%x: %s", chan, portid, handle, msg); } out: if (gs == 0) { @@ -3901,8 +3892,7 @@ isp_scan_fabric(ispsoftc_t *isp, int cha * Find an unused handle and try and use to login to a port. */ static int -isp_login_device(ispsoftc_t *isp, int chan, uint32_t portid, isp_pdb_t *p, - uint16_t *ohp) +isp_login_device(ispsoftc_t *isp, int chan, uint32_t portid, isp_pdb_t *p, uint16_t *ohp) { int lim, i, r; uint16_t handle; @@ -3922,8 +3912,7 @@ isp_login_device(ispsoftc_t *isp, int ch */ r = isp_getpdb(isp, chan, handle, p, 0); if (r == 0 && p->portid != portid) { - (void) isp_plogx(isp, chan, handle, portid, - PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT, 1); + (void) isp_plogx(isp, chan, handle, portid, PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT | PLOGX_FLG_FREE_NPHDL, 1); } else if (r == 0) { break; } @@ -3933,8 +3922,7 @@ isp_login_device(ispsoftc_t *isp, int ch /* * Now try and log into the device */ - r = isp_plogx(isp, chan, handle, portid, - PLOGX_FLG_CMD_PLOGI, 1); + r = isp_plogx(isp, chan, handle, portid, PLOGX_FLG_CMD_PLOGI, 1); if (FCPARAM(isp, chan)->isp_loopstate != LOOP_SCANNING_FABRIC) { return (-1); } @@ -3942,7 +3930,26 @@ isp_login_device(ispsoftc_t *isp, int ch *ohp = handle; break; } else if ((r & 0xffff) == MBOX_PORT_ID_USED) { - handle = r >> 16; + /* + * If we get here, then the firmwware still thinks we're logged into this device, but with a different + * handle. We need to break that association. We used to try and just substitute the handle, but then + * failed to get any data via isp_getpdb (below). + */ + if (isp_plogx(isp, chan, r >> 16, portid, PLOGX_FLG_CMD_LOGO | PLOGX_FLG_IMPLICIT | PLOGX_FLG_FREE_NPHDL, 1)) { + isp_prt(isp, ISP_LOGERR, "baw... logout of %x failed", r >> 16); + } + if (FCPARAM(isp, chan)->isp_loopstate != LOOP_SCANNING_FABRIC) { + return (-1); + } + r = isp_plogx(isp, chan, handle, portid, PLOGX_FLG_CMD_PLOGI, 1); + if (FCPARAM(isp, chan)->isp_loopstate != LOOP_SCANNING_FABRIC) { + return (-1); + } + if (r == 0) { + *ohp = handle; + } else { + i = lim; + } break; } else if (r != MBOX_LOOP_ID_USED) { i = lim; @@ -3956,8 +3963,7 @@ isp_login_device(ispsoftc_t *isp, int ch } if (i == lim) { - isp_prt(isp, ISP_LOGWARN, "Chan %d PLOGI 0x%06x failed", - chan, portid); + isp_prt(isp, ISP_LOGWARN, "Chan %d PLOGI 0x%06x failed", chan, portid); return (-1); } @@ -3971,15 +3977,12 @@ isp_login_device(ispsoftc_t *isp, int ch return (-1); } if (r != 0) { - isp_prt(isp, ISP_LOGERR, - "Chan %d new device 0x%06x@0x%x disappeared", - chan, portid, handle); + isp_prt(isp, ISP_LOGERR, "Chan %d new device 0x%06x@0x%x disappeared", chan, portid, handle); return (-1); } if (p->handle != handle || p->portid != portid) { - isp_prt(isp, ISP_LOGERR, - "Chan %d new device 0x%06x@0x%x changed (0x%06x@0x%0x)", + isp_prt(isp, ISP_LOGERR, "Chan %d new device 0x%06x@0x%x changed (0x%06x@0x%0x)", chan, portid, handle, p->portid, p->handle); return (-1); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 18:57:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A777106566C; Thu, 18 Feb 2010 18:57:16 +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 EF1968FC12; Thu, 18 Feb 2010 18: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 o1IIvFCj049767; Thu, 18 Feb 2010 18:57:15 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IIvFrG049765; Thu, 18 Feb 2010 18:57:15 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002181857.o1IIvFrG049765@svn.freebsd.org> From: Warner Losh Date: Thu, 18 Feb 2010 18: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: r204051 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 18:57:16 -0000 Author: imp Date: Thu Feb 18 18:57:15 2010 New Revision: 204051 URL: http://svn.freebsd.org/changeset/base/204051 Log: n64 has a different size for KINFO_PROC_SIZE. Modified: head/sys/sys/user.h Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Thu Feb 18 18:35:09 2010 (r204050) +++ head/sys/sys/user.h Thu Feb 18 18:57:15 2010 (r204051) @@ -100,8 +100,12 @@ #define KINFO_PROC_SIZE 768 #endif #ifdef __mips__ +#ifdef __mips_n64 +#define KINFO_PROC_SIZE 1088 +#else #define KINFO_PROC_SIZE 816 #endif +#endif #ifdef __powerpc__ #define KINFO_PROC_SIZE 768 #endif From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 19:02:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9DE21065705; Thu, 18 Feb 2010 19:02:33 +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 BA7238FC1F; Thu, 18 Feb 2010 19:02: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 o1IJ2Xrn050970; Thu, 18 Feb 2010 19:02:33 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IJ2XDx050968; Thu, 18 Feb 2010 19:02:33 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002181902.o1IJ2XDx050968@svn.freebsd.org> From: Warner Losh Date: Thu, 18 Feb 2010 19:02: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: r204052 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 19:02:33 -0000 Author: imp Date: Thu Feb 18 19:02:33 2010 New Revision: 204052 URL: http://svn.freebsd.org/changeset/base/204052 Log: Use proper structure type for 64-bit headers # this fixes the MALTA64 build Modified: head/sys/mips/mips/elf_trampoline.c Modified: head/sys/mips/mips/elf_trampoline.c ============================================================================== --- head/sys/mips/mips/elf_trampoline.c Thu Feb 18 18:57:15 2010 (r204051) +++ head/sys/mips/mips/elf_trampoline.c Thu Feb 18 19:02:33 2010 (r204052) @@ -96,7 +96,7 @@ load_kernel(void * kstart) #ifdef __mips_n64 Elf64_Ehdr *eh; Elf64_Phdr phdr[64] /* XXX */; - Elf64_Phdr shdr[64] /* XXX */; + Elf64_Shdr shdr[64] /* XXX */; #else Elf32_Ehdr *eh; Elf32_Phdr phdr[64] /* XXX */; From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 19:06:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D83451065695; Thu, 18 Feb 2010 19:06:30 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5AF58FC0A; Thu, 18 Feb 2010 19:06:30 +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 o1IJ6U6E051912; Thu, 18 Feb 2010 19:06:30 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IJ6UrF051909; Thu, 18 Feb 2010 19:06:30 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002181906.o1IJ6UrF051909@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 18 Feb 2010 19:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204053 - head/usr.bin/hexdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 19:06:30 -0000 Author: gavin Date: Thu Feb 18 19:06:30 2010 New Revision: 204053 URL: http://svn.freebsd.org/changeset/base/204053 Log: The correct value of DEL is 0x7f, not 0xff. This is purely a documentation issue - od(1) and hexdump(1) behave as expected. PR: docs/143869 Submitted by: gcooper MFC after: 2 weeks Modified: head/usr.bin/hexdump/hexdump.1 head/usr.bin/hexdump/od.1 Modified: head/usr.bin/hexdump/hexdump.1 ============================================================================== --- head/usr.bin/hexdump/hexdump.1 Thu Feb 18 19:02:33 2010 (r204052) +++ head/usr.bin/hexdump/hexdump.1 Thu Feb 18 19:06:30 2010 (r204053) @@ -32,7 +32,7 @@ .\" @(#)hexdump.1 8.2 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd July 10, 2004 +.Dd February 18, 2010 .Dt HEXDUMP 1 .Os .Sh NAME @@ -258,7 +258,7 @@ strings. .It "\&00C\ FF\t00D\ CR\t00E\ SO\t00F\ SI\t010\ DLE\t011\ DC1 .It "\&012\ DC2\t013\ DC3\t014\ DC4\t015\ NAK\t016\ SYN\t017\ ETB .It "\&018\ CAN\t019\ EM\t01A\ SUB\t01B\ ESC\t01C\ FS\t01D\ GS -.It "\&01E\ RS\t01F\ US\t0FF\ DEL +.It "\&01E\ RS\t01F\ US\t07F\ DEL .El .El .Pp Modified: head/usr.bin/hexdump/od.1 ============================================================================== --- head/usr.bin/hexdump/od.1 Thu Feb 18 19:02:33 2010 (r204052) +++ head/usr.bin/hexdump/od.1 Thu Feb 18 19:06:30 2010 (r204053) @@ -32,7 +32,7 @@ .\" @(#)od.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 24, 2006 +.Dd February 18, 2010 .Os .Dt OD 1 .Sh NAME @@ -155,7 +155,7 @@ Control characters are displayed using t .It "00c FF 00d CR 00e SO 00f SI 010 DLE 011 DC1" .It "012 DC2 013 DC3 014 DC4 015 NAK 016 SYN 017 ETB" .It "018 CAN 019 EM 01a SUB 01b ESC 01c FS 01d GS" -.It "01e RS 01f US 020 SP 0ff DEL" +.It "01e RS 01f US 020 SP 07f DEL" .El .It Cm c Characters in the default character set. From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 19:24:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A25310656B1; Thu, 18 Feb 2010 19:24:24 +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 29E1E8FC1F; Thu, 18 Feb 2010 19:24: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 o1IJOOON055877; Thu, 18 Feb 2010 19:24:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IJOOth055875; Thu, 18 Feb 2010 19:24:24 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002181924.o1IJOOth055875@svn.freebsd.org> From: Warner Losh Date: Thu, 18 Feb 2010 19:24: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: r204054 - head/sys/mips/cavium X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 19:24:24 -0000 Author: imp Date: Thu Feb 18 19:24:23 2010 New Revision: 204054 URL: http://svn.freebsd.org/changeset/base/204054 Log: Parens around tertiary operator so that casting the result works... Modified: head/sys/mips/cavium/octeon_pcmap_regs.h Modified: head/sys/mips/cavium/octeon_pcmap_regs.h ============================================================================== --- head/sys/mips/cavium/octeon_pcmap_regs.h Thu Feb 18 19:06:30 2010 (r204053) +++ head/sys/mips/cavium/octeon_pcmap_regs.h Thu Feb 18 19:24:23 2010 (r204054) @@ -601,10 +601,9 @@ typedef enum { #define octeon_ptr_to_phys(ptr) \ - ((((mipsx_addr_size) ptr) >> MIPSX_ADDR_SIZE_KSEGX_BIT_SHIFT) == 2) ? \ + (((((mipsx_addr_size) ptr) >> MIPSX_ADDR_SIZE_KSEGX_BIT_SHIFT) == 2) ? \ ((mipsx_addr_size) ptr & MIPSX_ADDR_SIZE_KSEGX_MASK_REMOVED) : \ - (vtophys(ptr)) - + (vtophys(ptr))) #ifdef CODE_FOR_64_BIT_NEEDED static inline mipsx_addr_size octeon_ptr_to_phys (void *ptr) From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 19:27:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1659D1065692; Thu, 18 Feb 2010 19:27:01 +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 028FA8FC19; Thu, 18 Feb 2010 19:27: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 o1IJR0WQ056472; Thu, 18 Feb 2010 19:27:00 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IJR0WV056469; Thu, 18 Feb 2010 19:27:00 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002181927.o1IJR0WV056469@svn.freebsd.org> From: Warner Losh Date: Thu, 18 Feb 2010 19:27: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: r204055 - in head/sys/mips/cavium: . dev/rgmii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 19:27:01 -0000 Author: imp Date: Thu Feb 18 19:27:00 2010 New Revision: 204055 URL: http://svn.freebsd.org/changeset/base/204055 Log: Make printfs work for both OCTEON1 and OCTEON1-32 Modified: head/sys/mips/cavium/dev/rgmii/octeon_fpa.c head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/dev/rgmii/octeon_fpa.c ============================================================================== --- head/sys/mips/cavium/dev/rgmii/octeon_fpa.c Thu Feb 18 19:24:23 2010 (r204054) +++ head/sys/mips/cavium/dev/rgmii/octeon_fpa.c Thu Feb 18 19:27:00 2010 (r204055) @@ -209,8 +209,9 @@ void octeon_fpa_fill_pool_mem (u_int poo memory = (void *) OCTEON_ALIGN(memory); #ifdef FPA_DEBUG_TERSE - printf("FPA fill: %u Count: %u SizeBytes: %u SizeBytesAligned: %u 1st: %p = 0x%X\n", - pool, elem_num, elem_size_bytes, block_size, memory, (void *)OCTEON_PTR2PHYS(memory)); + printf("FPA fill: %u Count: %u SizeBytes: %u SizeBytesAligned: %u 1st: %p = %p\n", + pool, elem_num, elem_size_bytes, block_size, memory, + (void *)(intptr_t)OCTEON_PTR2PHYS(memory)); #endif // memory = (void *) ((((u_int) memory / OCTEON_FPA_POOL_ALIGNMENT) + 1) * OCTEON_FPA_POOL_ALIGNMENT); @@ -218,7 +219,8 @@ void octeon_fpa_fill_pool_mem (u_int poo while (elem_num--) { #ifdef FPA_DEBUG if (((elems - elem_num) < 4) || (elem_num < 4)) - printf(" %% Block %d: %p Phys 0x%X Bytes %u\n", block, memory, OCTEON_PTR2PHYS(memory), elem_size_bytes); + printf(" %% Block %d: %p Phys %p Bytes %u\n", block, memory, + (void *)(intptr_t)OCTEON_PTR2PHYS(memory), elem_size_bytes); block++; #endif octeon_fpa_free(memory, pool, 0); Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Thu Feb 18 19:24:23 2010 (r204054) +++ head/sys/mips/cavium/octeon_machdep.c Thu Feb 18 19:27:00 2010 (r204055) @@ -659,8 +659,8 @@ octeon_memory_init(void) uint32_t realmem_bytes; if (octeon_board_real()) { - printf("octeon_dram == %llx\n", octeon_dram); - printf("reduced to ram: %u MB", (uint32_t) octeon_dram >> 20); + printf("octeon_dram == %jx\n", (intmax_t)octeon_dram); + printf("reduced to ram: %u MB", (uint32_t)octeon_dram >> 20); realmem_bytes = (octeon_dram - PAGE_SIZE); realmem_bytes &= ~(PAGE_SIZE - 1); @@ -678,8 +678,8 @@ octeon_memory_init(void) phys_avail[1] = realmem_bytes; realmem_bytes -= OCTEON_DRAM_FIRST_256_END; realmem_bytes &= ~(PAGE_SIZE - 1); - printf("phys_avail[0] = %x phys_avail[1] = %x\n", - phys_avail[0], phys_avail[1]); + printf("phys_avail[0] = %#lx phys_avail[1] = %#lx\n", + (long)phys_avail[0], (long)phys_avail[1]); } else { /* Simulator gets 96Meg period. */ phys_avail[1] = (96 << 20); @@ -707,8 +707,8 @@ octeon_memory_init(void) phys_avail[2] = 0x20000000; printf("realmem_bytes is now at %x\n", realmem_bytes); phys_avail[3] = ((uint32_t) 0x20000000 + realmem_bytes); - printf("Next block of memory goes from %x to %x\n", - phys_avail[2], phys_avail[3]); + printf("Next block of memory goes from %#lx to %#lx\n", + (long)phys_avail[2], (long)phys_avail[3]); physmem += btoc(phys_avail[3] - phys_avail[2]); } else { printf("realmem_bytes is %d\n", realmem_bytes); @@ -716,8 +716,8 @@ octeon_memory_init(void) realmem = physmem; printf("Total DRAM Size %#X\n", (uint32_t) octeon_dram); - printf("Bank 0 = %#08X -> %#08X\n", phys_avail[0], phys_avail[1]); - printf("Bank 1 = %#08X -> %#08X\n", phys_avail[2], phys_avail[3]); + printf("Bank 0 = %#08lX -> %#08lX\n", (long)phys_avail[0], (long)phys_avail[1]); + printf("Bank 1 = %#08lX -> %#08lX\n", (long)phys_avail[2], (long)phys_avail[3]); printf("physmem: %#lx\n", physmem); Maxmem = physmem; From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 19:41:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFDDF1065672; Thu, 18 Feb 2010 19:41:38 +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 9FEBC8FC08; Thu, 18 Feb 2010 19:41: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 o1IJfc74059689; Thu, 18 Feb 2010 19:41:38 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IJfcKN059687; Thu, 18 Feb 2010 19:41:38 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002181941.o1IJfcKN059687@svn.freebsd.org> From: Warner Losh Date: Thu, 18 Feb 2010 19:41: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: r204056 - head/sys/mips/alchemy X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 19:41:38 -0000 Author: imp Date: Thu Feb 18 19:41:38 2010 New Revision: 204056 URL: http://svn.freebsd.org/changeset/base/204056 Log: Hack to make ALCHEMY compile again... Modified: head/sys/mips/alchemy/obio.c Modified: head/sys/mips/alchemy/obio.c ============================================================================== --- head/sys/mips/alchemy/obio.c Thu Feb 18 19:27:00 2010 (r204055) +++ head/sys/mips/alchemy/obio.c Thu Feb 18 19:41:38 2010 (r204056) @@ -120,6 +120,40 @@ static int obio_setup_intr(device_t, dev static int obio_teardown_intr(device_t, device_t, struct resource *, void *); +static void +obio_mask_irq(void *arg) +{ + /* XXX need to write */ +#if 0 + unsigned int irq = (unsigned int)arg; + int ip_bit, mask, mask_register; + + /* mask IRQ */ + mask_register = ICU_IRQ_MASK_REG(irq); + ip_bit = ICU_IP_BIT(irq); + + mask = ICU_REG_READ(mask_register); + ICU_REG_WRITE(mask_register, mask | ip_bit); +#endif +} + +static void +obio_unmask_irq(void *arg) +{ + /* XXX need to write */ +#if 0 + unsigned int irq = (unsigned int)arg; + int ip_bit, mask, mask_register; + + /* unmask IRQ */ + mask_register = ICU_IRQ_MASK_REG(irq); + ip_bit = ICU_IP_BIT(irq); + + mask = ICU_REG_READ(mask_register); + ICU_REG_WRITE(mask_register, mask & ~ip_bit); +#endif +} + static int obio_probe(device_t dev) { @@ -320,9 +354,10 @@ obio_setup_intr(device_t dev, device_t c event = sc->sc_eventstab[irq]; if (event == NULL) { - error = intr_event_create(&event, (void *)irq, 0, irq, - (mask_fn)mips_mask_irq, (mask_fn)mips_unmask_irq, - NULL, NULL, "obio intr%d:", irq); + error = intr_event_create(&event, (void *)irq, 0, irq, + obio_mask_irq, obio_unmask_irq, + NULL, NULL, + "obio intr%d:", irq); sc->sc_eventstab[irq] = event; } From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 20:20:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D398A1065676; Thu, 18 Feb 2010 20:20:34 +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 C39C08FC21; Thu, 18 Feb 2010 20:20: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 o1IKKYEb068428; Thu, 18 Feb 2010 20:20:34 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IKKY9l068426; Thu, 18 Feb 2010 20:20:34 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201002182020.o1IKKY9l068426@svn.freebsd.org> From: Warner Losh Date: Thu, 18 Feb 2010 20:20: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: r204060 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 20:20:34 -0000 Author: imp Date: Thu Feb 18 20:20:34 2010 New Revision: 204060 URL: http://svn.freebsd.org/changeset/base/204060 Log: Unbreak SENTRY5 build. Modified: head/sys/conf/files.mips Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Thu Feb 18 20:02:38 2010 (r204059) +++ head/sys/conf/files.mips Thu Feb 18 20:20:34 2010 (r204060) @@ -97,6 +97,7 @@ dev/cfe/cfe_env.c optional cfe_env #dev/cfe/cfe_resource.c optional cfe # not yet needed dev/siba/siba.c optional siba -dev/siba/siba_pcib.c optional siba pci dev/siba/siba_cc.c optional siba +dev/siba/siba_core.c optional siba +dev/siba/siba_pcib.c optional siba pci #mips/sentry5/siba_mips.c optional siba # not yet From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 21:14:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03120106566B; Thu, 18 Feb 2010 21:14:30 +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 E6BA38FC15; Thu, 18 Feb 2010 21:14: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 o1ILETf0080383; Thu, 18 Feb 2010 21:14:29 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ILETnw080381; Thu, 18 Feb 2010 21:14:29 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201002182114.o1ILETnw080381@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 18 Feb 2010 21:14: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: r204061 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 21:14:30 -0000 Author: edwin Date: Thu Feb 18 21:14:29 2010 New Revision: 204061 URL: http://svn.freebsd.org/changeset/base/204061 Log: Add heads-up requests for parts of the tree I look after and which are partly maintained by a third party: - share/zoneinfo - usr.sbin/zic - lib/libc/stdtime Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Thu Feb 18 20:20:34 2010 (r204060) +++ head/MAINTAINERS Thu Feb 18 21:14:29 2010 (r204061) @@ -125,6 +125,12 @@ gnu/usr.bin/send-pr bugmaster Pre-commit ncurses rafan Heads-up appreciated, try not to break it. *env(3) secteam Due to the problematic security history of this code, please have patches reviewed by secteam. +share/zoneinfo edwin Heads-up appreciated, since our data is coming + from a third party source. +usr.sbin/zic edwin Heads-up appreciated, since this code is + maintained by a third party source. +lib/libc/stdtime edwin Heads-up appreciated, since parts of this code + is maintained by a third party source. Following are the entries from the Makefiles, and a few other sources. Please remove stale entries from both their origin, and this file. From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 22:10:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9212C106566C; Thu, 18 Feb 2010 22:10:55 +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 8180C8FC08; Thu, 18 Feb 2010 22:10: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 o1IMAto1092783; Thu, 18 Feb 2010 22:10:55 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IMAtI7092781; Thu, 18 Feb 2010 22:10:55 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002182210.o1IMAtI7092781@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 18 Feb 2010 22:10: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: r204063 - head/sys/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 22:10:55 -0000 Author: pjd Date: Thu Feb 18 22:10:55 2010 New Revision: 204063 URL: http://svn.freebsd.org/changeset/base/204063 Log: Simplify code a bit. Modified: head/sys/nfsclient/nfs_kdtrace.c Modified: head/sys/nfsclient/nfs_kdtrace.c ============================================================================== --- head/sys/nfsclient/nfs_kdtrace.c Thu Feb 18 21:21:54 2010 (r204062) +++ head/sys/nfsclient/nfs_kdtrace.c Thu Feb 18 22:10:55 2010 (r204063) @@ -500,15 +500,11 @@ dtnfsclient_load(void *dummy) static int dtnfsclient_unload() { - int error = 0; dtrace_nfsclient_nfs23_start_probe = NULL; dtrace_nfsclient_nfs23_done_probe = NULL; - if ((error = dtrace_unregister(dtnfsclient_id)) != 0) - return (error); - - return (error); + return (dtrace_unregister(dtnfsclient_id)); } static int From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 22:12:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19E1610656BD; Thu, 18 Feb 2010 22:12:41 +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 096378FC15; Thu, 18 Feb 2010 22:12: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 o1IMCeqO093232; Thu, 18 Feb 2010 22:12:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IMCeGM093230; Thu, 18 Feb 2010 22:12:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002182212.o1IMCeGM093230@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 18 Feb 2010 22: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: r204064 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 22:12:41 -0000 Author: pjd Date: Thu Feb 18 22:12:40 2010 New Revision: 204064 URL: http://svn.freebsd.org/changeset/base/204064 Log: Use NULL instead of 0 when setting up pointer. Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Thu Feb 18 22:10:55 2010 (r204063) +++ head/sys/kern/uipc_syscalls.c Thu Feb 18 22:12:40 2010 (r204064) @@ -941,8 +941,8 @@ kern_recvit(td, s, mp, fromseg, controlp struct uio *ktruio = NULL; #endif - if(controlp != NULL) - *controlp = 0; + if (controlp != NULL) + *controlp = NULL; AUDIT_ARG_FD(s); error = getsock(td->td_proc->p_fd, s, &fp, NULL); From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 22:14:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 545021065676; Thu, 18 Feb 2010 22:14:45 +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 440048FC08; Thu, 18 Feb 2010 22:14: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 o1IMEjNm093722; Thu, 18 Feb 2010 22:14:45 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IMEjMq093720; Thu, 18 Feb 2010 22:14:45 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002182214.o1IMEjMq093720@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 18 Feb 2010 22:14: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: r204065 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 22:14:45 -0000 Author: pjd Date: Thu Feb 18 22:14:44 2010 New Revision: 204065 URL: http://svn.freebsd.org/changeset/base/204065 Log: Use vput() instead of VOP_UNLOCK()+vrele(). The comment here is out-dated, we no longer pass thread pointer to VOP_UNLOCK(). Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Thu Feb 18 22:12:40 2010 (r204064) +++ head/sys/kern/vfs_default.c Thu Feb 18 22:14:44 2010 (r204065) @@ -894,10 +894,7 @@ loop: error = VOP_FSYNC(vp, waitfor, td); if (error) allerror = error; - - /* Do not turn this into vput. td is not always curthread. */ - VOP_UNLOCK(vp, 0); - vrele(vp); + vput(vp); MNT_ILOCK(mp); } MNT_IUNLOCK(mp); From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 22:22:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3D2A106566B; Thu, 18 Feb 2010 22:22:45 +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 9E2868FC0C; Thu, 18 Feb 2010 22:22: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 o1IMMjAq095524; Thu, 18 Feb 2010 22:22:45 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IMMjNO095522; Thu, 18 Feb 2010 22:22:45 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002182222.o1IMMjNO095522@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 18 Feb 2010 22:22: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: r204066 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 22:22:46 -0000 Author: pjd Date: Thu Feb 18 22:22:45 2010 New Revision: 204066 URL: http://svn.freebsd.org/changeset/base/204066 Log: - Reduce scope of vnode lock. vfs_mount_alloc() doesn't need vnode to be locked. - Remove code duplication. Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Thu Feb 18 22:14:44 2010 (r204065) +++ head/sys/kern/vfs_mount.c Thu Feb 18 22:22:45 2010 (r204066) @@ -959,12 +959,12 @@ vfs_domount( } vp->v_iflag |= VI_MOUNT; VI_UNLOCK(vp); + VOP_UNLOCK(vp, 0); /* * Allocate and initialize the filesystem. */ mp = vfs_mount_alloc(vp, vfsp, fspath, td->td_ucred); - VOP_UNLOCK(vp, 0); /* XXXMAC: pass to vfs_mount_alloc? */ mp->mnt_optnew = fsdata; @@ -1060,12 +1060,12 @@ vfs_domount( * Put the new filesystem on the mount list after root. */ cache_purge(vp); + VI_LOCK(vp); + vp->v_iflag &= ~VI_MOUNT; + VI_UNLOCK(vp); if (!error) { struct vnode *newdp; - VI_LOCK(vp); - vp->v_iflag &= ~VI_MOUNT; - VI_UNLOCK(vp); vp->v_mountedhere = mp; mtx_lock(&mountlist_mtx); TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list); @@ -1083,9 +1083,6 @@ vfs_domount( if (error) vrele(vp); } else { - VI_LOCK(vp); - vp->v_iflag &= ~VI_MOUNT; - VI_UNLOCK(vp); vfs_unbusy(mp); vfs_mount_destroy(mp); vput(vp); From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 22:23:31 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40EC21065694; Thu, 18 Feb 2010 22:23:31 +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 306658FC22; Thu, 18 Feb 2010 22:23: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 o1IMNVBj095790; Thu, 18 Feb 2010 22:23:31 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IMNVc3095788; Thu, 18 Feb 2010 22:23:31 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002182223.o1IMNVc3095788@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 18 Feb 2010 22:23: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: r204067 - head/sys/boot/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 22:23:31 -0000 Author: pjd Date: Thu Feb 18 22:23:30 2010 New Revision: 204067 URL: http://svn.freebsd.org/changeset/base/204067 Log: Update comment. We also look for GPT partitions. Modified: head/sys/boot/zfs/zfs.c Modified: head/sys/boot/zfs/zfs.c ============================================================================== --- head/sys/boot/zfs/zfs.c Thu Feb 18 22:22:45 2010 (r204066) +++ head/sys/boot/zfs/zfs.c Thu Feb 18 22:23:30 2010 (r204067) @@ -397,7 +397,7 @@ zfs_dev_init(void) /* * Open all the disks we can find and see if we can reconstruct * ZFS pools from them. Bogusly assumes that the disks are named - * diskN or diskNsM. + * diskN, diskNpM or diskNsM. */ zfs_init(); for (unit = 0; unit < 32 /* XXX */; unit++) { From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 22:26:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C672106568F; Thu, 18 Feb 2010 22:26:02 +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 EF8028FC13; Thu, 18 Feb 2010 22:26: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 o1IMQ1Li096351; Thu, 18 Feb 2010 22:26:01 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IMQ1Os096347; Thu, 18 Feb 2010 22:26:01 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002182226.o1IMQ1Os096347@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 18 Feb 2010 22:26: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: r204068 - in head/sys: compat/linux netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 22:26:02 -0000 Author: pjd Date: Thu Feb 18 22:26:01 2010 New Revision: 204068 URL: http://svn.freebsd.org/changeset/base/204068 Log: No need to include security/mac/mac_framework.h here. Modified: head/sys/compat/linux/linux_stats.c head/sys/netinet/ip_mroute.c head/sys/netinet/ip_options.c Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Thu Feb 18 22:23:30 2010 (r204067) +++ head/sys/compat/linux/linux_stats.c Thu Feb 18 22:26:01 2010 (r204068) @@ -58,8 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - static void translate_vnhook_major_minor(struct vnode *vp, struct stat *sb) { Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Thu Feb 18 22:23:30 2010 (r204067) +++ head/sys/netinet/ip_mroute.c Thu Feb 18 22:26:01 2010 (r204068) @@ -114,8 +114,6 @@ __FBSDID("$FreeBSD$"); #include -#include - #ifndef KTR_IPMF #define KTR_IPMF KTR_INET #endif Modified: head/sys/netinet/ip_options.c ============================================================================== --- head/sys/netinet/ip_options.c Thu Feb 18 22:23:30 2010 (r204067) +++ head/sys/netinet/ip_options.c Thu Feb 18 22:26:01 2010 (r204068) @@ -65,8 +65,6 @@ __FBSDID("$FreeBSD$"); #include -#include - static int ip_dosourceroute = 0; SYSCTL_INT(_net_inet_ip, IPCTL_SOURCEROUTE, sourceroute, CTLFLAG_RW, &ip_dosourceroute, 0, "Enable forwarding source routed IP packets"); From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 22:27:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B64C91065676; Thu, 18 Feb 2010 22:27:38 +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 A5EA98FC17; Thu, 18 Feb 2010 22:27: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 o1IMRcmp096748; Thu, 18 Feb 2010 22:27:38 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IMRcc8096746; Thu, 18 Feb 2010 22:27:38 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002182227.o1IMRcc8096746@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 18 Feb 2010 22:27: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: r204069 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 22:27:38 -0000 Author: pjd Date: Thu Feb 18 22:27:38 2010 New Revision: 204069 URL: http://svn.freebsd.org/changeset/base/204069 Log: Log attach just like we log detach. Modified: head/sys/geom/geom_subr.c Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Thu Feb 18 22:26:01 2010 (r204068) +++ head/sys/geom/geom_subr.c Thu Feb 18 22:27:38 2010 (r204069) @@ -707,6 +707,7 @@ g_attach(struct g_consumer *cp, struct g g_topology_assert(); G_VALID_CONSUMER(cp); G_VALID_PROVIDER(pp); + g_trace(G_T_TOPOLOGY, "g_attach(%p, %p)", cp, pp); KASSERT(cp->provider == NULL, ("attach but attached")); cp->provider = pp; LIST_INSERT_HEAD(&pp->consumers, cp, consumers); From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 22:28:12 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D316F1065679; Thu, 18 Feb 2010 22:28:12 +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 C2AE38FC21; Thu, 18 Feb 2010 22:28: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 o1IMSClU096915; Thu, 18 Feb 2010 22:28:12 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IMSCsR096913; Thu, 18 Feb 2010 22:28:12 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002182228.o1IMSCsR096913@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 18 Feb 2010 22:28: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: r204070 - head/sys/geom/stripe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 22:28:12 -0000 Author: pjd Date: Thu Feb 18 22:28:12 2010 New Revision: 204070 URL: http://svn.freebsd.org/changeset/base/204070 Log: Correct comment. Modified: head/sys/geom/stripe/g_stripe.c Modified: head/sys/geom/stripe/g_stripe.c ============================================================================== --- head/sys/geom/stripe/g_stripe.c Thu Feb 18 22:27:38 2010 (r204069) +++ head/sys/geom/stripe/g_stripe.c Thu Feb 18 22:28:12 2010 (r204070) @@ -633,7 +633,7 @@ g_stripe_start(struct bio *bp) * Do use "economic" when: * 1. "Economic" mode is ON. * or - * 2. "Fast" mode failed. It can only failed if there is no memory. + * 2. "Fast" mode failed. It can only fail if there is no memory. */ if (!fast || error != 0) error = g_stripe_start_economic(bp, no, offset, length); From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 22:29:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7814B1065693; Thu, 18 Feb 2010 22:29:35 +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 665478FC0A; Thu, 18 Feb 2010 22:29: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 o1IMTZ9i097246; Thu, 18 Feb 2010 22:29:35 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IMTZJE097244; Thu, 18 Feb 2010 22:29:35 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002182229.o1IMTZJE097244@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 18 Feb 2010 22:29: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: r204071 - head/sys/geom/multipath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 22:29:35 -0000 Author: pjd Date: Thu Feb 18 22:29:35 2010 New Revision: 204071 URL: http://svn.freebsd.org/changeset/base/204071 Log: - Style fixes. - Prefer strlcpy() over strncpy(). Modified: head/sys/geom/multipath/g_multipath.c Modified: head/sys/geom/multipath/g_multipath.c ============================================================================== --- head/sys/geom/multipath/g_multipath.c Thu Feb 18 22:28:12 2010 (r204070) +++ head/sys/geom/multipath/g_multipath.c Thu Feb 18 22:29:35 2010 (r204071) @@ -95,9 +95,8 @@ g_mpd(void *arg, int flags __unused) g_topology_assert(); cp = arg; - if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) { + if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0) g_access(cp, -cp->acr, -cp->acw, -cp->ace); - } if (cp->provider) { printf("GEOM_MULTIPATH: %s removed from %s\n", cp->provider->name, cp->geom->name); @@ -222,15 +221,16 @@ g_multipath_done_error(struct bio *bp) static void g_multipath_kt(void *arg) { + g_multipath_kt_state = GKT_RUN; mtx_lock(&gmtbq_mtx); while (g_multipath_kt_state == GKT_RUN) { for (;;) { struct bio *bp; + bp = bioq_takefirst(&gmtbq); - if (bp == NULL) { + if (bp == NULL) break; - } mtx_unlock(&gmtbq_mtx); g_multipath_done_error(bp); mtx_lock(&gmtbq_mtx); @@ -264,9 +264,8 @@ g_multipath_access(struct g_provider *pp fail: LIST_FOREACH(cp, &gp->consumer, consumer) { - if (cp == badcp) { + if (cp == badcp) break; - } (void) g_access(cp, -dr, -dw, -de); } return (error); @@ -290,9 +289,8 @@ g_multipath_create(struct g_class *mp, s } gp = g_new_geomf(mp, md->md_name); - if (gp == NULL) { + if (gp == NULL) goto fail; - } sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); gp->softc = sc; @@ -303,9 +301,8 @@ g_multipath_create(struct g_class *mp, s memcpy(sc->sc_name, md->md_name, sizeof (sc->sc_name)); pp = g_new_providerf(gp, "multipath/%s", md->md_name); - if (pp == NULL) { + if (pp == NULL) goto fail; - } /* limit the provider to not have it stomp on metadata */ pp->mediasize = md->md_size - md->md_sectorsize; pp->sectorsize = md->md_sectorsize; @@ -314,9 +311,8 @@ g_multipath_create(struct g_class *mp, s return (gp); fail: if (gp != NULL) { - if (gp->softc != NULL) { + if (gp->softc != NULL) g_free(gp->softc); - } g_destroy_geom(gp); } return (NULL); @@ -338,9 +334,8 @@ g_multipath_add_disk(struct g_geom *gp, * Make sure that the passed provider isn't already attached */ LIST_FOREACH(cp, &gp->consumer, consumer) { - if (cp->provider == pp) { + if (cp->provider == pp) break; - } } if (cp) { printf("GEOM_MULTIPATH: provider %s already attached to %s\n", @@ -349,9 +344,8 @@ g_multipath_add_disk(struct g_geom *gp, } nxtcp = LIST_FIRST(&gp->consumer); cp = g_new_consumer(gp); - if (cp == NULL) { + if (cp == NULL) return (ENOMEM); - } error = g_attach(cp, pp); if (error != 0) { printf("GEOM_MULTIPATH: cannot attach %s to %s", @@ -392,13 +386,11 @@ g_multipath_destroy(struct g_geom *gp) struct g_provider *pp; g_topology_assert(); - if (gp->softc == NULL) { + if (gp->softc == NULL) return (ENXIO); - } pp = LIST_FIRST(&gp->provider); - if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0)) { + if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0)) return (EBUSY); - } printf("GEOM_MULTIPATH: destroying %s\n", gp->name); g_free(gp->softc); gp->softc = NULL; @@ -410,6 +402,7 @@ static int g_multipath_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp) { + return (g_multipath_destroy(gp)); } @@ -418,9 +411,8 @@ g_multipath_init(struct g_class *mp) { bioq_init(&gmtbq); mtx_init(&gmtbq_mtx, "gmtbq", NULL, MTX_DEF); - if (kproc_create(g_multipath_kt, mp, NULL, 0, 0, "g_mp_kt") == 0) { + if (kproc_create(g_multipath_kt, mp, NULL, 0, 0, "g_mp_kt") == 0) g_multipath_kt_state = GKT_RUN; - } } static void @@ -446,18 +438,16 @@ g_multipath_read_metadata(struct g_consu g_topology_assert(); error = g_access(cp, 1, 0, 0); - if (error != 0) { + if (error != 0) return (error); - } pp = cp->provider; g_topology_unlock(); buf = g_read_data(cp, pp->mediasize - pp->sectorsize, pp->sectorsize, &error); g_topology_lock(); g_access(cp, -1, 0, 0); - if (buf == NULL) { + if (buf == NULL) return (error); - } multipath_metadata_decode(buf, md); g_free(buf); return (0); @@ -484,15 +474,13 @@ g_multipath_taste(struct g_class *mp, st g_detach(cp); g_destroy_consumer(cp); g_destroy_geom(gp); - if (error != 0) { + if (error != 0) return (NULL); - } gp = NULL; if (strcmp(md.md_magic, G_MULTIPATH_MAGIC) != 0) { - if (g_multipath_debug) { + if (g_multipath_debug) printf("%s is not MULTIPATH\n", pp->name); - } return (NULL); } if (md.md_version != G_MULTIPATH_VERSION) { @@ -501,9 +489,8 @@ g_multipath_taste(struct g_class *mp, st G_MULTIPATH_VERSION); return (NULL); } - if (g_multipath_debug) { + if (g_multipath_debug) printf("MULTIPATH: %s/%s\n", md.md_name, md.md_uuid); - } /* * Let's check if such a device already is present. We check against @@ -519,25 +506,20 @@ g_multipath_taste(struct g_class *mp, st sc = NULL; LIST_FOREACH(gp, &mp->geom, geom) { sc = gp->softc; - if (sc == NULL) { + if (sc == NULL) continue; - } - if (strncmp(md.md_uuid, sc->sc_uuid, sizeof(md.md_uuid)) == 0) { + if (strncmp(md.md_uuid, sc->sc_uuid, sizeof(md.md_uuid)) == 0) break; - } } LIST_FOREACH(gp1, &mp->geom, geom) { - if (gp1 == gp) { + if (gp1 == gp) continue; - } sc = gp1->softc; - if (sc == NULL) { + if (sc == NULL) continue; - } - if (strncmp(md.md_name, sc->sc_name, sizeof(md.md_name)) == 0) { + if (strncmp(md.md_name, sc->sc_name, sizeof(md.md_name)) == 0) break; - } } /* @@ -564,9 +546,9 @@ g_multipath_taste(struct g_class *mp, st sc->sc_name, sc->sc_uuid); printf("GEOM_MULTIPATH: %s will be (temporarily) %s\n", md.md_uuid, buf); - strlcpy(md.md_name, buf, sizeof (md.md_name)); + strlcpy(md.md_name, buf, sizeof(md.md_name)); } else { - strlcpy(md.md_name, sc->sc_name, sizeof (md.md_name)); + strlcpy(md.md_name, sc->sc_name, sizeof(md.md_name)); } } @@ -586,9 +568,8 @@ g_multipath_taste(struct g_class *mp, st KASSERT(sc != NULL, ("sc is NULL")); error = g_multipath_add_disk(gp, pp); if (error != 0) { - if (isnew) { + if (isnew) g_multipath_destroy(gp); - } return (NULL); } return (gp); @@ -627,9 +608,8 @@ g_multipath_ctl_create(struct gctl_req * gctl_error(req, "No 'arg1' argument"); return; } - if (strncmp(name, devpf, 5) == 0) { + if (strncmp(name, devpf, 5) == 0) name += 5; - } pp0 = g_provider_by_name(name); if (pp0 == NULL) { gctl_error(req, "Provider %s is invalid", name); @@ -641,9 +621,8 @@ g_multipath_ctl_create(struct gctl_req * gctl_error(req, "No 'arg2' argument"); return; } - if (strncmp(name, devpf, 5) == 0) { + if (strncmp(name, devpf, 5) == 0) name += 5; - } pp1 = g_provider_by_name(name); if (pp1 == NULL) { gctl_error(req, "Provider %s is invalid", name); @@ -687,13 +666,12 @@ g_multipath_ctl_create(struct gctl_req * memset(&md, 0, sizeof(md)); md.md_size = pp0->mediasize; md.md_sectorsize = pp0->sectorsize; - strncpy(md.md_name, mpname, sizeof (md.md_name)); - strncpy(md.md_uuid, uuid, sizeof (md.md_uuid)); + strlcpy(md.md_name, mpname, sizeof(md.md_name)); + strlcpy(md.md_uuid, uuid, sizeof(md.md_uuid)); gp = g_multipath_create(mp, &md); - if (gp == NULL) { + if (gp == NULL) return; - } error = g_multipath_add_disk(gp, pp0); if (error) { g_multipath_destroy(gp); From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 22:30:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52F1D1065676; Thu, 18 Feb 2010 22:30:38 +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 421718FC08; Thu, 18 Feb 2010 22:30: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 o1IMUcdD097520; Thu, 18 Feb 2010 22:30:38 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IMUcn3097518; Thu, 18 Feb 2010 22:30:38 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002182230.o1IMUcn3097518@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 18 Feb 2010 22:30: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: r204072 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 22:30:38 -0000 Author: pjd Date: Thu Feb 18 22:30:37 2010 New Revision: 204072 URL: http://svn.freebsd.org/changeset/base/204072 Log: No need to include security/mac/mac_framework.h here. Modified: head/sys/netinet6/in6_pcb.c Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Thu Feb 18 22:29:35 2010 (r204071) +++ head/sys/netinet6/in6_pcb.c Thu Feb 18 22:30:37 2010 (r204072) @@ -101,8 +101,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - struct in6_addr zeroin6_addr; int From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 22:31:43 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC2BB106568B; Thu, 18 Feb 2010 22:31:43 +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 AAF578FC15; Thu, 18 Feb 2010 22:31: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 o1IMVhB6097788; Thu, 18 Feb 2010 22:31:43 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IMVhKW097786; Thu, 18 Feb 2010 22:31:43 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002182231.o1IMVhKW097786@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 18 Feb 2010 22:31: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: r204073 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 22:31:43 -0000 Author: pjd Date: Thu Feb 18 22:31:43 2010 New Revision: 204073 URL: http://svn.freebsd.org/changeset/base/204073 Log: Add tunable and sysctl to skip hostid check on pool import. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Feb 18 22:30:37 2010 (r204072) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Thu Feb 18 22:31:43 2010 (r204073) @@ -62,6 +62,14 @@ #include "zfs_prop.h" #include "zfs_comutil.h" +/* Check hostid on import? */ +static int check_hostid = 1; + +SYSCTL_DECL(_vfs_zfs); +TUNABLE_INT("vfs.zfs.check_hostid", &check_hostid); +SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RW, &check_hostid, 0, + "Check hostid on import?"); + int zio_taskq_threads[ZIO_TYPES][ZIO_TASKQ_TYPES] = { /* ISSUE INTR */ { 1, 1 }, /* ZIO_TYPE_NULL */ @@ -1168,7 +1176,7 @@ spa_load(spa_t *spa, nvlist_t *config, s ZPOOL_CONFIG_HOSTNAME, &hostname) == 0); (void) ddi_strtoul(hw_serial, NULL, 10, &myhostid); - if (hostid != 0 && myhostid != 0 && + if (check_hostid && hostid != 0 && myhostid != 0 && (unsigned long)hostid != myhostid) { cmn_err(CE_WARN, "pool '%s' could not be " "loaded as it was last accessed by " From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 22:34:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7861106566B; Thu, 18 Feb 2010 22:34:29 +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 C73578FC0A; Thu, 18 Feb 2010 22:34: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 o1IMYTcZ098458; Thu, 18 Feb 2010 22:34:29 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IMYTWB098456; Thu, 18 Feb 2010 22:34:29 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002182234.o1IMYTWB098456@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 18 Feb 2010 22:34: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: r204074 - head/sys/netipsec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 22:34:29 -0000 Author: pjd Date: Thu Feb 18 22:34:29 2010 New Revision: 204074 URL: http://svn.freebsd.org/changeset/base/204074 Log: Correct typo in comment. Modified: head/sys/netipsec/keydb.h Modified: head/sys/netipsec/keydb.h ============================================================================== --- head/sys/netipsec/keydb.h Thu Feb 18 22:31:43 2010 (r204073) +++ head/sys/netipsec/keydb.h Thu Feb 18 22:34:29 2010 (r204074) @@ -52,7 +52,7 @@ union sockaddr_union { /* Security Assocciation Index */ /* NOTE: Ensure to be same address family */ struct secasindex { - union sockaddr_union src; /* srouce address for SA */ + union sockaddr_union src; /* source address for SA */ union sockaddr_union dst; /* destination address for SA */ u_int16_t proto; /* IPPROTO_ESP or IPPROTO_AH */ u_int8_t mode; /* mode of protocol, see ipsec.h */ From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 22:42:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B862B1065670; Thu, 18 Feb 2010 22:42:15 +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 3E4618FC13; Thu, 18 Feb 2010 22:42:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.4/8.14.4) with ESMTP id o1IMgDVw035576; Fri, 19 Feb 2010 01:42:13 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Fri, 19 Feb 2010 01:42:13 +0300 (MSK) From: Dmitry Morozovsky To: Pawel Jakub Dawidek In-Reply-To: <201002182231.o1IMVhKW097786@svn.freebsd.org> Message-ID: References: <201002182231.o1IMVhKW097786@svn.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.3 (woozle.rinet.ru [0.0.0.0]); Fri, 19 Feb 2010 01:42:13 +0300 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204073 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 22:42:15 -0000 On Thu, 18 Feb 2010, Pawel Jakub Dawidek wrote: PJD> Log: PJD> Add tunable and sysctl to skip hostid check on pool import. Wow, thank you! What do you think about disabling this check by default (no MFCs, surely, due to POLA)? And, is it possible to distinguish hardware changes from OS changes? (if it's possible, I suppose only OS changes should be default stopgap from importing/mounting) -- 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-head@FreeBSD.ORG Thu Feb 18 22:54:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 750C3106566C; Thu, 18 Feb 2010 22:54:26 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id B0D858FC1D; Thu, 18 Feb 2010 22:54:25 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 6718A45CDC; Thu, 18 Feb 2010 23:54:23 +0100 (CET) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id D2DB445C9C; Thu, 18 Feb 2010 23:54:16 +0100 (CET) Date: Thu, 18 Feb 2010 23:54:14 +0100 From: Pawel Jakub Dawidek To: Dmitry Morozovsky Message-ID: <20100218225414.GA2157@garage.freebsd.pl> References: <201002182231.o1IMVhKW097786@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Dxnq1zWXvFF0Q93v" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204073 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 22:54:26 -0000 --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 19, 2010 at 01:42:13AM +0300, Dmitry Morozovsky wrote: > On Thu, 18 Feb 2010, Pawel Jakub Dawidek wrote: >=20 > PJD> Log: > PJD> Add tunable and sysctl to skip hostid check on pool import. >=20 > Wow, thank you! >=20 > What do you think about disabling this check by default (no MFCs, surely,= due=20 > to POLA)? And, is it possible to distinguish hardware changes from OS cha= nges? > (if it's possible, I suppose only OS changes should be default stopgap fr= om=20 > importing/mounting) I'm definiatelly against turning off this check by default. Especially now, when HAST will hit the tree in a moment and you can share storage between machines. It would be too easy to shoot yourself in the foot. Although it might not be good idea to suggest setting this tunable when hostid doesn't match with printf on the console. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --Dxnq1zWXvFF0Q93v Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkt9xRYACgkQForvXbEpPzQMxwCgwVawHf0Z49abgN/os6hSEJY9 beAAn39pHftPLu/0jbvFTXMnCqK39fUm =Ua/a -----END PGP SIGNATURE----- --Dxnq1zWXvFF0Q93v-- From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 23:04:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FA3D106566B; Thu, 18 Feb 2010 23:04:01 +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 6479D8FC1B; Thu, 18 Feb 2010 23:04: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 o1IN413U005047; Thu, 18 Feb 2010 23:04:01 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IN41gs005044; Thu, 18 Feb 2010 23:04:01 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002182304.o1IN41gs005044@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 18 Feb 2010 23:04: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: r204075 - in head/sbin/ggate: ggated shared X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 23:04:01 -0000 Author: pjd Date: Thu Feb 18 23:04:01 2010 New Revision: 204075 URL: http://svn.freebsd.org/changeset/base/204075 Log: Style nits. Modified: head/sbin/ggate/ggated/ggated.c head/sbin/ggate/shared/ggate.c Modified: head/sbin/ggate/ggated/ggated.c ============================================================================== --- head/sbin/ggate/ggated/ggated.c Thu Feb 18 22:34:29 2010 (r204074) +++ head/sbin/ggate/ggated/ggated.c Thu Feb 18 23:04:01 2010 (r204075) @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE Modified: head/sbin/ggate/shared/ggate.c ============================================================================== --- head/sbin/ggate/shared/ggate.c Thu Feb 18 22:34:29 2010 (r204074) +++ head/sbin/ggate/shared/ggate.c Thu Feb 18 23:04:01 2010 (r204075) @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -159,7 +159,7 @@ g_gate_sectorsize(int fd) g_gate_xlog("fstat(): %s.", strerror(errno)); if (S_ISCHR(sb.st_mode)) { if (ioctl(fd, DIOCGSECTORSIZE, &secsize) == -1) { - g_gate_xlog("Can't get sector size: %s.", + g_gate_xlog("Can't get sector size: %s.", strerror(errno)); } } else if (S_ISREG(sb.st_mode)) { @@ -174,7 +174,7 @@ void g_gate_open_device(void) { - g_gate_devfd = open("/dev/" G_GATE_CTL_NAME, O_RDWR, 0); + g_gate_devfd = open("/dev/" G_GATE_CTL_NAME, O_RDWR); if (g_gate_devfd == -1) err(EXIT_FAILURE, "open(/dev/%s)", G_GATE_CTL_NAME); } @@ -281,7 +281,7 @@ g_gate_socket_settings(int sfd) /* Socket settings. */ on = 1; if (nagle) { - if (setsockopt(sfd, IPPROTO_TCP, TCP_NODELAY, &on, + if (setsockopt(sfd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) == -1) { g_gate_xlog("setsockopt() error: %s.", strerror(errno)); } From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 23:16:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FBCB106566B; Thu, 18 Feb 2010 23:16:20 +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 2A6278FC08; Thu, 18 Feb 2010 23:16: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 o1INGKs2007799; Thu, 18 Feb 2010 23:16:20 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1INGKqf007786; Thu, 18 Feb 2010 23:16:20 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002182316.o1INGKqf007786@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 18 Feb 2010 23:16: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: r204076 - in head: etc/defaults etc/rc.d sbin sbin/ggate/ggatec sbin/ggate/ggatel sbin/hastctl sbin/hastd share/examples share/examples/hast share/man/man5 sys/geom/gate X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 23:16:20 -0000 Author: pjd Date: Thu Feb 18 23:16:19 2010 New Revision: 204076 URL: http://svn.freebsd.org/changeset/base/204076 Log: Please welcome HAST - Highly Avalable Storage. HAST allows to transparently store data on two physically separated machines connected over the TCP/IP network. HAST works in Primary-Secondary (Master-Backup, Master-Slave) configuration, which means that only one of the cluster nodes can be active at any given time. Only Primary node is able to handle I/O requests to HAST-managed devices. Currently HAST is limited to two cluster nodes in total. HAST operates on block level - it provides disk-like devices in /dev/hast/ directory for use by file systems and/or applications. Working on block level makes it transparent for file systems and applications. There in no difference between using HAST-provided device and raw disk, partition, etc. All of them are just regular GEOM providers in FreeBSD. For more information please consult hastd(8), hastctl(8) and hast.conf(5) manual pages, as well as http://wiki.FreeBSD.org/HAST. Sponsored by: FreeBSD Foundation Sponsored by: OMCnet Internet Service GmbH Sponsored by: TransIP BV Added: head/etc/rc.d/hastd (contents, props changed) head/sbin/hastctl/ head/sbin/hastctl/Makefile (contents, props changed) head/sbin/hastctl/hastctl.8 (contents, props changed) head/sbin/hastctl/hastctl.c (contents, props changed) head/sbin/hastd/ head/sbin/hastd/Makefile (contents, props changed) head/sbin/hastd/activemap.c (contents, props changed) head/sbin/hastd/activemap.h (contents, props changed) head/sbin/hastd/control.c (contents, props changed) head/sbin/hastd/control.h (contents, props changed) head/sbin/hastd/ebuf.c (contents, props changed) head/sbin/hastd/ebuf.h (contents, props changed) head/sbin/hastd/hast.conf.5 (contents, props changed) head/sbin/hastd/hast.h (contents, props changed) head/sbin/hastd/hast_proto.c (contents, props changed) head/sbin/hastd/hast_proto.h (contents, props changed) head/sbin/hastd/hastd.8 (contents, props changed) head/sbin/hastd/hastd.c (contents, props changed) head/sbin/hastd/hastd.h (contents, props changed) head/sbin/hastd/hooks.c (contents, props changed) head/sbin/hastd/hooks.h (contents, props changed) head/sbin/hastd/metadata.c (contents, props changed) head/sbin/hastd/metadata.h (contents, props changed) head/sbin/hastd/nv.c (contents, props changed) head/sbin/hastd/nv.h (contents, props changed) head/sbin/hastd/parse.y (contents, props changed) head/sbin/hastd/pjdlog.c (contents, props changed) head/sbin/hastd/pjdlog.h (contents, props changed) head/sbin/hastd/primary.c (contents, props changed) head/sbin/hastd/proto.c (contents, props changed) head/sbin/hastd/proto.h (contents, props changed) head/sbin/hastd/proto_common.c (contents, props changed) head/sbin/hastd/proto_impl.h (contents, props changed) head/sbin/hastd/proto_socketpair.c (contents, props changed) head/sbin/hastd/proto_tcp4.c (contents, props changed) head/sbin/hastd/proto_uds.c (contents, props changed) head/sbin/hastd/rangelock.c (contents, props changed) head/sbin/hastd/rangelock.h (contents, props changed) head/sbin/hastd/secondary.c (contents, props changed) head/sbin/hastd/subr.c (contents, props changed) head/sbin/hastd/subr.h (contents, props changed) head/sbin/hastd/synch.h (contents, props changed) head/sbin/hastd/token.l (contents, props changed) head/share/examples/hast/ head/share/examples/hast/ucarp.sh (contents, props changed) head/share/examples/hast/ucarp_down.sh (contents, props changed) head/share/examples/hast/ucarp_up.sh (contents, props changed) head/share/examples/hast/vip-down.sh (contents, props changed) head/share/examples/hast/vip-up.sh (contents, props changed) Modified: head/etc/defaults/rc.conf head/etc/rc.d/Makefile head/sbin/Makefile head/sbin/ggate/ggatec/ggatec.c head/sbin/ggate/ggatel/ggatel.c head/share/examples/Makefile head/share/man/man5/rc.conf.5 head/sys/geom/gate/g_gate.c head/sys/geom/gate/g_gate.h Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Thu Feb 18 23:04:01 2010 (r204075) +++ head/etc/defaults/rc.conf Thu Feb 18 23:16:19 2010 (r204076) @@ -260,6 +260,9 @@ syslogd_flags="-s" # Flags to syslogd ( inetd_enable="NO" # Run the network daemon dispatcher (YES/NO). inetd_program="/usr/sbin/inetd" # path to inetd, if you want a different one. inetd_flags="-wW -C 60" # Optional flags to inetd +hastd_enable="NO" # Run the HAST daemon (YES/NO). +hastd_program="/sbin/hastd" # path to hastd, if you want a different one. +hastd_flags="" # Optional flags to hastd. # # named. It may be possible to run named in a sandbox, man security for # details. Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Thu Feb 18 23:04:01 2010 (r204075) +++ head/etc/rc.d/Makefile Thu Feb 18 23:16:19 2010 (r204076) @@ -12,7 +12,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI encswap \ faith fsck ftp-proxy ftpd \ gbde geli geli2 gssd \ - hcsecd \ + hastd hcsecd \ hostapd hostid hostid_save hostname \ inetd initrandom \ ip6addrctl ipfilter ipfs ipfw ipmon \ Added: head/etc/rc.d/hastd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/hastd Thu Feb 18 23:16:19 2010 (r204076) @@ -0,0 +1,31 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: hastd +# REQUIRE: NETWORKING syslogd +# BEFORE: DAEMON + +. /etc/rc.subr + +name="hastd" +rcvar=`set_rcvar` +pidfile="/var/run/${name}.pid" +command="/sbin/${name}" +hastctl="/sbin/hastctl" +required_files="/etc/hast.conf" +stop_precmd="hastd_stop_precmd" +required_modules="geom_gate:g_gate" + +sockfile="/var/run/syslogd.sockets" +evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\"" +altlog_proglist="named" + +hastd_stop_precmd() +{ + ${hastctl} role init all +} + +load_rc_config $name +run_rc_command "$1" Modified: head/sbin/Makefile ============================================================================== --- head/sbin/Makefile Thu Feb 18 23:04:01 2010 (r204075) +++ head/sbin/Makefile Thu Feb 18 23:16:19 2010 (r204076) @@ -36,6 +36,8 @@ SUBDIR= adjkerntz \ ggate \ growfs \ gvinum \ + hastctl \ + hastd \ ifconfig \ init \ ${_ipf} \ Modified: head/sbin/ggate/ggatec/ggatec.c ============================================================================== --- head/sbin/ggate/ggatec/ggatec.c Thu Feb 18 23:04:01 2010 (r204075) +++ head/sbin/ggate/ggatec/ggatec.c Thu Feb 18 23:16:19 2010 (r204076) @@ -59,7 +59,7 @@ enum { UNSET, CREATE, DESTROY, LIST, RES static const char *path = NULL; static const char *host = NULL; -static int unit = -1; +static int unit = G_GATE_UNIT_AUTO; static unsigned flags = 0; static int force = 0; static unsigned queue_size = G_GATE_QUEUE_SIZE; Modified: head/sbin/ggate/ggatel/ggatel.c ============================================================================== --- head/sbin/ggate/ggatel/ggatel.c Thu Feb 18 23:04:01 2010 (r204075) +++ head/sbin/ggate/ggatel/ggatel.c Thu Feb 18 23:16:19 2010 (r204076) @@ -50,7 +50,7 @@ enum { UNSET, CREATE, DESTROY, LIST, RESCUE } action = UNSET; static const char *path = NULL; -static int unit = -1; +static int unit = G_GATE_UNIT_AUTO; static unsigned flags = 0; static int force = 0; static unsigned queue_size = G_GATE_QUEUE_SIZE; Added: head/sbin/hastctl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/hastctl/Makefile Thu Feb 18 23:16:19 2010 (r204076) @@ -0,0 +1,36 @@ +# $FreeBSD$ + +.include + +.PATH: ${.CURDIR}/../hastd + +PROG= hastctl +SRCS= activemap.c +SRCS+= ebuf.c +SRCS+= hast_proto.c hastctl.c +SRCS+= metadata.c +SRCS+= nv.c +SRCS+= parse.y pjdlog.c +SRCS+= proto.c proto_common.c proto_tcp4.c proto_uds.c +SRCS+= token.l +SRCS+= subr.c +SRCS+= y.tab.h +WARNS?= 6 +MAN= hastctl.8 + +CFLAGS+=-I${.CURDIR}/../hastd +CFLAGS+=-DINET +.if ${MK_INET6_SUPPORT} != "no" +CFLAGS+=-DINET6 +.endif +# This is needed to have WARNS > 1. +CFLAGS+=-DYY_NO_UNPUT + +DPADD= ${LIBCRYPTO} ${LIBL} +LDADD= -lcrypto -ll + +YFLAGS+=-v + +CLEANFILES=y.tab.c y.tab.h y.output + +.include Added: head/sbin/hastctl/hastctl.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/hastctl/hastctl.8 Thu Feb 18 23:16:19 2010 (r204076) @@ -0,0 +1,217 @@ +.\" Copyright (c) 2010 The FreeBSD Foundation +.\" All rights reserved. +.\" +.\" This software was developed by Pawel Jakub Dawidek under sponsorship from +.\" the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 1, 2010 +.Dt HASTCTL 8 +.Os +.Sh NAME +.Nm hastctl +.Nd "Highly Available Storage control utility" +.Sh SYNOPSIS +.Nm +.Cm create +.Op Fl d +.Op Fl c Ar config +.Op Fl e Ar extentsize +.Op Fl k Ar keepdirty +.Op Fl m Ar mediasize +.Ar name ... +.Nm +.Cm role +.Op Fl d +.Op Fl c Ar config +.Aq init | primary | secondary +.Ar all | name ... +.Nm +.Cm status +.Op Fl d +.Op Fl c Ar config +.Op Ar all | name ... +.Nm +.Cm dump +.Op Fl d +.Op Fl c Ar config +.Op Ar all | name ... +.Sh DESCRIPTION +The +.Nm +utility is used to control the behaviour of the +.Xr hastd 8 +daemon. +.Pp +This utility should be used by HA software like +.Nm heartbeat +or +.Nm ucarp +to setup HAST resources role when changing from primary mode to +secondary or vice versa. +Be aware that if a file system like UFS exists on HAST provider and +primary node dies, file system has to be checked for inconsistencies +with the +.Xr fsck 8 +utility after switching secondary node to primary role. +.Pp +The first argument to +.Nm +indicates an action to be performed: +.Bl -tag -width ".Cm create" +.It Cm create +Initialize local provider configured for the given resource. +Additional options include: +.Bl -tag -width ".Fl e Ar extentsize" +.It Fl e Ar extentsize +Size of an extent. +Extent is a block which is used for synchronization. +.Nm +maintains a map of dirty extents and extent is the smallest region that +can be marked as dirty. +If any part of an extent is modified, entire extent will be synchronized +when nodes connect. +If extent size is too small, there will be too much disk activity +related to dirty map updates, which will degrade performance of the +given resource. +If extent size is too large, synchronization, even in case of short +outage, can take a long time increasing the risk of loosing up-to-date +node before synchronization process is completed. +The default extent size is +.Va 2MB . +.It Fl k Ar keepdirty +Maximum number of dirty extents to keep dirty all the time. +Most recently used extents are kept dirty to reduce number of metadata +updates. +The default numer of most recently used extents which will be kept +dirty is +.Va 64 . +.It Fl m Ar mediasize +Size of the smaller provider used as backend storage on both nodes. +This option can be omitted if node providers have the same size on both +sides. +.El +.It Cm role +Change role of the given resource. +The role can be one of: +.Bl -tag -width ".Cm secondary" +.It Cm init +Resource is turned off. +.It Cm primary +Local +.Xr hastd 8 +daemon will act as primary node for the given resource. +System on which resource role is set to primary can use +.Pa /dev/hast/ +GEOM provider. +.It Cm secondary +Local +.Xr hastd 8 +daemon will act as secondary node for the given resource - it will wait +for connection from the primary node and will handle I/O requests +received from it. +GEOM provider +.Pa /dev/hast/ +will not be created on secondary node. +.El +.It Cm status +Present status of the configured resources. +.It Cm dump +Dump metadata stored on local component for the configured resources. +.El +.Pp +In addition, every subcommand can be followed by the following options: +.Bl -tag -width ".Fl c Ar config" +.It Fl c Ar config +Specify alternative location of the configuration file. +The default location is +.Pa /etc/hast.conf . +.It Fl d +Print debugging information. +This option can be specified multiple times to raise the verbosity +level. +.El +.Sh EXIT STATUS +Exit status is 0 on success, or one of the values described in +.Xr sysexits 3 +on failure. +.Sh EXAMPLES +Initialize HAST provider, create file system on it and mount it. +.Bd -literal -offset indent +nodeB# hastctl create shared +nodeB# hastd +nodeB# hastctl role secondary shared + +nodeB# hastctl create shared +nodeA# hastd +nodeA# hastctl role primary shared +nodeA# newfs -U /dev/hast/shared +nodeA# mount -o noatime /dev/hast/shared /shared +nodeA# application_start +.Ed +.Pp +Switch roles for the +.Nm shared +HAST resource. +.Bd -literal -offset indent +nodeA# application_stop +nodeA# umount -f /shared +nodeA# hastctl role secondary shared + +nodeB# hastctl role primary shared +nodeB# fsck -t ufs /dev/hast/shared +nodeB# mount -o noatime /dev/hast/shared /shared +nodeB# application_start +.Ed +.Sh FILES +.Bl -tag -width ".Pa /var/run/hastctl" -compact +.It Pa /etc/hast.conf +Configuration file for +.Nm +and +.Xr hastd 8 . +.It Pa /var/run/hastctl +Control socket used by +.Nm +to communicate with the +.Xr hastd 8 +daemon. +.El +.Sh SEE ALSO +.Xr sysexits 3 , +.Xr geom 4 , +.Xr hast.conf 5 , +.Xr fsck 8 , +.Xr ggatec 8 , +.Xr ggatel 8 , +.Xr hastd 8 , +.Xr mount 8 , +.Xr newfs 8 . +.Sh AUTHORS +The +.Nm +was developed by +.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org +under sponsorship of the FreeBSD Foundation. Added: head/sbin/hastctl/hastctl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/hastctl/hastctl.c Thu Feb 18 23:16:19 2010 (r204076) @@ -0,0 +1,526 @@ +/*- + * Copyright (c) 2009-2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Pawel Jakub Dawidek under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "hast.h" +#include "hast_proto.h" +#include "metadata.h" +#include "nv.h" +#include "pjdlog.h" +#include "proto.h" +#include "subr.h" + +/* Path to configuration file. */ +static const char *cfgpath = HAST_CONFIG; +/* Hastd configuration. */ +static struct hastd_config *cfg; +/* Control connection. */ +static struct proto_conn *controlconn; + +enum { + CMD_INVALID, + CMD_CREATE, + CMD_ROLE, + CMD_STATUS, + CMD_DUMP +}; + +static __dead2 void +usage(void) +{ + + fprintf(stderr, + "usage: %s create [-d] [-c config] [-e extentsize] [-k keepdirty]\n" + "\t\t[-m mediasize] name ...\n", + getprogname()); + fprintf(stderr, + " %s role [-d] [-c config] all | name ...\n", + getprogname()); + fprintf(stderr, + " %s status [-d] [-c config] [all | name ...]\n", + getprogname()); + fprintf(stderr, + " %s dump [-d] [-c config] [all | name ...]\n", + getprogname()); + exit(EX_USAGE); +} + +static int +create_one(struct hast_resource *res, intmax_t mediasize, intmax_t extentsize, + intmax_t keepdirty) +{ + unsigned char *buf; + size_t mapsize; + int ec; + + ec = 0; + pjdlog_prefix_set("[%s] ", res->hr_name); + + if (provinfo(res, true) < 0) { + ec = EX_NOINPUT; + goto end; + } + if (mediasize == 0) + mediasize = res->hr_local_mediasize; + else if (mediasize > res->hr_local_mediasize) { + pjdlog_error("Provided mediasize is larger than provider %s size.", + res->hr_localpath); + ec = EX_DATAERR; + goto end; + } + if (!powerof2(res->hr_local_sectorsize)) { + pjdlog_error("Sector size of provider %s is not power of 2 (%u).", + res->hr_localpath, res->hr_local_sectorsize); + ec = EX_DATAERR; + goto end; + } + if (extentsize == 0) + extentsize = HAST_EXTENTSIZE; + if (extentsize < res->hr_local_sectorsize) { + pjdlog_error("Extent size (%jd) is less than sector size (%u).", + (intmax_t)extentsize, res->hr_local_sectorsize); + ec = EX_DATAERR; + goto end; + } + if ((extentsize % res->hr_local_sectorsize) != 0) { + pjdlog_error("Extent size (%jd) is not multiple of sector size (%u).", + (intmax_t)extentsize, res->hr_local_sectorsize); + ec = EX_DATAERR; + goto end; + } + mapsize = activemap_calc_ondisk_size(mediasize - METADATA_SIZE, + extentsize, res->hr_local_sectorsize); + if (keepdirty == 0) + keepdirty = HAST_KEEPDIRTY; + res->hr_datasize = mediasize - METADATA_SIZE - mapsize; + res->hr_extentsize = extentsize; + res->hr_keepdirty = keepdirty; + + res->hr_localoff = METADATA_SIZE + mapsize; + + if (metadata_write(res) < 0) { + ec = EX_IOERR; + goto end; + } + buf = calloc(1, mapsize); + if (buf == NULL) { + pjdlog_error("Unable to allocate %zu bytes of memory for initial bitmap.", + mapsize); + ec = EX_TEMPFAIL; + goto end; + } + if (pwrite(res->hr_localfd, buf, mapsize, METADATA_SIZE) != + (ssize_t)mapsize) { + pjdlog_errno(LOG_ERR, "Unable to store initial bitmap on %s", + res->hr_localpath); + free(buf); + ec = EX_IOERR; + goto end; + } + free(buf); +end: + if (res->hr_localfd >= 0) + close(res->hr_localfd); + pjdlog_prefix_set("%s", ""); + return (ec); +} + +static void +control_create(int argc, char *argv[], intmax_t mediasize, intmax_t extentsize, + intmax_t keepdirty) +{ + struct hast_resource *res; + int ec, ii, ret; + + /* Initialize the given resources. */ + if (argc < 1) + usage(); + ec = 0; + for (ii = 0; ii < argc; ii++) { + TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) { + if (strcmp(argv[ii], res->hr_name) == 0) + break; + } + if (res == NULL) { + pjdlog_error("Unknown resource %s.", argv[ii]); + if (ec == 0) + ec = EX_DATAERR; + continue; + } + ret = create_one(res, mediasize, extentsize, keepdirty); + if (ret != 0 && ec == 0) + ec = ret; + } + exit(ec); +} + +static int +dump_one(struct hast_resource *res) +{ + int ret; + + ret = metadata_read(res, false); + if (ret != 0) + return (ret); + + printf("resource: %s\n", res->hr_name); + printf(" datasize: %ju\n", (uintmax_t)res->hr_datasize); + printf(" extentsize: %d\n", res->hr_extentsize); + printf(" keepdirty: %d\n", res->hr_keepdirty); + printf(" localoff: %ju\n", (uintmax_t)res->hr_localoff); + printf(" resuid: %ju\n", (uintmax_t)res->hr_resuid); + printf(" localcnt: %ju\n", (uintmax_t)res->hr_primary_localcnt); + printf(" remotecnt: %ju\n", (uintmax_t)res->hr_primary_remotecnt); + printf(" prevrole: %s\n", role2str(res->hr_previous_role)); + + return (0); +} + +static void +control_dump(int argc, char *argv[]) +{ + struct hast_resource *res; + int ec, ret; + + /* Dump metadata of the given resource(s). */ + + ec = 0; + if (argc == 0 || (argc == 1 && strcmp(argv[0], "all") == 0)) { + TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) { + ret = dump_one(res); + if (ret != 0 && ec == 0) + ec = ret; + } + } else { + int ii; + + for (ii = 0; ii < argc; ii++) { + TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) { + if (strcmp(argv[ii], res->hr_name) == 0) + break; + } + if (res == NULL) { + pjdlog_error("Unknown resource %s.", argv[ii]); + if (ec == 0) + ec = EX_DATAERR; + continue; + } + ret = dump_one(res); + if (ret != 0 && ec == 0) + ec = ret; + } + } + exit(ec); +} + +static int +control_set_role(struct nv *nv, const char *newrole) +{ + const char *res, *oldrole; + unsigned int ii; + int error, ret; + + ret = 0; + + for (ii = 0; ; ii++) { + res = nv_get_string(nv, "resource%u", ii); + if (res == NULL) + break; + pjdlog_prefix_set("[%s] ", res); + error = nv_get_int16(nv, "error%u", ii); + if (error != 0) { + if (ret == 0) + ret = error; + pjdlog_warning("Received error %d from hastd.", error); + continue; + } + oldrole = nv_get_string(nv, "role%u", ii); + if (strcmp(oldrole, newrole) == 0) + pjdlog_debug(2, "Role unchanged (%s).", oldrole); + else { + pjdlog_debug(1, "Role changed from %s to %s.", oldrole, + newrole); + } + } + pjdlog_prefix_set("%s", ""); + return (ret); +} + +static int +control_status(struct nv *nv) +{ + unsigned int ii; + const char *str; + int error, ret; + + ret = 0; + + for (ii = 0; ; ii++) { + str = nv_get_string(nv, "resource%u", ii); + if (str == NULL) + break; + printf("%s:\n", str); + error = nv_get_int16(nv, "error%u", ii); + if (error != 0) { + if (ret == 0) + ret = error; + printf(" error: %d\n", error); + continue; + } + printf(" role: %s\n", nv_get_string(nv, "role%u", ii)); + printf(" provname: %s\n", + nv_get_string(nv, "provname%u", ii)); + printf(" localpath: %s\n", + nv_get_string(nv, "localpath%u", ii)); + printf(" extentsize: %u\n", + (unsigned int)nv_get_uint32(nv, "extentsize%u", ii)); + printf(" keepdirty: %u\n", + (unsigned int)nv_get_uint32(nv, "keepdirty%u", ii)); + printf(" remoteaddr: %s\n", + nv_get_string(nv, "remoteaddr%u", ii)); + printf(" replication: %s\n", + nv_get_string(nv, "replication%u", ii)); + str = nv_get_string(nv, "status%u", ii); + if (str != NULL) + printf(" status: %s\n", str); + printf(" dirty: %ju bytes\n", + (uintmax_t)nv_get_uint64(nv, "dirty%u", ii)); + } + return (ret); +} + +static int +numfromstr(const char *str, intmax_t *nump) +{ + intmax_t num; + char *suffix; + int rerrno; + + rerrno = errno; + errno = 0; + num = strtoimax(str, &suffix, 0); + if (errno == 0 && *suffix != '\0') + errno = EINVAL; + if (errno != 0) + return (-1); + *nump = num; + errno = rerrno; + return (0); +} + +int +main(int argc, char *argv[]) +{ + struct nv *nv; + intmax_t mediasize, extentsize, keepdirty; + int cmd, debug, error, ii; + const char *optstr; + + debug = 0; + mediasize = extentsize = keepdirty = 0; + + if (argc == 1) + usage(); + + if (strcmp(argv[1], "create") == 0) { + cmd = CMD_CREATE; + optstr = "c:de:k:m:h"; + } else if (strcmp(argv[1], "role") == 0) { + cmd = CMD_ROLE; + optstr = "c:dh"; + } else if (strcmp(argv[1], "status") == 0) { + cmd = CMD_STATUS; + optstr = "c:dh"; + } else if (strcmp(argv[1], "dump") == 0) { + cmd = CMD_DUMP; + optstr = "c:dh"; + } else + usage(); + + argc--; + argv++; + + for (;;) { + int ch; + + ch = getopt(argc, argv, optstr); + if (ch == -1) + break; + switch (ch) { + case 'c': + cfgpath = optarg; + break; + case 'd': + debug++; + break; + case 'e': + if (numfromstr(optarg, &extentsize) < 0) + err(1, "Invalid extentsize"); + break; + case 'k': + if (numfromstr(optarg, &keepdirty) < 0) + err(1, "Invalid keepdirty"); + break; + case 'm': + if (numfromstr(optarg, &mediasize) < 0) + err(1, "Invalid mediasize"); + break; + case 'h': + default: + usage(); + } + } + argc -= optind; + argv += optind; + + switch (cmd) { + case CMD_CREATE: + case CMD_ROLE: + if (argc == 0) + usage(); + break; + } + + pjdlog_debug_set(debug); + + cfg = yy_config_parse(cfgpath); + assert(cfg != NULL); + + switch (cmd) { + case CMD_CREATE: + control_create(argc, argv, mediasize, extentsize, keepdirty); + /* NOTREACHED */ + assert(!"What are we doing here?!"); + break; + case CMD_DUMP: + /* Dump metadata from local component of the given resource. */ + control_dump(argc, argv); + /* NOTREACHED */ + assert(!"What are we doing here?!"); + break; + case CMD_ROLE: + /* Change role for the given resources. */ + if (argc < 2) + usage(); + nv = nv_alloc(); + nv_add_uint8(nv, HASTCTL_CMD_SETROLE, "cmd"); + if (strcmp(argv[0], "init") == 0) + nv_add_uint8(nv, HAST_ROLE_INIT, "role"); + else if (strcmp(argv[0], "primary") == 0) + nv_add_uint8(nv, HAST_ROLE_PRIMARY, "role"); + else if (strcmp(argv[0], "secondary") == 0) + nv_add_uint8(nv, HAST_ROLE_SECONDARY, "role"); + else + usage(); + for (ii = 0; ii < argc - 1; ii++) + nv_add_string(nv, argv[ii + 1], "resource%d", ii); + break; + case CMD_STATUS: + /* Obtain status of the given resources. */ + nv = nv_alloc(); + nv_add_uint8(nv, HASTCTL_CMD_STATUS, "cmd"); + if (argc == 0) + nv_add_string(nv, "all", "resource%d", 0); + else { + for (ii = 0; ii < argc; ii++) + nv_add_string(nv, argv[ii], "resource%d", ii); + } + break; + default: + assert(!"Impossible role!"); + } + + /* Setup control connection... */ + if (proto_client(cfg->hc_controladdr, &controlconn) < 0) { + pjdlog_exit(EX_OSERR, + "Unable to setup control connection to %s", + cfg->hc_controladdr); + } + /* ...and connect to hastd. */ + if (proto_connect(controlconn) < 0) { + pjdlog_exit(EX_OSERR, "Unable to connect to hastd via %s", + cfg->hc_controladdr); + } + /* Send the command to the server... */ + if (hast_proto_send(NULL, controlconn, nv, NULL, 0) < 0) { + pjdlog_exit(EX_UNAVAILABLE, + "Unable to send command to hastd via %s", + cfg->hc_controladdr); + } + nv_free(nv); + /* ...and receive reply. */ + if (hast_proto_recv(NULL, controlconn, &nv, NULL, 0) < 0) { + pjdlog_exit(EX_UNAVAILABLE, + "cannot receive reply from hastd via %s", + cfg->hc_controladdr); + } + + error = nv_get_int16(nv, "error"); + if (error != 0) { + pjdlog_exitx(EX_SOFTWARE, "Error %d received from hastd.", + error); + } + nv_set_error(nv, 0); + + switch (cmd) { + case CMD_ROLE: + error = control_set_role(nv, argv[0]); + break; + case CMD_STATUS: + error = control_status(nv); + break; + default: + assert(!"Impossible role!"); + } + + exit(error); +} Added: head/sbin/hastd/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/hastd/Makefile Thu Feb 18 23:16:19 2010 (r204076) @@ -0,0 +1,37 @@ +# $FreeBSD$ + +.include + +PROG= hastd +SRCS= activemap.c +SRCS+= control.c +SRCS+= ebuf.c +SRCS+= hast_proto.c hastd.c hooks.c +SRCS+= metadata.c +SRCS+= nv.c +SRCS+= secondary.c +SRCS+= parse.y pjdlog.c primary.c +SRCS+= proto.c proto_common.c proto_socketpair.c proto_tcp4.c proto_uds.c +SRCS+= rangelock.c +SRCS+= subr.c +SRCS+= token.l +SRCS+= y.tab.h +WARNS?= 6 +MAN= hastd.8 hast.conf.5 + +CFLAGS+=-I${.CURDIR} +CFLAGS+=-DINET +.if ${MK_INET6_SUPPORT} != "no" +CFLAGS+=-DINET6 +.endif +# This is needed to have WARNS > 1. +CFLAGS+=-DYY_NO_UNPUT + +DPADD= ${LIBCRYPTO} ${LIBGEOM} ${LIBL} ${LIBPTHREAD} ${LIBUTIL} +LDADD= -lcrypto -lgeom -ll -lpthread -lutil + +YFLAGS+=-v + +CLEANFILES=y.tab.c y.tab.h y.output + +.include Added: head/sbin/hastd/activemap.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/hastd/activemap.c Thu Feb 18 23:16:19 2010 (r204076) @@ -0,0 +1,691 @@ +/*- + * Copyright (c) 2009-2010 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Pawel Jakub Dawidek under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include /* powerof2() */ +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#define ACTIVEMAP_MAGIC 0xac71e4 +struct activemap { + int am_magic; /* Magic value. */ + off_t am_mediasize; /* Media size in bytes. */ + uint32_t am_extentsize; /* Extent size in bytes, + must be power of 2. */ + uint8_t am_extentshift;/* 2 ^ extentbits == extentsize */ + int am_nextents; /* Number of extents. */ + size_t am_mapsize; /* Bitmap size in bytes. */ + uint16_t *am_memtab; /* An array that holds number of pending + writes per extent. */ + bitstr_t *am_diskmap; /* On-disk bitmap of dirty extents. */ + bitstr_t *am_memmap; /* In-memory bitmap of dirty extents. */ + size_t am_diskmapsize; /* Map size rounded up to sector size. */ + uint64_t am_ndirty; /* Number of dirty regions. */ + bitstr_t *am_syncmap; /* Bitmap of extents to sync. */ + off_t am_syncoff; /* Next synchronization offset. */ + TAILQ_HEAD(skeepdirty, keepdirty) am_keepdirty; /* List of extents that + we keep dirty to reduce bitmap + updates. */ + int am_nkeepdirty; /* Number of am_keepdirty elements. */ + int am_nkeepdirty_limit; /* Maximum number of am_keepdirty + elements. */ +}; + +struct keepdirty { + int kd_extent; + TAILQ_ENTRY(keepdirty) kd_next; +}; + +/* + * Helper function taken from sys/systm.h to calculate extentshift. + */ +static uint32_t *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 23:20:15 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FF06106566C; Thu, 18 Feb 2010 23:20:15 +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 5F4BD8FC12; Thu, 18 Feb 2010 23:20: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 o1INKFPo008684; Thu, 18 Feb 2010 23:20:15 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1INKF5R008682; Thu, 18 Feb 2010 23:20:15 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002182320.o1INKF5R008682@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 18 Feb 2010 23:20: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: r204077 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 23:20:15 -0000 Author: pjd Date: Thu Feb 18 23:20:15 2010 New Revision: 204077 URL: http://svn.freebsd.org/changeset/base/204077 Log: Remove some lines left over by accident. Modified: head/etc/rc.d/hastd Modified: head/etc/rc.d/hastd ============================================================================== --- head/etc/rc.d/hastd Thu Feb 18 23:16:19 2010 (r204076) +++ head/etc/rc.d/hastd Thu Feb 18 23:20:15 2010 (r204077) @@ -18,10 +18,6 @@ required_files="/etc/hast.conf" stop_precmd="hastd_stop_precmd" required_modules="geom_gate:g_gate" -sockfile="/var/run/syslogd.sockets" -evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\"" -altlog_proglist="named" - hastd_stop_precmd() { ${hastctl} role init all From owner-svn-src-head@FreeBSD.ORG Thu Feb 18 23:22:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25F23106566C; Thu, 18 Feb 2010 23:22:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B269E8FC1B; Thu, 18 Feb 2010 23:22:31 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 63FB246B03; Thu, 18 Feb 2010 18:22:31 -0500 (EST) Date: Thu, 18 Feb 2010 23:22:31 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Pawel Jakub Dawidek In-Reply-To: <201002182316.o1INGKqf007786@svn.freebsd.org> Message-ID: References: <201002182316.o1INGKqf007786@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204076 - in head: etc/defaults etc/rc.d sbin sbin/ggate/ggatec sbin/ggate/ggatel sbin/hastctl sbin/hastd share/examples share/examples/hast share/man/man5 sys/geom/gate X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 23:22:32 -0000 On Thu, 18 Feb 2010, Pawel Jakub Dawidek wrote: > Please welcome HAST - Highly Avalable Storage. Excellent news! I know a number of shops will be very excited to see this in the tree. Could you say a little about the future of ggated in light of the new arrival? Robert > > HAST allows to transparently store data on two physically separated machines > connected over the TCP/IP network. HAST works in Primary-Secondary > (Master-Backup, Master-Slave) configuration, which means that only one of the > cluster nodes can be active at any given time. Only Primary node is able to > handle I/O requests to HAST-managed devices. Currently HAST is limited to two > cluster nodes in total. > > HAST operates on block level - it provides disk-like devices in /dev/hast/ > directory for use by file systems and/or applications. Working on block level > makes it transparent for file systems and applications. There in no difference > between using HAST-provided device and raw disk, partition, etc. All of them > are just regular GEOM providers in FreeBSD. > > For more information please consult hastd(8), hastctl(8) and hast.conf(5) > manual pages, as well as http://wiki.FreeBSD.org/HAST. > > Sponsored by: FreeBSD Foundation > Sponsored by: OMCnet Internet Service GmbH > Sponsored by: TransIP BV > > Added: > head/etc/rc.d/hastd (contents, props changed) > head/sbin/hastctl/ > head/sbin/hastctl/Makefile (contents, props changed) > head/sbin/hastctl/hastctl.8 (contents, props changed) > head/sbin/hastctl/hastctl.c (contents, props changed) > head/sbin/hastd/ > head/sbin/hastd/Makefile (contents, props changed) > head/sbin/hastd/activemap.c (contents, props changed) > head/sbin/hastd/activemap.h (contents, props changed) > head/sbin/hastd/control.c (contents, props changed) > head/sbin/hastd/control.h (contents, props changed) > head/sbin/hastd/ebuf.c (contents, props changed) > head/sbin/hastd/ebuf.h (contents, props changed) > head/sbin/hastd/hast.conf.5 (contents, props changed) > head/sbin/hastd/hast.h (contents, props changed) > head/sbin/hastd/hast_proto.c (contents, props changed) > head/sbin/hastd/hast_proto.h (contents, props changed) > head/sbin/hastd/hastd.8 (contents, props changed) > head/sbin/hastd/hastd.c (contents, props changed) > head/sbin/hastd/hastd.h (contents, props changed) > head/sbin/hastd/hooks.c (contents, props changed) > head/sbin/hastd/hooks.h (contents, props changed) > head/sbin/hastd/metadata.c (contents, props changed) > head/sbin/hastd/metadata.h (contents, props changed) > head/sbin/hastd/nv.c (contents, props changed) > head/sbin/hastd/nv.h (contents, props changed) > head/sbin/hastd/parse.y (contents, props changed) > head/sbin/hastd/pjdlog.c (contents, props changed) > head/sbin/hastd/pjdlog.h (contents, props changed) > head/sbin/hastd/primary.c (contents, props changed) > head/sbin/hastd/proto.c (contents, props changed) > head/sbin/hastd/proto.h (contents, props changed) > head/sbin/hastd/proto_common.c (contents, props changed) > head/sbin/hastd/proto_impl.h (contents, props changed) > head/sbin/hastd/proto_socketpair.c (contents, props changed) > head/sbin/hastd/proto_tcp4.c (contents, props changed) > head/sbin/hastd/proto_uds.c (contents, props changed) > head/sbin/hastd/rangelock.c (contents, props changed) > head/sbin/hastd/rangelock.h (contents, props changed) > head/sbin/hastd/secondary.c (contents, props changed) > head/sbin/hastd/subr.c (contents, props changed) > head/sbin/hastd/subr.h (contents, props changed) > head/sbin/hastd/synch.h (contents, props changed) > head/sbin/hastd/token.l (contents, props changed) > head/share/examples/hast/ > head/share/examples/hast/ucarp.sh (contents, props changed) > head/share/examples/hast/ucarp_down.sh (contents, props changed) > head/share/examples/hast/ucarp_up.sh (contents, props changed) > head/share/examples/hast/vip-down.sh (contents, props changed) > head/share/examples/hast/vip-up.sh (contents, props changed) > Modified: > head/etc/defaults/rc.conf > head/etc/rc.d/Makefile > head/sbin/Makefile > head/sbin/ggate/ggatec/ggatec.c > head/sbin/ggate/ggatel/ggatel.c > head/share/examples/Makefile > head/share/man/man5/rc.conf.5 > head/sys/geom/gate/g_gate.c > head/sys/geom/gate/g_gate.h > > Modified: head/etc/defaults/rc.conf > ============================================================================== > --- head/etc/defaults/rc.conf Thu Feb 18 23:04:01 2010 (r204075) > +++ head/etc/defaults/rc.conf Thu Feb 18 23:16:19 2010 (r204076) > @@ -260,6 +260,9 @@ syslogd_flags="-s" # Flags to syslogd ( > inetd_enable="NO" # Run the network daemon dispatcher (YES/NO). > inetd_program="/usr/sbin/inetd" # path to inetd, if you want a different one. > inetd_flags="-wW -C 60" # Optional flags to inetd > +hastd_enable="NO" # Run the HAST daemon (YES/NO). > +hastd_program="/sbin/hastd" # path to hastd, if you want a different one. > +hastd_flags="" # Optional flags to hastd. > # > # named. It may be possible to run named in a sandbox, man security for > # details. > > Modified: head/etc/rc.d/Makefile > ============================================================================== > --- head/etc/rc.d/Makefile Thu Feb 18 23:04:01 2010 (r204075) > +++ head/etc/rc.d/Makefile Thu Feb 18 23:16:19 2010 (r204076) > @@ -12,7 +12,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI > encswap \ > faith fsck ftp-proxy ftpd \ > gbde geli geli2 gssd \ > - hcsecd \ > + hastd hcsecd \ > hostapd hostid hostid_save hostname \ > inetd initrandom \ > ip6addrctl ipfilter ipfs ipfw ipmon \ > > Added: head/etc/rc.d/hastd > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/etc/rc.d/hastd Thu Feb 18 23:16:19 2010 (r204076) > @@ -0,0 +1,31 @@ > +#!/bin/sh > +# > +# $FreeBSD$ > +# > + > +# PROVIDE: hastd > +# REQUIRE: NETWORKING syslogd > +# BEFORE: DAEMON > + > +. /etc/rc.subr > + > +name="hastd" > +rcvar=`set_rcvar` > +pidfile="/var/run/${name}.pid" > +command="/sbin/${name}" > +hastctl="/sbin/hastctl" > +required_files="/etc/hast.conf" > +stop_precmd="hastd_stop_precmd" > +required_modules="geom_gate:g_gate" > + > +sockfile="/var/run/syslogd.sockets" > +evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\"" > +altlog_proglist="named" > + > +hastd_stop_precmd() > +{ > + ${hastctl} role init all > +} > + > +load_rc_config $name > +run_rc_command "$1" > > Modified: head/sbin/Makefile > ============================================================================== > --- head/sbin/Makefile Thu Feb 18 23:04:01 2010 (r204075) > +++ head/sbin/Makefile Thu Feb 18 23:16:19 2010 (r204076) > @@ -36,6 +36,8 @@ SUBDIR= adjkerntz \ > ggate \ > growfs \ > gvinum \ > + hastctl \ > + hastd \ > ifconfig \ > init \ > ${_ipf} \ > > Modified: head/sbin/ggate/ggatec/ggatec.c > ============================================================================== > --- head/sbin/ggate/ggatec/ggatec.c Thu Feb 18 23:04:01 2010 (r204075) > +++ head/sbin/ggate/ggatec/ggatec.c Thu Feb 18 23:16:19 2010 (r204076) > @@ -59,7 +59,7 @@ enum { UNSET, CREATE, DESTROY, LIST, RES > > static const char *path = NULL; > static const char *host = NULL; > -static int unit = -1; > +static int unit = G_GATE_UNIT_AUTO; > static unsigned flags = 0; > static int force = 0; > static unsigned queue_size = G_GATE_QUEUE_SIZE; > > Modified: head/sbin/ggate/ggatel/ggatel.c > ============================================================================== > --- head/sbin/ggate/ggatel/ggatel.c Thu Feb 18 23:04:01 2010 (r204075) > +++ head/sbin/ggate/ggatel/ggatel.c Thu Feb 18 23:16:19 2010 (r204076) > @@ -50,7 +50,7 @@ > enum { UNSET, CREATE, DESTROY, LIST, RESCUE } action = UNSET; > > static const char *path = NULL; > -static int unit = -1; > +static int unit = G_GATE_UNIT_AUTO; > static unsigned flags = 0; > static int force = 0; > static unsigned queue_size = G_GATE_QUEUE_SIZE; > > Added: head/sbin/hastctl/Makefile > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sbin/hastctl/Makefile Thu Feb 18 23:16:19 2010 (r204076) > @@ -0,0 +1,36 @@ > +# $FreeBSD$ > + > +.include > + > +.PATH: ${.CURDIR}/../hastd > + > +PROG= hastctl > +SRCS= activemap.c > +SRCS+= ebuf.c > +SRCS+= hast_proto.c hastctl.c > +SRCS+= metadata.c > +SRCS+= nv.c > +SRCS+= parse.y pjdlog.c > +SRCS+= proto.c proto_common.c proto_tcp4.c proto_uds.c > +SRCS+= token.l > +SRCS+= subr.c > +SRCS+= y.tab.h > +WARNS?= 6 > +MAN= hastctl.8 > + > +CFLAGS+=-I${.CURDIR}/../hastd > +CFLAGS+=-DINET > +.if ${MK_INET6_SUPPORT} != "no" > +CFLAGS+=-DINET6 > +.endif > +# This is needed to have WARNS > 1. > +CFLAGS+=-DYY_NO_UNPUT > + > +DPADD= ${LIBCRYPTO} ${LIBL} > +LDADD= -lcrypto -ll > + > +YFLAGS+=-v > + > +CLEANFILES=y.tab.c y.tab.h y.output > + > +.include > > Added: head/sbin/hastctl/hastctl.8 > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sbin/hastctl/hastctl.8 Thu Feb 18 23:16:19 2010 (r204076) > @@ -0,0 +1,217 @@ > +.\" Copyright (c) 2010 The FreeBSD Foundation > +.\" All rights reserved. > +.\" > +.\" This software was developed by Pawel Jakub Dawidek under sponsorship from > +.\" the FreeBSD Foundation. > +.\" > +.\" Redistribution and use in source and binary forms, with or without > +.\" modification, are permitted provided that the following conditions > +.\" are met: > +.\" 1. Redistributions of source code must retain the above copyright > +.\" notice, this list of conditions and the following disclaimer. > +.\" 2. Redistributions in binary form must reproduce the above copyright > +.\" notice, this list of conditions and the following disclaimer in the > +.\" documentation and/or other materials provided with the distribution. > +.\" > +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND > +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE > +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > +.\" SUCH DAMAGE. > +.\" > +.\" $FreeBSD$ > +.\" > +.Dd February 1, 2010 > +.Dt HASTCTL 8 > +.Os > +.Sh NAME > +.Nm hastctl > +.Nd "Highly Available Storage control utility" > +.Sh SYNOPSIS > +.Nm > +.Cm create > +.Op Fl d > +.Op Fl c Ar config > +.Op Fl e Ar extentsize > +.Op Fl k Ar keepdirty > +.Op Fl m Ar mediasize > +.Ar name ... > +.Nm > +.Cm role > +.Op Fl d > +.Op Fl c Ar config > +.Aq init | primary | secondary > +.Ar all | name ... > +.Nm > +.Cm status > +.Op Fl d > +.Op Fl c Ar config > +.Op Ar all | name ... > +.Nm > +.Cm dump > +.Op Fl d > +.Op Fl c Ar config > +.Op Ar all | name ... > +.Sh DESCRIPTION > +The > +.Nm > +utility is used to control the behaviour of the > +.Xr hastd 8 > +daemon. > +.Pp > +This utility should be used by HA software like > +.Nm heartbeat > +or > +.Nm ucarp > +to setup HAST resources role when changing from primary mode to > +secondary or vice versa. > +Be aware that if a file system like UFS exists on HAST provider and > +primary node dies, file system has to be checked for inconsistencies > +with the > +.Xr fsck 8 > +utility after switching secondary node to primary role. > +.Pp > +The first argument to > +.Nm > +indicates an action to be performed: > +.Bl -tag -width ".Cm create" > +.It Cm create > +Initialize local provider configured for the given resource. > +Additional options include: > +.Bl -tag -width ".Fl e Ar extentsize" > +.It Fl e Ar extentsize > +Size of an extent. > +Extent is a block which is used for synchronization. > +.Nm > +maintains a map of dirty extents and extent is the smallest region that > +can be marked as dirty. > +If any part of an extent is modified, entire extent will be synchronized > +when nodes connect. > +If extent size is too small, there will be too much disk activity > +related to dirty map updates, which will degrade performance of the > +given resource. > +If extent size is too large, synchronization, even in case of short > +outage, can take a long time increasing the risk of loosing up-to-date > +node before synchronization process is completed. > +The default extent size is > +.Va 2MB . > +.It Fl k Ar keepdirty > +Maximum number of dirty extents to keep dirty all the time. > +Most recently used extents are kept dirty to reduce number of metadata > +updates. > +The default numer of most recently used extents which will be kept > +dirty is > +.Va 64 . > +.It Fl m Ar mediasize > +Size of the smaller provider used as backend storage on both nodes. > +This option can be omitted if node providers have the same size on both > +sides. > +.El > +.It Cm role > +Change role of the given resource. > +The role can be one of: > +.Bl -tag -width ".Cm secondary" > +.It Cm init > +Resource is turned off. > +.It Cm primary > +Local > +.Xr hastd 8 > +daemon will act as primary node for the given resource. > +System on which resource role is set to primary can use > +.Pa /dev/hast/ > +GEOM provider. > +.It Cm secondary > +Local > +.Xr hastd 8 > +daemon will act as secondary node for the given resource - it will wait > +for connection from the primary node and will handle I/O requests > +received from it. > +GEOM provider > +.Pa /dev/hast/ > +will not be created on secondary node. > +.El > +.It Cm status > +Present status of the configured resources. > +.It Cm dump > +Dump metadata stored on local component for the configured resources. > +.El > +.Pp > +In addition, every subcommand can be followed by the following options: > +.Bl -tag -width ".Fl c Ar config" > +.It Fl c Ar config > +Specify alternative location of the configuration file. > +The default location is > +.Pa /etc/hast.conf . > +.It Fl d > +Print debugging information. > +This option can be specified multiple times to raise the verbosity > +level. > +.El > +.Sh EXIT STATUS > +Exit status is 0 on success, or one of the values described in > +.Xr sysexits 3 > +on failure. > +.Sh EXAMPLES > +Initialize HAST provider, create file system on it and mount it. > +.Bd -literal -offset indent > +nodeB# hastctl create shared > +nodeB# hastd > +nodeB# hastctl role secondary shared > + > +nodeB# hastctl create shared > +nodeA# hastd > +nodeA# hastctl role primary shared > +nodeA# newfs -U /dev/hast/shared > +nodeA# mount -o noatime /dev/hast/shared /shared > +nodeA# application_start > +.Ed > +.Pp > +Switch roles for the > +.Nm shared > +HAST resource. > +.Bd -literal -offset indent > +nodeA# application_stop > +nodeA# umount -f /shared > +nodeA# hastctl role secondary shared > + > +nodeB# hastctl role primary shared > +nodeB# fsck -t ufs /dev/hast/shared > +nodeB# mount -o noatime /dev/hast/shared /shared > +nodeB# application_start > +.Ed > +.Sh FILES > +.Bl -tag -width ".Pa /var/run/hastctl" -compact > +.It Pa /etc/hast.conf > +Configuration file for > +.Nm > +and > +.Xr hastd 8 . > +.It Pa /var/run/hastctl > +Control socket used by > +.Nm > +to communicate with the > +.Xr hastd 8 > +daemon. > +.El > +.Sh SEE ALSO > +.Xr sysexits 3 , > +.Xr geom 4 , > +.Xr hast.conf 5 , > +.Xr fsck 8 , > +.Xr ggatec 8 , > +.Xr ggatel 8 , > +.Xr hastd 8 , > +.Xr mount 8 , > +.Xr newfs 8 . > +.Sh AUTHORS > +The > +.Nm > +was developed by > +.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org > +under sponsorship of the FreeBSD Foundation. > > Added: head/sbin/hastctl/hastctl.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sbin/hastctl/hastctl.c Thu Feb 18 23:16:19 2010 (r204076) > @@ -0,0 +1,526 @@ > +/*- > + * Copyright (c) 2009-2010 The FreeBSD Foundation > + * All rights reserved. > + * > + * This software was developed by Pawel Jakub Dawidek under sponsorship from > + * the FreeBSD Foundation. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#include "hast.h" > +#include "hast_proto.h" > +#include "metadata.h" > +#include "nv.h" > +#include "pjdlog.h" > +#include "proto.h" > +#include "subr.h" > + > +/* Path to configuration file. */ > +static const char *cfgpath = HAST_CONFIG; > +/* Hastd configuration. */ > +static struct hastd_config *cfg; > +/* Control connection. */ > +static struct proto_conn *controlconn; > + > +enum { > + CMD_INVALID, > + CMD_CREATE, > + CMD_ROLE, > + CMD_STATUS, > + CMD_DUMP > +}; > + > +static __dead2 void > +usage(void) > +{ > + > + fprintf(stderr, > + "usage: %s create [-d] [-c config] [-e extentsize] [-k keepdirty]\n" > + "\t\t[-m mediasize] name ...\n", > + getprogname()); > + fprintf(stderr, > + " %s role [-d] [-c config] all | name ...\n", > + getprogname()); > + fprintf(stderr, > + " %s status [-d] [-c config] [all | name ...]\n", > + getprogname()); > + fprintf(stderr, > + " %s dump [-d] [-c config] [all | name ...]\n", > + getprogname()); > + exit(EX_USAGE); > +} > + > +static int > +create_one(struct hast_resource *res, intmax_t mediasize, intmax_t extentsize, > + intmax_t keepdirty) > +{ > + unsigned char *buf; > + size_t mapsize; > + int ec; > + > + ec = 0; > + pjdlog_prefix_set("[%s] ", res->hr_name); > + > + if (provinfo(res, true) < 0) { > + ec = EX_NOINPUT; > + goto end; > + } > + if (mediasize == 0) > + mediasize = res->hr_local_mediasize; > + else if (mediasize > res->hr_local_mediasize) { > + pjdlog_error("Provided mediasize is larger than provider %s size.", > + res->hr_localpath); > + ec = EX_DATAERR; > + goto end; > + } > + if (!powerof2(res->hr_local_sectorsize)) { > + pjdlog_error("Sector size of provider %s is not power of 2 (%u).", > + res->hr_localpath, res->hr_local_sectorsize); > + ec = EX_DATAERR; > + goto end; > + } > + if (extentsize == 0) > + extentsize = HAST_EXTENTSIZE; > + if (extentsize < res->hr_local_sectorsize) { > + pjdlog_error("Extent size (%jd) is less than sector size (%u).", > + (intmax_t)extentsize, res->hr_local_sectorsize); > + ec = EX_DATAERR; > + goto end; > + } > + if ((extentsize % res->hr_local_sectorsize) != 0) { > + pjdlog_error("Extent size (%jd) is not multiple of sector size (%u).", > + (intmax_t)extentsize, res->hr_local_sectorsize); > + ec = EX_DATAERR; > + goto end; > + } > + mapsize = activemap_calc_ondisk_size(mediasize - METADATA_SIZE, > + extentsize, res->hr_local_sectorsize); > + if (keepdirty == 0) > + keepdirty = HAST_KEEPDIRTY; > + res->hr_datasize = mediasize - METADATA_SIZE - mapsize; > + res->hr_extentsize = extentsize; > + res->hr_keepdirty = keepdirty; > + > + res->hr_localoff = METADATA_SIZE + mapsize; > + > + if (metadata_write(res) < 0) { > + ec = EX_IOERR; > + goto end; > + } > + buf = calloc(1, mapsize); > + if (buf == NULL) { > + pjdlog_error("Unable to allocate %zu bytes of memory for initial bitmap.", > + mapsize); > + ec = EX_TEMPFAIL; > + goto end; > + } > + if (pwrite(res->hr_localfd, buf, mapsize, METADATA_SIZE) != > + (ssize_t)mapsize) { > + pjdlog_errno(LOG_ERR, "Unable to store initial bitmap on %s", > + res->hr_localpath); > + free(buf); > + ec = EX_IOERR; > + goto end; > + } > + free(buf); > +end: > + if (res->hr_localfd >= 0) > + close(res->hr_localfd); > + pjdlog_prefix_set("%s", ""); > + return (ec); > +} > + > +static void > +control_create(int argc, char *argv[], intmax_t mediasize, intmax_t extentsize, > + intmax_t keepdirty) > +{ > + struct hast_resource *res; > + int ec, ii, ret; > + > + /* Initialize the given resources. */ > + if (argc < 1) > + usage(); > + ec = 0; > + for (ii = 0; ii < argc; ii++) { > + TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) { > + if (strcmp(argv[ii], res->hr_name) == 0) > + break; > + } > + if (res == NULL) { > + pjdlog_error("Unknown resource %s.", argv[ii]); > + if (ec == 0) > + ec = EX_DATAERR; > + continue; > + } > + ret = create_one(res, mediasize, extentsize, keepdirty); > + if (ret != 0 && ec == 0) > + ec = ret; > + } > + exit(ec); > +} > + > +static int > +dump_one(struct hast_resource *res) > +{ > + int ret; > + > + ret = metadata_read(res, false); > + if (ret != 0) > + return (ret); > + > + printf("resource: %s\n", res->hr_name); > + printf(" datasize: %ju\n", (uintmax_t)res->hr_datasize); > + printf(" extentsize: %d\n", res->hr_extentsize); > + printf(" keepdirty: %d\n", res->hr_keepdirty); > + printf(" localoff: %ju\n", (uintmax_t)res->hr_localoff); > + printf(" resuid: %ju\n", (uintmax_t)res->hr_resuid); > + printf(" localcnt: %ju\n", (uintmax_t)res->hr_primary_localcnt); > + printf(" remotecnt: %ju\n", (uintmax_t)res->hr_primary_remotecnt); > + printf(" prevrole: %s\n", role2str(res->hr_previous_role)); > + > + return (0); > +} > + > +static void > +control_dump(int argc, char *argv[]) > +{ > + struct hast_resource *res; > + int ec, ret; > + > + /* Dump metadata of the given resource(s). */ > + > + ec = 0; > + if (argc == 0 || (argc == 1 && strcmp(argv[0], "all") == 0)) { > + TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) { > + ret = dump_one(res); > + if (ret != 0 && ec == 0) > + ec = ret; > + } > + } else { > + int ii; > + > + for (ii = 0; ii < argc; ii++) { > + TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) { > + if (strcmp(argv[ii], res->hr_name) == 0) > + break; > + } > + if (res == NULL) { > + pjdlog_error("Unknown resource %s.", argv[ii]); > + if (ec == 0) > + ec = EX_DATAERR; > + continue; > + } > + ret = dump_one(res); > + if (ret != 0 && ec == 0) > + ec = ret; > + } > + } > + exit(ec); > +} > + > +static int > +control_set_role(struct nv *nv, const char *newrole) > +{ > + const char *res, *oldrole; > + unsigned int ii; > + int error, ret; > + > + ret = 0; > + > + for (ii = 0; ; ii++) { > + res = nv_get_string(nv, "resource%u", ii); > + if (res == NULL) > + break; > + pjdlog_prefix_set("[%s] ", res); > + error = nv_get_int16(nv, "error%u", ii); > + if (error != 0) { > + if (ret == 0) > + ret = error; > + pjdlog_warning("Received error %d from hastd.", error); > + continue; > + } > + oldrole = nv_get_string(nv, "role%u", ii); > + if (strcmp(oldrole, newrole) == 0) > + pjdlog_debug(2, "Role unchanged (%s).", oldrole); > + else { > + pjdlog_debug(1, "Role changed from %s to %s.", oldrole, > + newrole); > + } > + } > + pjdlog_prefix_set("%s", ""); > + return (ret); > +} > + > +static int > +control_status(struct nv *nv) > +{ > + unsigned int ii; > + const char *str; > + int error, ret; > + > + ret = 0; > + > + for (ii = 0; ; ii++) { > + str = nv_get_string(nv, "resource%u", ii); > + if (str == NULL) > + break; > + printf("%s:\n", str); > + error = nv_get_int16(nv, "error%u", ii); > + if (error != 0) { > + if (ret == 0) > + ret = error; > + printf(" error: %d\n", error); > + continue; > + } > + printf(" role: %s\n", nv_get_string(nv, "role%u", ii)); > + printf(" provname: %s\n", > + nv_get_string(nv, "provname%u", ii)); > + printf(" localpath: %s\n", > + nv_get_string(nv, "localpath%u", ii)); > + printf(" extentsize: %u\n", > + (unsigned int)nv_get_uint32(nv, "extentsize%u", ii)); > + printf(" keepdirty: %u\n", > + (unsigned int)nv_get_uint32(nv, "keepdirty%u", ii)); > + printf(" remoteaddr: %s\n", > + nv_get_string(nv, "remoteaddr%u", ii)); > + printf(" replication: %s\n", > + nv_get_string(nv, "replication%u", ii)); > + str = nv_get_string(nv, "status%u", ii); > + if (str != NULL) > + printf(" status: %s\n", str); > + printf(" dirty: %ju bytes\n", > + (uintmax_t)nv_get_uint64(nv, "dirty%u", ii)); > + } > + return (ret); > +} > + > +static int > +numfromstr(const char *str, intmax_t *nump) > +{ > + intmax_t num; > + char *suffix; > + int rerrno; > + > + rerrno = errno; > + errno = 0; > + num = strtoimax(str, &suffix, 0); > + if (errno == 0 && *suffix != '\0') > + errno = EINVAL; > + if (errno != 0) > + return (-1); > + *nump = num; > + errno = rerrno; > + return (0); > +} > + > +int > +main(int argc, char *argv[]) > +{ > + struct nv *nv; > + intmax_t mediasize, extentsize, keepdirty; > + int cmd, debug, error, ii; > + const char *optstr; > + > + debug = 0; > + mediasize = extentsize = keepdirty = 0; > + > + if (argc == 1) > + usage(); > + > + if (strcmp(argv[1], "create") == 0) { > + cmd = CMD_CREATE; > + optstr = "c:de:k:m:h"; > + } else if (strcmp(argv[1], "role") == 0) { > + cmd = CMD_ROLE; > + optstr = "c:dh"; > + } else if (strcmp(argv[1], "status") == 0) { > + cmd = CMD_STATUS; > + optstr = "c:dh"; > + } else if (strcmp(argv[1], "dump") == 0) { > + cmd = CMD_DUMP; > + optstr = "c:dh"; > + } else > + usage(); > + > + argc--; > + argv++; > + > + for (;;) { > + int ch; > + > + ch = getopt(argc, argv, optstr); > + if (ch == -1) > + break; > + switch (ch) { > + case 'c': > + cfgpath = optarg; > + break; > + case 'd': > + debug++; > + break; > + case 'e': > + if (numfromstr(optarg, &extentsize) < 0) > + err(1, "Invalid extentsize"); > + break; > + case 'k': > + if (numfromstr(optarg, &keepdirty) < 0) > + err(1, "Invalid keepdirty"); > + break; > + case 'm': > + if (numfromstr(optarg, &mediasize) < 0) > + err(1, "Invalid mediasize"); > + break; > + case 'h': > + default: > + usage(); > + } > + } > + argc -= optind; > + argv += optind; > + > + switch (cmd) { > + case CMD_CREATE: > + case CMD_ROLE: > + if (argc == 0) > + usage(); > + break; > + } > + > + pjdlog_debug_set(debug); > + > + cfg = yy_config_parse(cfgpath); > + assert(cfg != NULL); > + > + switch (cmd) { > + case CMD_CREATE: > + control_create(argc, argv, mediasize, extentsize, keepdirty); > + /* NOTREACHED */ > + assert(!"What are we doing here?!"); > + break; > + case CMD_DUMP: > + /* Dump metadata from local component of the given resource. */ > + control_dump(argc, argv); > + /* NOTREACHED */ > + assert(!"What are we doing here?!"); > + break; > + case CMD_ROLE: > + /* Change role for the given resources. */ > + if (argc < 2) > + usage(); > + nv = nv_alloc(); > + nv_add_uint8(nv, HASTCTL_CMD_SETROLE, "cmd"); > + if (strcmp(argv[0], "init") == 0) > + nv_add_uint8(nv, HAST_ROLE_INIT, "role"); > + else if (strcmp(argv[0], "primary") == 0) > + nv_add_uint8(nv, HAST_ROLE_PRIMARY, "role"); > + else if (strcmp(argv[0], "secondary") == 0) > + nv_add_uint8(nv, HAST_ROLE_SECONDARY, "role"); > + else > + usage(); > + for (ii = 0; ii < argc - 1; ii++) > + nv_add_string(nv, argv[ii + 1], "resource%d", ii); > + break; > + case CMD_STATUS: > + /* Obtain status of the given resources. */ > + nv = nv_alloc(); > + nv_add_uint8(nv, HASTCTL_CMD_STATUS, "cmd"); > + if (argc == 0) > + nv_add_string(nv, "all", "resource%d", 0); > + else { > + for (ii = 0; ii < argc; ii++) > + nv_add_string(nv, argv[ii], "resource%d", ii); > + } > + break; > + default: > + assert(!"Impossible role!"); > + } > + > + /* Setup control connection... */ > + if (proto_client(cfg->hc_controladdr, &controlconn) < 0) { > + pjdlog_exit(EX_OSERR, > + "Unable to setup control connection to %s", > + cfg->hc_controladdr); > + } > + /* ...and connect to hastd. */ > + if (proto_connect(controlconn) < 0) { > + pjdlog_exit(EX_OSERR, "Unable to connect to hastd via %s", > + cfg->hc_controladdr); > + } > + /* Send the command to the server... */ > + if (hast_proto_send(NULL, controlconn, nv, NULL, 0) < 0) { > + pjdlog_exit(EX_UNAVAILABLE, > + "Unable to send command to hastd via %s", > + cfg->hc_controladdr); > + } > + nv_free(nv); > + /* ...and receive reply. */ > + if (hast_proto_recv(NULL, controlconn, &nv, NULL, 0) < 0) { > + pjdlog_exit(EX_UNAVAILABLE, > + "cannot receive reply from hastd via %s", > + cfg->hc_controladdr); > + } > + > + error = nv_get_int16(nv, "error"); > + if (error != 0) { > + pjdlog_exitx(EX_SOFTWARE, "Error %d received from hastd.", > + error); > + } > + nv_set_error(nv, 0); > + > + switch (cmd) { > + case CMD_ROLE: > + error = control_set_role(nv, argv[0]); > + break; > + case CMD_STATUS: > + error = control_status(nv); > + break; > + default: > + assert(!"Impossible role!"); > + } > + > + exit(error); > +} > > Added: head/sbin/hastd/Makefile > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sbin/hastd/Makefile Thu Feb 18 23:16:19 2010 (r204076) > @@ -0,0 +1,37 @@ > +# $FreeBSD$ > + > +.include > + > +PROG= hastd > +SRCS= activemap.c > +SRCS+= control.c > +SRCS+= ebuf.c > +SRCS+= hast_proto.c hastd.c hooks.c > +SRCS+= metadata.c > +SRCS+= nv.c > +SRCS+= secondary.c > +SRCS+= parse.y pjdlog.c primary.c > +SRCS+= proto.c proto_common.c proto_socketpair.c proto_tcp4.c proto_uds.c > +SRCS+= rangelock.c > +SRCS+= subr.c > +SRCS+= token.l > +SRCS+= y.tab.h > +WARNS?= 6 > +MAN= hastd.8 hast.conf.5 > + > +CFLAGS+=-I${.CURDIR} > +CFLAGS+=-DINET > +.if ${MK_INET6_SUPPORT} != "no" > +CFLAGS+=-DINET6 > +.endif > +# This is needed to have WARNS > 1. > +CFLAGS+=-DYY_NO_UNPUT > + > +DPADD= ${LIBCRYPTO} ${LIBGEOM} ${LIBL} ${LIBPTHREAD} ${LIBUTIL} > +LDADD= -lcrypto -lgeom -ll -lpthread -lutil > + > +YFLAGS+=-v > + > +CLEANFILES=y.tab.c y.tab.h y.output > + > +.include > > Added: head/sbin/hastd/activemap.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sbin/hastd/activemap.c Thu Feb 18 23:16:19 2010 (r204076) > @@ -0,0 +1,691 @@ > +/*- > + * Copyright (c) 2009-2010 The FreeBSD Foundation > + * All rights reserved. > + * > + * This software was developed by Pawel Jakub Dawidek under sponsorship from > + * the FreeBSD Foundation. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include /* powerof2() */ > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#define ACTIVEMAP_MAGIC 0xac71e4 > +struct activemap { > + int am_magic; /* Magic value. */ > + off_t am_mediasize; /* Media size in bytes. */ > + uint32_t am_extentsize; /* Extent size in bytes, > + must be power of 2. */ > + uint8_t am_extentshift;/* 2 ^ extentbits == extentsize */ > + int am_nextents; /* Number of extents. */ > + size_t am_mapsize; /* Bitmap size in bytes. */ > + uint16_t *am_memtab; /* An array that holds number of pending > + writes per extent. */ > + bitstr_t *am_diskmap; /* On-disk bitmap of dirty extents. */ > + bitstr_t *am_memmap; /* In-memory bitmap of dirty extents. */ > + size_t am_diskmapsize; /* Map size rounded up to sector size. */ > + uint64_t am_ndirty; /* Number of dirty regions. */ > + bitstr_t *am_syncmap; /* Bitmap of extents to sync. */ > + off_t am_syncoff; /* Next synchronization offset. */ > + TAILQ_HEAD(skeepdirty, keepdirty) am_keepdirty; /* List of extents that > + we keep dirty to reduce bitmap > + updates. */ > + int am_nkeepdirty; /* Number of am_keepdirty elements. */ > + int am_nkeepdirty_limit; /* Maximum number of am_keepdirty > + elements. */ > +}; > + > +struct keepdirty { > + int kd_extent; > + TAILQ_ENTRY(keepdirty) kd_next; > +}; > + > +/* > + * Helper function taken from sys/systm.h to calculate extentshift. > + */ > +static uint32_t > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 02:25:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C2C01065692 for ; Fri, 19 Feb 2010 02:25:44 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id AED968FC16 for ; Fri, 19 Feb 2010 02:25:43 +0000 (UTC) Received: (qmail 11913 invoked by uid 399); 19 Feb 2010 02:25:41 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 19 Feb 2010 02:25:41 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B7DF6A4.2030408@FreeBSD.org> Date: Thu, 18 Feb 2010 18:25:40 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.7) Gecko/20100123 Thunderbird/3.0.1 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201002182320.o1INKF5R008682@svn.freebsd.org> In-Reply-To: <201002182320.o1INKF5R008682@svn.freebsd.org> X-Enigmail-Version: 1.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204077 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 02:25:44 -0000 On 02/18/10 15:20, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Thu Feb 18 23:20:15 2010 > New Revision: 204077 > URL: http://svn.freebsd.org/changeset/base/204077 > > Log: > Remove some lines left over by accident. If this script is starting a persistent service it should have KEYWORD: SHUTDOWN added after BEFORE. Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 02:34:26 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48AE41065679; Fri, 19 Feb 2010 02:34:26 +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 1EDFE8FC1B; Fri, 19 Feb 2010 02:34: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 o1J2YQvD051511; Fri, 19 Feb 2010 02:34:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1J2YQUX051509; Fri, 19 Feb 2010 02:34:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002190234.o1J2YQUX051509@svn.freebsd.org> From: Xin LI Date: Fri, 19 Feb 2010 02:34: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: r204080 - head/etc/mtree X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 02:34:26 -0000 Author: delphij Date: Fri Feb 19 02:34:25 2010 New Revision: 204080 URL: http://svn.freebsd.org/changeset/base/204080 Log: Create a directory for hast's examples. Modified: head/etc/mtree/BSD.usr.dist Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Fri Feb 19 01:13:37 2010 (r204079) +++ head/etc/mtree/BSD.usr.dist Fri Feb 19 02:34:25 2010 (r204080) @@ -215,6 +215,8 @@ .. find_interface .. + hast + .. hostapd .. ibcs2 From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 03:36:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93DD5106566C; Fri, 19 Feb 2010 03:36:02 +0000 (UTC) (envelope-from weongyo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8300A8FC0A; Fri, 19 Feb 2010 03:36: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 o1J3a2p2065266; Fri, 19 Feb 2010 03:36:02 GMT (envelope-from weongyo@svn.freebsd.org) Received: (from weongyo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1J3a2lP065264; Fri, 19 Feb 2010 03:36:02 GMT (envelope-from weongyo@svn.freebsd.org) Message-Id: <201002190336.o1J3a2lP065264@svn.freebsd.org> From: Weongyo Jeong Date: Fri, 19 Feb 2010 03:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204081 - head/sys/dev/bwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 03:36:02 -0000 Author: weongyo Date: Fri Feb 19 03:36:02 2010 New Revision: 204081 URL: http://svn.freebsd.org/changeset/base/204081 Log: o print msgs with length if the frame is too short to pass to net80211. o print key index for debugging if the frame is attempted to decrypt for WEP, AES or TKIP though currently HW decryption isn't supported. Modified: head/sys/dev/bwn/if_bwn.c Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Fri Feb 19 02:34:25 2010 (r204080) +++ head/sys/dev/bwn/if_bwn.c Fri Feb 19 03:36:02 2010 (r204081) @@ -9416,19 +9416,24 @@ bwn_rxeof(struct bwn_mac *mac, struct mb padding = (macstat & BWN_RX_MAC_PADDING) ? 2 : 0; if (m->m_pkthdr.len < (sizeof(struct bwn_plcp6) + padding)) { - device_printf(sc->sc_dev, "RX: Packet size underrun (1)\n"); + device_printf(sc->sc_dev, "frame too short (length=%d)\n", + m->m_pkthdr.len); goto drop; } plcp = (struct bwn_plcp6 *)(mp + padding); m_adj(m, sizeof(struct bwn_plcp6) + padding); if (m->m_pkthdr.len < IEEE80211_MIN_LEN) { - device_printf(sc->sc_dev, "RX: Packet size underrun (2)\n"); + device_printf(sc->sc_dev, "frame too short (length=%d)\n", + m->m_pkthdr.len); goto drop; } wh = mtod(m, struct ieee80211_frame_min *); if (macstat & BWN_RX_MAC_DEC) - device_printf(sc->sc_dev, "TODO: BWN_RX_MAC_DEC\n"); + device_printf(sc->sc_dev, + "RX decryption attempted (old %d keyidx %#x)\n", + BWN_ISOLDFMT(mac), + (macstat & BWN_RX_MAC_KEYIDX) >> BWN_RX_MAC_KEYIDX_SHIFT); /* XXX calculating RSSI & noise & antenna */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 04:37:55 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B7961065670; Fri, 19 Feb 2010 04:37:55 +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 ED2908FC13; Fri, 19 Feb 2010 04:37: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 o1J4bswM078818; Fri, 19 Feb 2010 04:37:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1J4bskr078816; Fri, 19 Feb 2010 04:37:54 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002190437.o1J4bskr078816@svn.freebsd.org> From: Nathan Whitehorn Date: Fri, 19 Feb 2010 04:37: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: r204082 - head/sys/powerpc/powermac X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 04:37:55 -0000 Author: nwhitehorn Date: Fri Feb 19 04:37:54 2010 New Revision: 204082 URL: http://svn.freebsd.org/changeset/base/204082 Log: Allow the SMU driver to read a variety of hardware sensors (possible questions on the thermal calibration), and to read and set fan RPMs from software. While here, fix a number of bugs. Calibration code from: OpenBSD MFC after: 2 weeks Modified: head/sys/powerpc/powermac/smu.c Modified: head/sys/powerpc/powermac/smu.c ============================================================================== --- head/sys/powerpc/powermac/smu.c Fri Feb 19 03:36:02 2010 (r204081) +++ head/sys/powerpc/powermac/smu.c Fri Feb 19 04:37:54 2010 (r204082) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -46,11 +47,30 @@ __FBSDID("$FreeBSD$"); #include struct smu_cmd { - uint8_t cmd; + volatile uint8_t cmd; uint8_t len; uint8_t data[254]; }; +struct smu_fan { + cell_t reg; + cell_t min_rpm; + cell_t max_rpm; + cell_t unmanaged_rpm; + char location[32]; +}; + +struct smu_sensor { + cell_t reg; + char location[32]; + enum { + SMU_CURRENT_SENSOR, + SMU_VOLTAGE_SENSOR, + SMU_POWER_SENSOR, + SMU_TEMP_SENSOR + } type; +}; + struct smu_softc { device_t sc_dev; struct mtx sc_mtx; @@ -65,6 +85,23 @@ struct smu_softc { struct smu_cmd *sc_cmd; bus_addr_t sc_cmd_phys; bus_dmamap_t sc_cmd_dmamap; + + struct smu_fan *sc_fans; + int sc_nfans; + struct smu_sensor *sc_sensors; + int sc_nsensors; + + /* Calibration data */ + uint16_t sc_cpu_diode_scale; + int16_t sc_cpu_diode_offset; + + uint16_t sc_cpu_volt_scale; + int16_t sc_cpu_volt_offset; + uint16_t sc_cpu_curr_scale; + int16_t sc_cpu_curr_offset; + + uint16_t sc_slots_pow_scale; + int16_t sc_slots_pow_offset; }; /* regular bus attachment functions */ @@ -77,6 +114,12 @@ static int smu_attach(device_t); static void smu_cpufreq_pre_change(device_t, const struct cf_level *level); static void smu_cpufreq_post_change(device_t, const struct cf_level *level); +/* utility functions */ +static int smu_get_datablock(device_t dev, int8_t id, uint8_t *buf, + size_t len); +static void smu_attach_fans(device_t dev, phandle_t fanroot); +static void smu_attach_sensors(device_t dev, phandle_t sensroot); + /* where to find the doorbell GPIO */ static device_t smu_doorbell = NULL; @@ -97,11 +140,31 @@ static driver_t smu_driver = { static devclass_t smu_devclass; DRIVER_MODULE(smu, nexus, smu_driver, smu_devclass, 0, 0); +MALLOC_DEFINE(M_SMU, "smu", "SMU Sensor Information"); -#define SMU_MAILBOX 0x860c +#define SMU_MAILBOX 0x8000860c /* Command types */ -#define SMU_POWER 0xaa +#define SMU_ADC 0xd8 +#define SMU_FAN 0x4a +#define SMU_I2C 0x9a +#define SMU_I2C_SIMPLE 0x00 +#define SMU_I2C_NORMAL 0x01 +#define SMU_I2C_COMBINED 0x02 +#define SMU_MISC 0xee +#define SMU_MISC_GET_DATA 0x02 +#define SMU_POWER 0xaa + +/* Data blocks */ +#define SMU_CPUTEMP_CAL 0x18 +#define SMU_CPUVOLT_CAL 0x21 +#define SMU_SLOTPW_CAL 0x78 + +/* Partitions */ +#define SMU_PARTITION 0x3e +#define SMU_PARTITION_LATEST 0x01 +#define SMU_PARTITION_BASE 0x02 +#define SMU_PARTITION_UPDATE 0x03 static int smu_probe(device_t dev) @@ -127,6 +190,8 @@ static int smu_attach(device_t dev) { struct smu_softc *sc; + phandle_t node, child; + uint8_t data[12]; sc = device_get_softc(dev); @@ -139,7 +204,7 @@ smu_attach(device_t dev) bus_dma_tag_create(NULL, 16, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, PAGE_SIZE, 1, PAGE_SIZE, 0, NULL, NULL, &(sc->sc_dmatag)); - sc->sc_bt = &bs_be_tag; + sc->sc_bt = &bs_le_tag; bus_space_map(sc->sc_bt, SMU_MAILBOX, 4, 0, &sc->sc_mailbox); /* @@ -159,6 +224,40 @@ smu_attach(device_t dev) EVENTHANDLER_REGISTER(cpufreq_post_change, smu_cpufreq_post_change, dev, EVENTHANDLER_PRI_ANY); + /* + * Detect and attach child devices. + */ + node = ofw_bus_get_node(dev); + for (child = OF_child(node); child != 0; child = OF_peer(child)) { + char name[32]; + memset(name, 0, sizeof(name)); + OF_getprop(child, "name", name, sizeof(name)); + + if (strncmp(name, "rpm-fans", 9) == 0 || + strncmp(name, "fans", 5) == 0) + smu_attach_fans(dev, child); + + if (strncmp(name, "sensors", 8) == 0) + smu_attach_sensors(dev, child); + } + + /* + * Collect calibration constants. + */ + smu_get_datablock(dev, SMU_CPUTEMP_CAL, data, sizeof(data)); + sc->sc_cpu_diode_scale = (data[4] << 8) + data[5]; + sc->sc_cpu_diode_offset = (data[6] << 8) + data[7]; + + smu_get_datablock(dev, SMU_CPUVOLT_CAL, data, sizeof(data)); + sc->sc_cpu_volt_scale = (data[4] << 8) + data[5]; + sc->sc_cpu_volt_offset = (data[6] << 8) + data[7]; + sc->sc_cpu_curr_scale = (data[8] << 8) + data[9]; + sc->sc_cpu_curr_offset = (data[10] << 8) + data[11]; + + smu_get_datablock(dev, SMU_SLOTPW_CAL, data, sizeof(data)); + sc->sc_slots_pow_scale = (data[4] << 8) + data[5]; + sc->sc_slots_pow_offset = (data[6] << 8) + data[7]; + return (0); } @@ -166,19 +265,22 @@ static int smu_run_cmd(device_t dev, struct smu_cmd *cmd) { struct smu_softc *sc; - int doorbell_ack, result; + int doorbell_ack, result, oldpow; sc = device_get_softc(dev); mtx_lock(&sc->sc_mtx); + oldpow = powerpc_pow_enabled; + powerpc_pow_enabled = 0; + /* Copy the command to the mailbox */ memcpy(sc->sc_cmd, cmd, sizeof(*cmd)); bus_dmamap_sync(sc->sc_dmatag, sc->sc_cmd_dmamap, BUS_DMASYNC_PREWRITE); bus_space_write_4(sc->sc_bt, sc->sc_mailbox, 0, sc->sc_cmd_phys); - /* Invalidate the cacheline it is in -- SMU bypasses the cache */ - __asm __volatile("dcbst 0,%0; sync" :: "r"(sc->sc_cmd): "memory"); + /* Flush the cacheline it is in -- SMU bypasses the cache */ + __asm __volatile("sync; dcbf 0,%0; sync" :: "r"(sc->sc_cmd): "memory"); /* Ring SMU doorbell */ macgpio_write(smu_doorbell, GPIO_DDR_OUTPUT); @@ -188,7 +290,7 @@ smu_run_cmd(device_t dev, struct smu_cmd /* XXX: timeout */ DELAY(50); doorbell_ack = macgpio_read(smu_doorbell); - } while (!doorbell_ack); + } while (doorbell_ack != (GPIO_DDR_OUTPUT | GPIO_LEVEL_RO | GPIO_DATA)); /* Check result. First invalidate the cache again... */ __asm __volatile("dcbf 0,%0; sync" :: "r"(sc->sc_cmd) : "memory"); @@ -196,16 +298,49 @@ smu_run_cmd(device_t dev, struct smu_cmd bus_dmamap_sync(sc->sc_dmatag, sc->sc_cmd_dmamap, BUS_DMASYNC_POSTREAD); /* SMU acks the command by inverting the command bits */ - if (sc->sc_cmd->cmd == ~cmd->cmd) + if (sc->sc_cmd->cmd == ((~cmd->cmd) & 0xff)) result = 0; else result = EIO; + powerpc_pow_enabled = oldpow; + + memcpy(cmd->data, sc->sc_cmd->data, sizeof(cmd->data)); + mtx_unlock(&sc->sc_mtx); return (result); } +static int +smu_get_datablock(device_t dev, int8_t id, uint8_t *buf, size_t len) +{ + struct smu_cmd cmd; + uint8_t addr[4]; + + cmd.cmd = SMU_PARTITION; + cmd.len = 2; + cmd.data[0] = SMU_PARTITION_LATEST; + cmd.data[1] = id; + + smu_run_cmd(dev, &cmd); + + addr[0] = addr[1] = 0; + addr[2] = cmd.data[0]; + addr[3] = cmd.data[1]; + + cmd.cmd = SMU_MISC; + cmd.len = 7; + cmd.data[0] = SMU_MISC_GET_DATA; + cmd.data[1] = sizeof(addr); + memcpy(&cmd.data[2], addr, sizeof(addr)); + cmd.data[6] = len; + + smu_run_cmd(dev, &cmd); + memcpy(buf, cmd.data, len); + return (0); +} + static void smu_slew_cpu_voltage(device_t dev, int to) { @@ -286,3 +421,298 @@ doorbell_attach(device_t dev) smu_doorbell = dev; return (0); } + +/* + * Sensor and fan management + */ + +static int +smu_fan_set_rpm(device_t smu, struct smu_fan *fan, int rpm) +{ + struct smu_cmd cmd; + + cmd.cmd = SMU_FAN; + cmd.len = 14; + cmd.data[0] = 0; + cmd.data[1] = 1 << fan->reg; + + /* + * There are two locations used for the fan speed. + * Store it in both. + */ + + cmd.data[2] = cmd.data[2 + 2*fan->reg] = (rpm >> 8) & 0xff; + cmd.data[3] = cmd.data[3 + 2*fan->reg] = rpm & 0xff; + + return (smu_run_cmd(smu, &cmd)); +} + +static int +smu_fan_read_rpm(device_t smu, struct smu_fan *fan) +{ + struct smu_cmd cmd; + + cmd.cmd = SMU_FAN; + cmd.len = 2; + cmd.data[0] = 1; + cmd.data[1] = 1 << fan->reg; + + smu_run_cmd(smu, &cmd); + + return ((cmd.data[1] << 8) | cmd.data[2]); +} + +static int +smu_fanrpm_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t smu; + struct smu_softc *sc; + struct smu_fan *fan; + int rpm, error; + + smu = arg1; + sc = device_get_softc(smu); + fan = &sc->sc_fans[arg2]; + + rpm = smu_fan_read_rpm(smu, fan); + error = sysctl_handle_int(oidp, &rpm, 0, req); + + if (error || !req->newptr) + return (error); + + + return (smu_fan_set_rpm(smu, fan, rpm)); +} + +static void +smu_attach_fans(device_t dev, phandle_t fanroot) +{ + struct smu_fan *fan; + struct smu_softc *sc; + struct sysctl_oid *oid, *fanroot_oid; + struct sysctl_ctx_list *ctx; + phandle_t child; + char type[32], sysctl_name[32]; + int i; + + sc = device_get_softc(dev); + sc->sc_nfans = 0; + + for (child = OF_child(fanroot); child != 0; child = OF_peer(child)) + sc->sc_nfans++; + + if (sc->sc_nfans == 0) { + device_printf(dev, "WARNING: No fans detected!\n"); + return; + } + + sc->sc_fans = malloc(sc->sc_nfans * sizeof(struct smu_fan), M_SMU, + M_WAITOK | M_ZERO); + + fan = sc->sc_fans; + sc->sc_nfans = 0; + + ctx = device_get_sysctl_ctx(dev); + fanroot_oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "fans", + CTLFLAG_RD, 0, "SMU Fan Information"); + + for (child = OF_child(fanroot); child != 0; child = OF_peer(child)) { + OF_getprop(child, "device_type", type, sizeof(type)); + if (strcmp(type, "fan-rpm-control") != 0) + continue; + + OF_getprop(child, "reg", &fan->reg, sizeof(cell_t)); + OF_getprop(child, "min-value", &fan->min_rpm, sizeof(cell_t)); + OF_getprop(child, "max-value", &fan->max_rpm, sizeof(cell_t)); + OF_getprop(child, "unmanaged-value", &fan->unmanaged_rpm, + sizeof(cell_t)); + OF_getprop(child, "location", fan->location, + sizeof(fan->location)); + + /* Make sure it is at a safe value initially */ + //smu_fan_set_rpm(dev, fan, fan->unmanaged_rpm); + + /* Add sysctls */ + for (i = 0; i < strlen(fan->location); i++) { + sysctl_name[i] = tolower(fan->location[i]); + if (isspace(sysctl_name[i])) + sysctl_name[i] = '_'; + } + sysctl_name[i] = 0; + + oid = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(fanroot_oid), + OID_AUTO, sysctl_name, CTLFLAG_RD, 0, "Fan Information"); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "minrpm", + CTLTYPE_INT | CTLFLAG_RD, &fan->min_rpm, sizeof(cell_t), + "Minimum allowed RPM"); + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "maxrpm", + CTLTYPE_INT | CTLFLAG_RD, &fan->max_rpm, sizeof(cell_t), + "Maximum allowed RPM"); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "rpm", + CTLTYPE_INT | CTLFLAG_RW, dev, sc->sc_nfans, + smu_fanrpm_sysctl, "I", "Fan RPM"); + + fan++; + sc->sc_nfans++; + } +} + +static int +smu_sensor_read(device_t smu, struct smu_sensor *sens) +{ + struct smu_cmd cmd; + struct smu_softc *sc; + int64_t value; + + cmd.cmd = SMU_ADC; + cmd.len = 1; + cmd.data[0] = sens->reg; + + smu_run_cmd(smu, &cmd); + + sc = device_get_softc(smu); + value = (cmd.data[0] << 8) | cmd.data[1]; + + switch (sens->type) { + case SMU_TEMP_SENSOR: + value *= sc->sc_cpu_diode_scale; + value >>= 3; + value += ((int64_t)sc->sc_cpu_diode_offset) << 9; + value <<= 1; + + /* Convert from 16.16 fixed point degC into integer C. */ + value *= 15625; + value /= 1024; + value /= 1000000; + break; + case SMU_VOLTAGE_SENSOR: + value *= sc->sc_cpu_volt_scale; + value += sc->sc_cpu_volt_offset; + value <<= 4; + + /* Convert from 16.16 fixed point V into mV. */ + value *= 15625; + value /= 1024; + value /= 1000; + break; + case SMU_CURRENT_SENSOR: + value *= sc->sc_cpu_curr_scale; + value += sc->sc_cpu_curr_offset; + value <<= 4; + + /* Convert from 16.16 fixed point A into mA. */ + value *= 15625; + value /= 1024; + value /= 1000; + break; + case SMU_POWER_SENSOR: + value *= sc->sc_slots_pow_scale; + value += sc->sc_slots_pow_offset; + value <<= 4; + + /* Convert from 16.16 fixed point W into mW. */ + value *= 15625; + value /= 1024; + value /= 1000; + break; + } + + return (value); +} + +static int +smu_sensor_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t smu; + struct smu_softc *sc; + struct smu_sensor *sens; + int value, error; + + smu = arg1; + sc = device_get_softc(smu); + sens = &sc->sc_sensors[arg2]; + + value = smu_sensor_read(smu, sens); + error = sysctl_handle_int(oidp, &value, 0, req); + + return (error); +} + +static void +smu_attach_sensors(device_t dev, phandle_t sensroot) +{ + struct smu_sensor *sens; + struct smu_softc *sc; + struct sysctl_oid *sensroot_oid; + struct sysctl_ctx_list *ctx; + phandle_t child; + char type[32]; + int i; + + sc = device_get_softc(dev); + sc->sc_nsensors = 0; + + for (child = OF_child(sensroot); child != 0; child = OF_peer(child)) + sc->sc_nsensors++; + + if (sc->sc_nsensors == 0) { + device_printf(dev, "WARNING: No sensors detected!\n"); + return; + } + + sc->sc_fans = malloc(sc->sc_nsensors * sizeof(struct smu_sensor), M_SMU, + M_WAITOK | M_ZERO); + + sens = sc->sc_sensors; + sc->sc_nsensors = 0; + + ctx = device_get_sysctl_ctx(dev); + sensroot_oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensors", + CTLFLAG_RD, 0, "SMU Sensor Information"); + + for (child = OF_child(sensroot); child != 0; child = OF_peer(child)) { + char sysctl_name[40], sysctl_desc[40]; + const char *units; + + OF_getprop(child, "device_type", type, sizeof(type)); + + if (strcmp(type, "current-sensor") == 0) { + sens->type = SMU_CURRENT_SENSOR; + units = "mA"; + } else if (strcmp(type, "temp-sensor") == 0) { + sens->type = SMU_TEMP_SENSOR; + units = "C"; + } else if (strcmp(type, "voltage-sensor") == 0) { + sens->type = SMU_VOLTAGE_SENSOR; + units = "mV"; + } else if (strcmp(type, "power-sensor") == 0) { + sens->type = SMU_POWER_SENSOR; + units = "mW"; + } else { + continue; + } + + OF_getprop(child, "reg", &sens->reg, sizeof(cell_t)); + OF_getprop(child, "location", sens->location, + sizeof(sens->location)); + + 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, dev, sc->sc_nsensors, + smu_sensor_sysctl, "I", sysctl_desc); + + sens++; + sc->sc_nsensors++; + } +} + From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 07:56:35 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B23C106566B; Fri, 19 Feb 2010 07:56:35 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello089077043238.chello.pl [89.77.43.238]) by mx1.freebsd.org (Postfix) with ESMTP id 859498FC0A; Fri, 19 Feb 2010 07:56:34 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id C041145D8D; Fri, 19 Feb 2010 08:56:31 +0100 (CET) Received: from localhost (chello089077043238.chello.pl [89.77.43.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 08E7B456B1; Fri, 19 Feb 2010 08:56:25 +0100 (CET) Date: Fri, 19 Feb 2010 08:56:23 +0100 From: Pawel Jakub Dawidek To: Robert Watson Message-ID: <20100219075623.GB2157@garage.freebsd.pl> References: <201002182316.o1INGKqf007786@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Yylu36WmvOXNoKYn" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204076 - in head: etc/defaults etc/rc.d sbin sbin/ggate/ggatec sbin/ggate/ggatel sbin/hastctl sbin/hastd share/examples share/examples/hast share/man/man5 sys/geom/gate X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 07:56:35 -0000 --Yylu36WmvOXNoKYn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 18, 2010 at 11:22:31PM +0000, Robert Watson wrote: >=20 > On Thu, 18 Feb 2010, Pawel Jakub Dawidek wrote: >=20 > > Please welcome HAST - Highly Avalable Storage. >=20 > Excellent news! I know a number of shops will be very excited to see thi= s=20 > in the tree. >=20 > Could you say a little about the future of ggated in light of the new=20 > arrival? Ggated serves different purpose actually, so it will stay. In lack of HAST, people started to use ggate+gmirror to get similar functionality, but they don't have to do that anymore. Ggatec/ggated functionality is much similar to iSCSI, so if something will make ggatec/ggated to go away, it will be iSCSI. I've some really evil performance improvements plans for HAST and ggatec will benefit as well. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --Yylu36WmvOXNoKYn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkt+RCYACgkQForvXbEpPzT3+wCeLwHPvQUVxdWRpTvfbYhHEN/W eGQAoPeCSMzpJgj3MJ7fBdvYlkZQ0OmY =aWrj -----END PGP SIGNATURE----- --Yylu36WmvOXNoKYn-- From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 09:18:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32E48106566C; Fri, 19 Feb 2010 09:18:27 +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 086A78FC0C; Fri, 19 Feb 2010 09:18: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 o1J9IQPV040593; Fri, 19 Feb 2010 09:18:26 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1J9IQ3A040592; Fri, 19 Feb 2010 09:18:26 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002190918.o1J9IQ3A040592@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 19 Feb 2010 09:18: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: r204083 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 09:18:27 -0000 Author: pjd Date: Fri Feb 19 09:18:26 2010 New Revision: 204083 URL: http://svn.freebsd.org/changeset/base/204083 Log: Add missing KEYWORD line. Pointed out by: dougb Modified: head/etc/rc.d/hastd Modified: head/etc/rc.d/hastd ============================================================================== --- head/etc/rc.d/hastd Fri Feb 19 04:37:54 2010 (r204082) +++ head/etc/rc.d/hastd Fri Feb 19 09:18:26 2010 (r204083) @@ -6,6 +6,7 @@ # PROVIDE: hastd # REQUIRE: NETWORKING syslogd # BEFORE: DAEMON +# KEYWORD: nojail shutdown . /etc/rc.subr From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 14:27:32 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 992BA106566C; Fri, 19 Feb 2010 14:27:32 +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 88E118FC08; Fri, 19 Feb 2010 14:27: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 o1JERW73010359; Fri, 19 Feb 2010 14:27:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JERW9T010358; Fri, 19 Feb 2010 14:27:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201002191427.o1JERW9T010358@svn.freebsd.org> From: John Baldwin Date: Fri, 19 Feb 2010 14:27: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: r204085 - head/usr.sbin/mptable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 14:27:32 -0000 Author: jhb Date: Fri Feb 19 14:27:32 2010 New Revision: 204085 URL: http://svn.freebsd.org/changeset/base/204085 Log: Fix a typo. Submitted by: Jakub Lach jakub_lach of mailplus pl Modified: head/usr.sbin/mptable/mptable.c Modified: head/usr.sbin/mptable/mptable.c ============================================================================== --- head/usr.sbin/mptable/mptable.c Fri Feb 19 10:54:03 2010 (r204084) +++ head/usr.sbin/mptable/mptable.c Fri Feb 19 14:27:32 2010 (r204085) @@ -147,7 +147,7 @@ tableEntry basetableEntryTypes[] = tableEntry extendedtableEntryTypes[] = { { 128, 20, "System Address Space" }, - { 129, 8, "Bus Heirarchy" }, + { 129, 8, "Bus Hierarchy" }, { 130, 8, "Compatibility Bus Address" } }; From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 14:31:02 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 485F41065696; Fri, 19 Feb 2010 14:31:02 +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 1EC5C8FC21; Fri, 19 Feb 2010 14:31: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 o1JEV2RQ011146; Fri, 19 Feb 2010 14:31:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JEV2Vc011144; Fri, 19 Feb 2010 14:31:02 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201002191431.o1JEV2Vc011144@svn.freebsd.org> From: John Baldwin Date: Fri, 19 Feb 2010 14:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204086 - head/usr.sbin/mptutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 14:31:02 -0000 Author: jhb Date: Fri Feb 19 14:31:01 2010 New Revision: 204086 URL: http://svn.freebsd.org/changeset/base/204086 Log: - Don't emit a warning in 'show adapter' if the IOC2 or IOC6 pages are not present. mpt(4) controllers that do not support RAID do not have an IOC6 page, for example. - Correct a check for a missing page error in a debug function. MFC after: 1 week Modified: head/usr.sbin/mptutil/mpt_show.c Modified: head/usr.sbin/mptutil/mpt_show.c ============================================================================== --- head/usr.sbin/mptutil/mpt_show.c Fri Feb 19 14:27:32 2010 (r204085) +++ head/usr.sbin/mptutil/mpt_show.c Fri Feb 19 14:31:01 2010 (r204086) @@ -78,6 +78,7 @@ show_adapter(int ac, char **av) CONFIG_PAGE_MANUFACTURING_0 *man0; CONFIG_PAGE_IOC_2 *ioc2; CONFIG_PAGE_IOC_6 *ioc6; + U16 IOCStatus; int fd, comma; if (ac != 1) { @@ -108,7 +109,7 @@ show_adapter(int ac, char **av) free(man0); - ioc2 = mpt_read_ioc_page(fd, 2, NULL); + ioc2 = mpt_read_ioc_page(fd, 2, &IOCStatus); if (ioc2 != NULL) { printf(" RAID Levels:"); comma = 0; @@ -151,9 +152,11 @@ show_adapter(int ac, char **av) printf(" none"); printf("\n"); free(ioc2); - } + } else if ((IOCStatus & MPI_IOCSTATUS_MASK) != + MPI_IOCSTATUS_CONFIG_INVALID_PAGE) + warnx("mpt_read_ioc_page(2): %s", mpt_ioc_status(IOCStatus)); - ioc6 = mpt_read_ioc_page(fd, 6, NULL); + ioc6 = mpt_read_ioc_page(fd, 6, &IOCStatus); if (ioc6 != NULL) { display_stripe_map(" RAID0 Stripes", ioc6->SupportedStripeSizeMapIS); @@ -172,7 +175,9 @@ show_adapter(int ac, char **av) printf("-%u", ioc6->MaxDrivesIME); printf("\n"); free(ioc6); - } + } else if ((IOCStatus & MPI_IOCSTATUS_MASK) != + MPI_IOCSTATUS_CONFIG_INVALID_PAGE) + warnx("mpt_read_ioc_page(6): %s", mpt_ioc_status(IOCStatus)); /* TODO: Add an ioctl to fetch IOC_FACTS and print firmware version. */ @@ -541,7 +546,8 @@ show_physdisks(int ac, char **av) for (i = 0; i <= 0xff; i++) { pinfo = mpt_pd_info(fd, i, &IOCStatus); if (pinfo == NULL) { - if (IOCStatus != MPI_IOCSTATUS_CONFIG_INVALID_PAGE) + if ((IOCStatus & MPI_IOCSTATUS_MASK) != + MPI_IOCSTATUS_CONFIG_INVALID_PAGE) warnx("mpt_pd_info(%d): %s", i, mpt_ioc_status(IOCStatus)); continue; From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 14:59:42 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44DAD106566B; Fri, 19 Feb 2010 14:59:42 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 346218FC0A; Fri, 19 Feb 2010 14:59: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 o1JExgaC017501; Fri, 19 Feb 2010 14:59:42 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JExgvV017499; Fri, 19 Feb 2010 14:59:42 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201002191459.o1JExgvV017499@svn.freebsd.org> From: Attilio Rao Date: Fri, 19 Feb 2010 14:59: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: r204087 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 14:59:42 -0000 Author: attilio Date: Fri Feb 19 14:59:41 2010 New Revision: 204087 URL: http://svn.freebsd.org/changeset/base/204087 Log: Fix a race in regard of p_numthreads. Submitted by: Giovanni Trematerra Modified: head/sys/kern/kern_kthread.c Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Fri Feb 19 14:31:01 2010 (r204086) +++ head/sys/kern/kern_kthread.c Fri Feb 19 14:59:41 2010 (r204087) @@ -312,18 +312,17 @@ kthread_exit(void) { struct proc *p; + p = curthread->td_proc; + /* A module may be waiting for us to exit. */ wakeup(curthread); - - /* - * We could rely on thread_exit to call exit1() but - * there is extra work that needs to be done - */ - if (curthread->td_proc->p_numthreads == 1) - kproc_exit(0); /* never returns */ - - p = curthread->td_proc; PROC_LOCK(p); + if (curthread->td_proc->p_numthreads == 1) { + PROC_UNLOCK(p); + kproc_exit(0); + + /* NOTREACHED. */ + } PROC_SLOCK(p); thread_exit(); } From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 15:03:56 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2353A106566C; Fri, 19 Feb 2010 15:03:56 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 12C068FC14; Fri, 19 Feb 2010 15:03: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 o1JF3t7W018469; Fri, 19 Feb 2010 15:03:55 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JF3tAE018467; Fri, 19 Feb 2010 15:03:55 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201002191503.o1JF3tAE018467@svn.freebsd.org> From: Attilio Rao Date: Fri, 19 Feb 2010 15:03: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: r204088 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 15:03:56 -0000 Author: attilio Date: Fri Feb 19 15:03:55 2010 New Revision: 204088 URL: http://svn.freebsd.org/changeset/base/204088 Log: Fix the grammar. Submitted by: Brandon Gooch Modified: head/sys/kern/kern_kthread.c Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Fri Feb 19 14:59:41 2010 (r204087) +++ head/sys/kern/kern_kthread.c Fri Feb 19 15:03:55 2010 (r204088) @@ -339,9 +339,9 @@ kthread_suspend(struct thread *td, int t p = td->td_proc; /* - * td_pflags should not be ready by any other thread different by + * td_pflags should not be read by any thread other than * curthread, but as long as this flag is invariant during the - * thread lifetime, it is ok to check for it now. + * thread's lifetime, it is OK to check its state. */ if ((td->td_pflags & TDP_KTHREAD) == 0) return (EINVAL); @@ -370,9 +370,9 @@ kthread_resume(struct thread *td) p = td->td_proc; /* - * td_pflags should not be ready by any other thread different by + * td_pflags should not be read by any thread other than * curthread, but as long as this flag is invariant during the - * thread lifetime, it is ok to check for it now. + * thread's lifetime, it is OK to check its state. */ if ((td->td_pflags & TDP_KTHREAD) == 0) return (EINVAL); From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 15:10:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C93C51065670; Fri, 19 Feb 2010 15:10:05 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8F568FC16; Fri, 19 Feb 2010 15:10: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 o1JFA5sJ019850; Fri, 19 Feb 2010 15:10:05 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JFA5LC019848; Fri, 19 Feb 2010 15:10:05 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201002191510.o1JFA5LC019848@svn.freebsd.org> From: Attilio Rao Date: Fri, 19 Feb 2010 15:10: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: r204089 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 15:10:05 -0000 Author: attilio Date: Fri Feb 19 15:10:05 2010 New Revision: 204089 URL: http://svn.freebsd.org/changeset/base/204089 Log: Use the cached value within comparison. Submitted by: jhb Modified: head/sys/kern/kern_kthread.c Modified: head/sys/kern/kern_kthread.c ============================================================================== --- head/sys/kern/kern_kthread.c Fri Feb 19 15:03:55 2010 (r204088) +++ head/sys/kern/kern_kthread.c Fri Feb 19 15:10:05 2010 (r204089) @@ -317,7 +317,7 @@ kthread_exit(void) /* A module may be waiting for us to exit. */ wakeup(curthread); PROC_LOCK(p); - if (curthread->td_proc->p_numthreads == 1) { + if (p->p_numthreads == 1) { PROC_UNLOCK(p); kproc_exit(0); From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 15:16:01 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E272B106568B; Fri, 19 Feb 2010 15:16:00 +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 D09338FC0C; Fri, 19 Feb 2010 15:16: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 o1JFG05M021207; Fri, 19 Feb 2010 15:16:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JFG0l8021205; Fri, 19 Feb 2010 15:16:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201002191516.o1JFG0l8021205@svn.freebsd.org> From: John Baldwin Date: Fri, 19 Feb 2010 15:16: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: r204090 - head/usr.sbin/mptutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 15:16:01 -0000 Author: jhb Date: Fri Feb 19 15:16:00 2010 New Revision: 204090 URL: http://svn.freebsd.org/changeset/base/204090 Log: Fix mptutil's method for locating disk devices attached to a specific mpt(4) controller. Previously, the code assumed that multiple match patterns provided to an XPT_DEV_MATCH request were ANDed together. Instead, they are ORed. Instead, to match peripherals for a specific bus, one query needs to be performed to lookup the path ID of the bus. A second query can then be performed matching peripherals attached to that path. This approach also makes the code a bit cleaner as the returned match results do not mix bus and perphierals. Reported by: several folks MFC after: 1 week Modified: head/usr.sbin/mptutil/mpt_cam.c Modified: head/usr.sbin/mptutil/mpt_cam.c ============================================================================== --- head/usr.sbin/mptutil/mpt_cam.c Fri Feb 19 15:10:05 2010 (r204089) +++ head/usr.sbin/mptutil/mpt_cam.c Fri Feb 19 15:16:00 2010 (r204090) @@ -56,15 +56,75 @@ xpt_open(void) return (xptfd); } +/* Fetch the path id of bus 0 for the opened mpt controller. */ +static int +fetch_path_id(path_id_t *path_id) +{ + struct bus_match_pattern *b; + union ccb ccb; + size_t bufsize; + + if (xpt_open() < 0) + return (ENXIO); + + /* First, find the path id of bus 0 for this mpt controller. */ + bzero(&ccb, sizeof(ccb)); + + ccb.ccb_h.func_code = XPT_DEV_MATCH; + + bufsize = sizeof(struct dev_match_result) * 1; + ccb.cdm.num_matches = 0; + ccb.cdm.match_buf_len = bufsize; + ccb.cdm.matches = calloc(1, bufsize); + + bufsize = sizeof(struct dev_match_pattern) * 1; + ccb.cdm.num_patterns = 1; + ccb.cdm.pattern_buf_len = bufsize; + ccb.cdm.patterns = calloc(1, bufsize); + + /* Match mptX bus 0. */ + ccb.cdm.patterns[0].type = DEV_MATCH_BUS; + b = &ccb.cdm.patterns[0].pattern.bus_pattern; + snprintf(b->dev_name, sizeof(b->dev_name), "mpt"); + b->unit_number = mpt_unit; + b->bus_id = 0; + b->flags = BUS_MATCH_NAME | BUS_MATCH_UNIT | BUS_MATCH_BUS_ID; + + if (ioctl(xptfd, CAMIOCOMMAND, &ccb) < 0) { + free(ccb.cdm.matches); + free(ccb.cdm.patterns); + return (errno); + } + free(ccb.cdm.patterns); + + if (((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) || + (ccb.cdm.status != CAM_DEV_MATCH_LAST)) { + warnx("fetch_path_id got CAM error %#x, CDM error %d\n", + ccb.ccb_h.status, ccb.cdm.status); + free(ccb.cdm.matches); + return (EIO); + } + + /* We should have exactly 1 match for the bus. */ + if (ccb.cdm.num_matches != 1 || + ccb.cdm.matches[0].type != DEV_MATCH_BUS) { + free(ccb.cdm.matches); + return (ENOENT); + } + *path_id = ccb.cdm.matches[0].result.bus_result.path_id; + free(ccb.cdm.matches); + return (0); +} + int mpt_query_disk(U8 VolumeBus, U8 VolumeID, struct mpt_query_disk *qd) { - struct bus_match_pattern *b; struct periph_match_pattern *p; struct periph_match_result *r; union ccb ccb; + path_id_t path_id; size_t bufsize; - int i; + int error, i; /* mpt(4) only handles devices on bus 0. */ if (VolumeBus != 0) @@ -73,6 +133,11 @@ mpt_query_disk(U8 VolumeBus, U8 VolumeID if (xpt_open() < 0) return (ENXIO); + /* Find the path ID of bus 0. */ + error = fetch_path_id(&path_id); + if (error) + return (error); + bzero(&ccb, sizeof(ccb)); ccb.ccb_h.func_code = XPT_DEV_MATCH; @@ -85,25 +150,18 @@ mpt_query_disk(U8 VolumeBus, U8 VolumeID ccb.cdm.match_buf_len = bufsize; ccb.cdm.matches = calloc(1, bufsize); - bufsize = sizeof(struct dev_match_pattern) * 2; - ccb.cdm.num_patterns = 2; + bufsize = sizeof(struct dev_match_pattern) * 1; + ccb.cdm.num_patterns = 1; ccb.cdm.pattern_buf_len = bufsize; ccb.cdm.patterns = calloc(1, bufsize); - /* Match mptX bus 0. */ - ccb.cdm.patterns[0].type = DEV_MATCH_BUS; - b = &ccb.cdm.patterns[0].pattern.bus_pattern; - snprintf(b->dev_name, sizeof(b->dev_name), "mpt"); - b->unit_number = mpt_unit; - b->bus_id = 0; - b->flags = BUS_MATCH_NAME | BUS_MATCH_UNIT | BUS_MATCH_BUS_ID; - /* Look for a "da" device at the specified target and lun. */ - ccb.cdm.patterns[1].type = DEV_MATCH_PERIPH; - p = &ccb.cdm.patterns[1].pattern.periph_pattern; + ccb.cdm.patterns[0].type = DEV_MATCH_PERIPH; + p = &ccb.cdm.patterns[0].pattern.periph_pattern; + p->path_id = path_id; snprintf(p->periph_name, sizeof(p->periph_name), "da"); p->target_id = VolumeID; - p->flags = PERIPH_MATCH_NAME | PERIPH_MATCH_TARGET; + p->flags = PERIPH_MATCH_PATH | PERIPH_MATCH_NAME | PERIPH_MATCH_TARGET; if (ioctl(xptfd, CAMIOCOMMAND, &ccb) < 0) { i = errno; @@ -122,25 +180,22 @@ mpt_query_disk(U8 VolumeBus, U8 VolumeID } /* - * We should have exactly 2 matches, 1 for the bus and 1 for - * the peripheral. However, if we only have 1 match and it is - * for the bus, don't print an error message and return - * ENOENT. + * We should have exactly 1 match for the peripheral. + * However, if we don't get a match, don't print an error + * message and return ENOENT. */ - if (ccb.cdm.num_matches == 1 && - ccb.cdm.matches[0].type == DEV_MATCH_BUS) { + if (ccb.cdm.num_matches == 0) { free(ccb.cdm.matches); return (ENOENT); } - if (ccb.cdm.num_matches != 2) { - warnx("mpt_query_disk got %d matches, expected 2", + if (ccb.cdm.num_matches != 1) { + warnx("mpt_query_disk got %d matches, expected 1", ccb.cdm.num_matches); free(ccb.cdm.matches); return (EIO); } - if (ccb.cdm.matches[0].type != DEV_MATCH_BUS || - ccb.cdm.matches[1].type != DEV_MATCH_PERIPH) { - warnx("mpt_query_disk got wrong CAM matches"); + if (ccb.cdm.matches[0].type != DEV_MATCH_PERIPH) { + warnx("mpt_query_disk got wrong CAM match"); free(ccb.cdm.matches); return (EIO); } @@ -336,47 +391,44 @@ mpt_fetch_disks(int fd, int *ndisks, str { CONFIG_PAGE_IOC_2 *ioc2; struct mpt_standalone_disk *disks; - struct bus_match_pattern *b; struct periph_match_pattern *p; struct periph_match_result *r; struct cam_device *dev; union ccb ccb; + path_id_t path_id; size_t bufsize; u_int i; - int count; + int count, error; if (xpt_open() < 0) return (ENXIO); + error = fetch_path_id(&path_id); + if (error) + return (error); + for (count = 100;; count+= 100) { /* Try to fetch 'count' disks in one go. */ bzero(&ccb, sizeof(ccb)); ccb.ccb_h.func_code = XPT_DEV_MATCH; - bufsize = sizeof(struct dev_match_result) * (count + 2); + bufsize = sizeof(struct dev_match_result) * (count + 1); ccb.cdm.num_matches = 0; ccb.cdm.match_buf_len = bufsize; ccb.cdm.matches = calloc(1, bufsize); - bufsize = sizeof(struct dev_match_pattern) * 2; - ccb.cdm.num_patterns = 2; + bufsize = sizeof(struct dev_match_pattern) * 1; + ccb.cdm.num_patterns = 1; ccb.cdm.pattern_buf_len = bufsize; ccb.cdm.patterns = calloc(1, bufsize); - /* Match mptX bus 0. */ - ccb.cdm.patterns[0].type = DEV_MATCH_BUS; - b = &ccb.cdm.patterns[0].pattern.bus_pattern; - snprintf(b->dev_name, sizeof(b->dev_name), "mpt"); - b->unit_number = mpt_unit; - b->bus_id = 0; - b->flags = BUS_MATCH_NAME | BUS_MATCH_UNIT | BUS_MATCH_BUS_ID; - /* Match any "da" peripherals. */ - ccb.cdm.patterns[1].type = DEV_MATCH_PERIPH; - p = &ccb.cdm.patterns[1].pattern.periph_pattern; + ccb.cdm.patterns[0].type = DEV_MATCH_PERIPH; + p = &ccb.cdm.patterns[0].pattern.periph_pattern; + p->path_id = path_id; snprintf(p->periph_name, sizeof(p->periph_name), "da"); - p->flags = PERIPH_MATCH_NAME; + p->flags = PERIPH_MATCH_PATH | PERIPH_MATCH_NAME; if (ioctl(xptfd, CAMIOCOMMAND, &ccb) < 0) { i = errno; @@ -406,21 +458,16 @@ mpt_fetch_disks(int fd, int *ndisks, str break; } - /* - * We should have N + 1 matches, 1 for the bus and 1 for each - * "da" device. - */ - if (ccb.cdm.num_matches < 1) { - warnx("mpt_fetch_disks didn't get any matches"); - free(ccb.cdm.matches); - return (EIO); - } - if (ccb.cdm.matches[0].type != DEV_MATCH_BUS) { - warnx("mpt_fetch_disks got wrong CAM matches"); + /* Shortcut if we don't have any "da" devices. */ + if (ccb.cdm.num_matches == 0) { free(ccb.cdm.matches); - return (EIO); + *ndisks = 0; + *disksp = NULL; + return (0); } - for (i = 1; i < ccb.cdm.num_matches; i++) { + + /* We should have N matches, 1 for each "da" device. */ + for (i = 0; i < ccb.cdm.num_matches; i++) { if (ccb.cdm.matches[i].type != DEV_MATCH_PERIPH) { warnx("mpt_fetch_disks got wrong CAM matches"); free(ccb.cdm.matches); @@ -428,14 +475,6 @@ mpt_fetch_disks(int fd, int *ndisks, str } } - /* Shortcut if we don't have any "da" devices. */ - if (ccb.cdm.num_matches == 1) { - free(ccb.cdm.matches); - *ndisks = 0; - *disksp = NULL; - return (0); - } - /* * Some of the "da" peripherals may be for RAID volumes, so * fetch the IOC 2 page (list of RAID volumes) so we can @@ -444,7 +483,7 @@ mpt_fetch_disks(int fd, int *ndisks, str ioc2 = mpt_read_ioc_page(fd, 2, NULL); disks = calloc(ccb.cdm.num_matches, sizeof(*disks)); count = 0; - for (i = 1; i < ccb.cdm.num_matches; i++) { + for (i = 0; i < ccb.cdm.num_matches; i++) { r = &ccb.cdm.matches[i].result.periph_result; if (periph_is_volume(ioc2, r)) continue; @@ -480,10 +519,9 @@ mpt_fetch_disks(int fd, int *ndisks, str int mpt_rescan_bus(int bus, int id) { - struct bus_match_pattern *b; union ccb ccb; path_id_t path_id; - size_t bufsize; + int error; /* mpt(4) only handles devices on bus 0. */ if (bus != -1 && bus != 0) @@ -492,54 +530,12 @@ mpt_rescan_bus(int bus, int id) if (xpt_open() < 0) return (ENXIO); - /* First, find the path id of bus 0 for this mpt controller. */ - bzero(&ccb, sizeof(ccb)); - - ccb.ccb_h.func_code = XPT_DEV_MATCH; - - bufsize = sizeof(struct dev_match_result) * 1; - ccb.cdm.num_matches = 0; - ccb.cdm.match_buf_len = bufsize; - ccb.cdm.matches = calloc(1, bufsize); - - bufsize = sizeof(struct dev_match_pattern) * 1; - ccb.cdm.num_patterns = 1; - ccb.cdm.pattern_buf_len = bufsize; - ccb.cdm.patterns = calloc(1, bufsize); - - /* Match mptX bus 0. */ - ccb.cdm.patterns[0].type = DEV_MATCH_BUS; - b = &ccb.cdm.patterns[0].pattern.bus_pattern; - snprintf(b->dev_name, sizeof(b->dev_name), "mpt"); - b->unit_number = mpt_unit; - b->bus_id = 0; - b->flags = BUS_MATCH_NAME | BUS_MATCH_UNIT | BUS_MATCH_BUS_ID; - - if (ioctl(xptfd, CAMIOCOMMAND, &ccb) < 0) { - free(ccb.cdm.matches); - free(ccb.cdm.patterns); - return (errno); - } - free(ccb.cdm.patterns); - - if (((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) || - (ccb.cdm.status != CAM_DEV_MATCH_LAST)) { - warnx("mpt_rescan_bus got CAM error %#x, CDM error %d\n", - ccb.ccb_h.status, ccb.cdm.status); - free(ccb.cdm.matches); - return (EIO); - } - - /* We should have exactly 1 match for the bus. */ - if (ccb.cdm.num_matches != 1 || - ccb.cdm.matches[0].type != DEV_MATCH_BUS) { - free(ccb.cdm.matches); - return (ENOENT); - } - path_id = ccb.cdm.matches[0].result.bus_result.path_id; - free(ccb.cdm.matches); + error = fetch_path_id(&path_id); + if (error) + return (error); - /* Now perform the actual rescan. */ + /* Perform the actual rescan. */ + bzero(&ccb, sizeof(ccb)); ccb.ccb_h.path_id = path_id; if (id == -1) { ccb.ccb_h.func_code = XPT_SCAN_BUS; From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 16:54:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA2AF1065672; Fri, 19 Feb 2010 16:54:51 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9886A8FC12; Fri, 19 Feb 2010 16:54: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 o1JGspkh043211; Fri, 19 Feb 2010 16:54:51 GMT (envelope-from fanf@svn.freebsd.org) Received: (from fanf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JGspfE043208; Fri, 19 Feb 2010 16:54:51 GMT (envelope-from fanf@svn.freebsd.org) Message-Id: <201002191654.o1JGspfE043208@svn.freebsd.org> From: Tony Finch Date: Fri, 19 Feb 2010 16:54: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: r204092 - head/usr.bin/unifdef X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 16:54:51 -0000 Author: fanf Date: Fri Feb 19 16:54:51 2010 New Revision: 204092 URL: http://svn.freebsd.org/changeset/base/204092 Log: Update to upstream version 1.338 Fix a long-standing cpp compatibility bug: The -DFOO argument (without an explicit value) should define FOO to 1 not to the empty string. Add support for CRLF newlines, based on a suggestion from Mark Rushakoff. Obtained from: http://dotat.at/prog/unifdef/ Modified: head/usr.bin/unifdef/unifdef.1 head/usr.bin/unifdef/unifdef.c Modified: head/usr.bin/unifdef/unifdef.1 ============================================================================== --- head/usr.bin/unifdef/unifdef.1 Fri Feb 19 16:36:08 2010 (r204091) +++ head/usr.bin/unifdef/unifdef.1 Fri Feb 19 16:54:51 2010 (r204092) @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)unifdef.1 8.2 (Berkeley) 4/1/94 -.\" $dotat: unifdef/unifdef.1,v 1.62 2010/01/19 17:33:53 fanf2 Exp $ +.\" $dotat: unifdef/unifdef.1,v 1.63 2010/02/19 16:41:15 fanf2 Exp $ .\" $FreeBSD$ .\" .Dd January 19, 2010 @@ -168,14 +168,16 @@ with appropriate arguments to process th .Sh OPTIONS .Pp .Bl -tag -width indent -compact -.It Fl D Ns Ar sym Ns Op = Ns Ar val -Specify that a symbol is defined, -and optionally specify what value to give it -for the purpose of handling +.It Fl D Ns Ar sym Ns = Ns Ar val +Specify that a symbol is defined to a given value +which is used when evaluating .Ic #if and .Ic #elif -directives. +control expressions. +.Pp +.It Fl D Ns Ar sym +Specify that a symbol is defined to the value 1. .Pp .It Fl U Ns Ar sym Specify that a symbol is undefined. Modified: head/usr.bin/unifdef/unifdef.c ============================================================================== --- head/usr.bin/unifdef/unifdef.c Fri Feb 19 16:36:08 2010 (r204091) +++ head/usr.bin/unifdef/unifdef.c Fri Feb 19 16:54:51 2010 (r204092) @@ -39,8 +39,8 @@ * #else's and #endif's to see that they match their * corresponding #ifdef or #ifndef * - * The first two items above require better buffer handling, which would - * also make it possible to handle all "dodgy" directives correctly. + * These require better buffer handling, which would also make + * it possible to handle all "dodgy" directives correctly. */ #include @@ -57,7 +57,7 @@ #include #ifdef __IDSTRING -__IDSTRING(dotat, "$dotat: unifdef/unifdef.c,v 1.193 2010/01/19 18:03:02 fanf2 Exp $"); +__IDSTRING(dotat, "$dotat: unifdef/unifdef.c,v 1.198 2010/02/19 16:37:05 fanf2 Exp $"); #endif #ifdef __FBSDID __FBSDID("$FreeBSD$"); @@ -190,6 +190,10 @@ static char tempname[FILENAM static char tline[MAXLINE+EDITSLOP];/* input buffer plus space */ static char *keyword; /* used for editing #elif's */ +static const char *newline; /* input file format */ +static const char newline_unix[] = "\n"; +static const char newline_crlf[] = "\r\n"; + static Comment_state incomment; /* comment parser state */ static Line_state linestate; /* #if line parser state */ static Ifstate ifstate[MAXDEPTH]; /* #if processor state */ @@ -313,6 +317,7 @@ main(int argc, char *argv[]) input = stdin; } if (ofilename == NULL) { + ofilename = "[stdout]"; output = stdout; } else { struct stat ist, ost; @@ -336,7 +341,8 @@ main(int argc, char *argv[]) "%.*s/" TEMPLATE, (int)(dirsep - ofilename), ofilename); else - strlcpy(tempname, TEMPLATE, sizeof(tempname)); + snprintf(tempname, sizeof(tempname), + TEMPLATE); ofd = mkstemp(tempname); if (ofd != -1) output = fdopen(ofd, "w+"); @@ -429,9 +435,9 @@ static void Itrue (void) { Ftrue(); ign static void Ifalse(void) { Ffalse(); ignoreon(); } /* edit this line */ static void Mpass (void) { strncpy(keyword, "if ", 4); Pelif(); } -static void Mtrue (void) { keywordedit("else\n"); state(IS_TRUE_MIDDLE); } -static void Melif (void) { keywordedit("endif\n"); state(IS_FALSE_TRAILER); } -static void Melse (void) { keywordedit("endif\n"); state(IS_FALSE_ELSE); } +static void Mtrue (void) { keywordedit("else"); state(IS_TRUE_MIDDLE); } +static void Melif (void) { keywordedit("endif"); state(IS_FALSE_TRAILER); } +static void Melse (void) { keywordedit("endif"); state(IS_FALSE_ELSE); } static state_fn * const trans_table[IS_COUNT][LT_COUNT] = { /* IS_OUTSIDE */ @@ -497,7 +503,8 @@ ignoreon(void) static void keywordedit(const char *replacement) { - strlcpy(keyword, replacement, tline + sizeof(tline) - keyword); + snprintf(keyword, tline + sizeof(tline) - keyword, + "%s%s", replacement, newline); print(); } static void @@ -532,20 +539,20 @@ flushline(bool keep) if (symlist) return; if (keep ^ complement) { - bool blankline = tline[strspn(tline, " \t\n")] == '\0'; + bool blankline = tline[strspn(tline, " \t\r\n")] == '\0'; if (blankline && compblank && blankcount != blankmax) { delcount += 1; blankcount += 1; } else { if (lnnum && delcount > 0) - printf("#line %d\n", linenum); + printf("#line %d%s", linenum, newline); fputs(tline, output); delcount = 0; blankmax = blankcount = blankline ? blankcount + 1 : 0; } } else { if (lnblank) - putc('\n', output); + fputs(newline, output); exitstat = 1; delcount += 1; blankcount = 0; @@ -580,7 +587,7 @@ static void closeout(void) { if (fclose(output) == EOF) { - warn("couldn't write to output"); + warn("couldn't write to %s", ofilename); if (overwriting) { unlink(tempname); errx(2, "%s unchanged", filename); @@ -623,6 +630,12 @@ parseline(void) if (fgets(tline, MAXLINE, input) == NULL) return (LT_EOF); + if (newline == NULL) { + if (strrchr(tline, '\n') == strrchr(tline, '\r') + 1) + newline = newline_crlf; + else + newline = newline_unix; + } retval = LT_PLAIN; wascomment = incomment; cp = skipcomment(tline); @@ -638,7 +651,8 @@ parseline(void) cp = skipsym(cp); kwlen = cp - keyword; /* no way can we deal with a continuation inside a keyword */ - if (strncmp(cp, "\\\n", 2) == 0) + if (strncmp(cp, "\\\r\n", 3) == 0 || + strncmp(cp, "\\\n", 2) == 0) Eioccc(); if (strlcmp("ifdef", keyword, kwlen) == 0 || strlcmp("ifndef", keyword, kwlen) == 0) { @@ -689,9 +703,8 @@ parseline(void) size_t len = cp - tline; if (fgets(tline + len, MAXLINE - len, input) == NULL) { /* append the missing newline */ - tline[len+0] = '\n'; - tline[len+1] = '\0'; - cp++; + strcpy(tline + len, newline); + cp += strlen(newline); linestate = LS_START; } else { linestate = LS_DIRTY; @@ -947,11 +960,16 @@ skipcomment(const char *cp) } while (*cp != '\0') /* don't reset to LS_START after a line continuation */ - if (strncmp(cp, "\\\n", 2) == 0) + if (strncmp(cp, "\\\r\n", 3) == 0) + cp += 3; + else if (strncmp(cp, "\\\n", 2) == 0) cp += 2; else switch (incomment) { case NO_COMMENT: - if (strncmp(cp, "/\\\n", 3) == 0) { + if (strncmp(cp, "/\\\r\n", 4) == 0) { + incomment = STARTING_COMMENT; + cp += 4; + } else if (strncmp(cp, "/\\\n", 3) == 0) { incomment = STARTING_COMMENT; cp += 3; } else if (strncmp(cp, "/*", 2) == 0) { @@ -971,7 +989,7 @@ skipcomment(const char *cp) } else if (strncmp(cp, "\n", 1) == 0) { linestate = LS_START; cp += 1; - } else if (strchr(" \t", *cp) != NULL) { + } else if (strchr(" \r\t", *cp) != NULL) { cp += 1; } else return (cp); @@ -1003,7 +1021,10 @@ skipcomment(const char *cp) cp += 1; continue; case C_COMMENT: - if (strncmp(cp, "*\\\n", 3) == 0) { + if (strncmp(cp, "*\\\r\n", 4) == 0) { + incomment = FINISHING_COMMENT; + cp += 4; + } else if (strncmp(cp, "*\\\n", 3) == 0) { incomment = FINISHING_COMMENT; cp += 3; } else if (strncmp(cp, "*/", 2) == 0) { @@ -1124,7 +1145,7 @@ addsym(bool ignorethis, bool definethis, value[symind] = val+1; *val = '\0'; } else if (*val == '\0') - value[symind] = ""; + value[symind] = "1"; else usage(); } else { From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 17:37:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C93F1065670; Fri, 19 Feb 2010 17:37:47 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BCCA8FC16; Fri, 19 Feb 2010 17:37: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 o1JHblF2052638; Fri, 19 Feb 2010 17:37:47 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JHbld8052637; Fri, 19 Feb 2010 17:37:47 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201002191737.o1JHbld8052637@svn.freebsd.org> From: Alexander Kabaev Date: Fri, 19 Feb 2010 17:37: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: r204093 - head/sys/mips/atheros X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 17:37:47 -0000 Author: kan Date: Fri Feb 19 17:37:46 2010 New Revision: 204093 URL: http://svn.freebsd.org/changeset/base/204093 Log: Define DMA_RX_STATUS_OVERFLOW with correct value. The RX overflow is reported in bit 2 on real hardware and Linux driver for the same device already has this defined correctly. This fixes frequent interrupt storms seen on RouterStation Pro boards. Discussed with: gonzo Modified: head/sys/mips/atheros/ar71xxreg.h Modified: head/sys/mips/atheros/ar71xxreg.h ============================================================================== --- head/sys/mips/atheros/ar71xxreg.h Fri Feb 19 16:54:51 2010 (r204092) +++ head/sys/mips/atheros/ar71xxreg.h Fri Feb 19 17:37:46 2010 (r204093) @@ -403,9 +403,9 @@ #define AR71XX_DMA_RX_STATUS 0x194 #define DMA_RX_STATUS_PCOUNT_MASK 0xff #define DMA_RX_STATUS_PCOUNT_SHIFT 16 -#define DMA_RX_STATUS_BUS_ERROR (1 << 3) -#define DMA_RX_STATUS_OVERFLOW (1 << 1) -#define DMA_RX_STATUS_PKT_RECVD (1 << 0) +#define DMA_RX_STATUS_BUS_ERROR (1 << 3) +#define DMA_RX_STATUS_OVERFLOW (1 << 2) +#define DMA_RX_STATUS_PKT_RECVD (1 << 0) #define AR71XX_DMA_INTR 0x198 #define AR71XX_DMA_INTR_STATUS 0x19C #define DMA_INTR_ALL ((1 << 8) - 1) From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 18:00:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13A42106566C; Fri, 19 Feb 2010 18:00:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD38F8FC17; Fri, 19 Feb 2010 18:00: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 o1JI0cak057946; Fri, 19 Feb 2010 18:00:38 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JI0cDY057943; Fri, 19 Feb 2010 18:00:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201002191800.o1JI0cDY057943@svn.freebsd.org> From: Michael Tuexen Date: Fri, 19 Feb 2010 18:00: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: r204096 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 18:00:39 -0000 Author: tuexen Date: Fri Feb 19 18:00:38 2010 New Revision: 204096 URL: http://svn.freebsd.org/changeset/base/204096 Log: * Fix another u_long -> uint32_t issue. * Remove an unused global variable. * Fix an issue reported by Bruce Cran related to reusing SCTP socket which where connected. MFC after: 1 week Modified: head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Fri Feb 19 17:54:03 2010 (r204095) +++ head/sys/netinet/sctp_usrreq.c Fri Feb 19 18:00:38 2010 (r204096) @@ -980,7 +980,9 @@ sctp_shutdown(struct socket *so) /* For UDP model this is a invalid call */ if (inp->sctp_flags & SCTP_PCB_FLAGS_UDPTYPE) { /* Restore the flags that the soshutdown took away. */ + SOCKBUF_LOCK(&so->so_rcv); so->so_rcv.sb_state &= ~SBS_CANTRCVMORE; + SOCKBUF_UNLOCK(&so->so_rcv); /* This proc will wakeup for read and do nothing (I hope) */ SCTP_INP_RUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EOPNOTSUPP); @@ -4465,6 +4467,15 @@ sctp_connect(struct socket *so, struct s if (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) { stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; /* Set the connected flag so we can queue data */ + SOCKBUF_LOCK(&so->so_rcv); + so->so_rcv.sb_state &= ~SBS_CANTRCVMORE; + SOCKBUF_UNLOCK(&so->so_rcv); + SOCKBUF_LOCK(&so->so_snd); + so->so_snd.sb_state &= ~SBS_CANTSENDMORE; + SOCKBUF_UNLOCK(&so->so_snd); + SOCK_LOCK(so); + so->so_state &= ~SS_ISDISCONNECTING; + SOCK_UNLOCK(so); soisconnecting(so); } SCTP_SET_STATE(&stcb->asoc, SCTP_STATE_COOKIE_WAIT); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Fri Feb 19 17:54:03 2010 (r204095) +++ head/sys/netinet/sctputil.c Fri Feb 19 18:00:38 2010 (r204096) @@ -849,7 +849,7 @@ retry: uint32_t sctp_select_a_tag(struct sctp_inpcb *inp, uint16_t lport, uint16_t rport, int save_in_twait) { - u_long x, not_done; + uint32_t x, not_done; struct timeval now; (void)SCTP_GETTIME_TIMEVAL(&now); @@ -2751,8 +2751,6 @@ sctp_pad_lastmbuf(struct mbuf *m, int pa return (EFAULT); } -int sctp_asoc_change_wake = 0; - static void sctp_notify_assoc_change(uint32_t event, struct sctp_tcb *stcb, uint32_t error, void *data, int so_locked @@ -2806,7 +2804,6 @@ sctp_notify_assoc_change(uint32_t event, SCTP_SOCKET_UNLOCK(so, 1); } #endif - sctp_asoc_change_wake++; } if (sctp_is_feature_off(stcb->sctp_ep, SCTP_PCB_FLAGS_RECVASSOCEVNT)) { /* event not enabled */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 18:23:46 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62039106568B; Fri, 19 Feb 2010 18:23:46 +0000 (UTC) (envelope-from deischen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 505908FC14; Fri, 19 Feb 2010 18:23: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 o1JINk8E063256; Fri, 19 Feb 2010 18:23:46 GMT (envelope-from deischen@svn.freebsd.org) Received: (from deischen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JINki9063254; Fri, 19 Feb 2010 18:23:46 GMT (envelope-from deischen@svn.freebsd.org) Message-Id: <201002191823.o1JINki9063254@svn.freebsd.org> From: Daniel Eischen Date: Fri, 19 Feb 2010 18:23: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: r204100 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 18:23:46 -0000 Author: deischen Date: Fri Feb 19 18:23:45 2010 New Revision: 204100 URL: http://svn.freebsd.org/changeset/base/204100 Log: Correct spelling of reseting (found while researching the "bb hang detected" messages that are plaguing me). While I'm here, delete trailing whitespace. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Feb 19 18:15:45 2010 (r204099) +++ head/sys/dev/ath/if_ath.c Fri Feb 19 18:23:45 2010 (r204100) @@ -42,9 +42,9 @@ __FBSDID("$FreeBSD$"); #include "opt_wlan.h" #include -#include +#include #include -#include +#include #include #include #include @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include - + #include #include #include @@ -81,7 +81,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef INET -#include +#include #include #endif @@ -467,7 +467,7 @@ ath_attach(u_int16_t devid, struct ath_s /* * Allocate hardware transmit queues: one queue for * beacon frames and one data queue for each QoS - * priority. Note that the hal handles reseting + * priority. Note that the hal handles resetting * these queues at the needed time. * * XXX PS-Poll @@ -758,7 +758,7 @@ ath_detach(struct ath_softc *sc) DPRINTF(sc, ATH_DEBUG_ANY, "%s: if_flags %x\n", __func__, ifp->if_flags); - /* + /* * NB: the order of these is important: * o stop the chip so no more interrupts will fire * o call the 802.11 layer before detaching the hal to @@ -1475,7 +1475,7 @@ ath_bmiss_proc(void *arg, int pending) DPRINTF(sc, ATH_DEBUG_ANY, "%s: pending %u\n", __func__, pending); if (ath_hal_gethangstate(sc->sc_ah, 0xff, &hangs) && hangs != 0) { - if_printf(ifp, "bb hang detected (0x%x), reseting\n", hangs); + if_printf(ifp, "bb hang detected (0x%x), resetting\n", hangs); ath_reset(ifp); } else ieee80211_beacon_miss(ifp->if_l2com); @@ -1838,7 +1838,7 @@ ath_start(struct ifnet *ifp) * go out or none... */ STAILQ_INIT(&frags); - if ((m->m_flags & M_FRAG) && + if ((m->m_flags & M_FRAG) && !ath_txfrag_setup(sc, &frags, m, ni)) { DPRINTF(sc, ATH_DEBUG_XMIT, "%s: out of txfrag buffers\n", __func__); @@ -3356,7 +3356,7 @@ ath_descdma_setup(struct ath_softc *sc, } error = bus_dmamem_alloc(dd->dd_dmat, (void**) &dd->dd_desc, - BUS_DMA_NOWAIT | BUS_DMA_COHERENT, + BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &dd->dd_dmamap); if (error != 0) { if_printf(ifp, "unable to alloc memory for %u %s descriptors, " @@ -3792,7 +3792,7 @@ ath_rx_proc(void *arg, int npending) /* * If mbuf allocation failed previously there * will be no mbuf; try again to re-populate it. - */ + */ /* XXX make debug msg */ if_printf(ifp, "%s: no mbuf!\n", __func__); STAILQ_REMOVE_HEAD(&sc->sc_rxbuf, bf_list); @@ -3863,7 +3863,7 @@ ath_rx_proc(void *arg, int npending) bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_POSTREAD); - ath_handle_micerror(ic, + ath_handle_micerror(ic, mtod(m, struct ieee80211_frame *), sc->sc_splitmic ? rs->rs_keyix-32 : rs->rs_keyix); @@ -4040,7 +4040,7 @@ rx_accept: */ if (type == IEEE80211_FC0_TYPE_DATA) { const HAL_RATE_TABLE *rt = sc->sc_currates; - ath_led_event(sc, + ath_led_event(sc, rt->rateCodeToIndex[rs->rs_rate]); } else if (ticks - sc->sc_ledevent >= sc->sc_ledidle) ath_led_event(sc, 0); @@ -5322,7 +5322,7 @@ ath_startrecv(struct ath_softc *sc) return 0; } -/* +/* * Update internal state after a channel change. */ static void @@ -5342,7 +5342,7 @@ ath_chan_change(struct ath_softc *sc, st /* * Set/change channels. If the channel is really being changed, - * it's done by reseting the chip. To accomplish this we must + * it's done by resetting the chip. To accomplish this we must * first cleanup any pending DMA, then restart stuff after a la * ath_init. */ @@ -5541,7 +5541,7 @@ ath_set_channel(struct ieee80211com *ic) sc->sc_syncbeacon = 1; } -/* +/* * Walk the vap list and check if there any vap's in RUN state. */ static int @@ -5803,7 +5803,7 @@ ath_newassoc(struct ieee80211_node *ni, an->an_mgmtrix = ath_tx_findrix(sc, tp->mgmtrate); ath_rate_newassoc(sc, an, isnew); - if (isnew && + if (isnew && (vap->iv_flags & IEEE80211_F_PRIVACY) == 0 && sc->sc_hasclrkey && ni->ni_ucastkey.wk_keyix == IEEE80211_KEYIX_NONE) ath_setup_stationkey(ni); @@ -6048,7 +6048,7 @@ ath_setcurmode(struct ath_softc *sc, enu sc->sc_protrix = ath_tx_findrix(sc, 2*2); else sc->sc_protrix = ath_tx_findrix(sc, 2*1); - /* NB: caller is responsible for reseting rate control state */ + /* NB: caller is responsible for resetting rate control state */ #undef N } @@ -6123,7 +6123,7 @@ ath_watchdog(void *arg) if (ath_hal_gethangstate(sc->sc_ah, 0xffff, &hangs) && hangs != 0) { if_printf(ifp, "%s hang detected (0x%x)\n", - hangs & 0xff ? "bb" : "mac", hangs); + hangs & 0xff ? "bb" : "mac", hangs); } else if_printf(ifp, "device timeout\n"); ath_reset(ifp); @@ -6804,7 +6804,7 @@ ath_tx_raw_start(struct ath_softc *sc, s if (IFF_DUMPPKTS(sc, ATH_DEBUG_XMIT)) ieee80211_dump_pkt(ic, mtod(m0, caddr_t), m0->m_len, sc->sc_hwmap[rix].ieeerate, -1); - + if (ieee80211_radiotap_active_vap(vap)) { u_int64_t tsf = ath_hal_gettsf64(ah); From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 20:18:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4ED881065672; Fri, 19 Feb 2010 20:18:17 +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 2433C8FC15; Fri, 19 Feb 2010 20: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 o1JKIHEg088416; Fri, 19 Feb 2010 20:18:17 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JKIHta088414; Fri, 19 Feb 2010 20:18:17 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201002192018.o1JKIHta088414@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 19 Feb 2010 20: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: r204101 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 20:18:17 -0000 Author: pjd Date: Fri Feb 19 20:18:16 2010 New Revision: 204101 URL: http://svn.freebsd.org/changeset/base/204101 Log: Don't set f_bsize to recordsize. It might confuse some software (like squid). Submitted by: Alexander Zagrebin MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Feb 19 18:23:45 2010 (r204100) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Feb 19 20:18:16 2010 (r204101) @@ -214,7 +214,7 @@ blksz_changed_cb(void *arg, uint64_t new newval = SPA_MAXBLOCKSIZE; zfsvfs->z_max_blksz = newval; - zfsvfs->z_vfs->vfs_bsize = newval; + zfsvfs->z_vfs->mnt_stat.f_iosize = newval; } static void @@ -577,7 +577,8 @@ zfs_domount(vfs_t *vfsp, char *osname) if (error = dsl_prop_get_integer(osname, "recordsize", &recordsize, NULL)) goto out; - zfsvfs->z_vfs->vfs_bsize = recordsize; + zfsvfs->z_vfs->vfs_bsize = SPA_MINBLOCKSIZE; + zfsvfs->z_vfs->mnt_stat.f_iosize = recordsize; vfsp->vfs_data = zfsvfs; vfsp->mnt_flag |= MNT_LOCAL; @@ -817,8 +818,8 @@ zfs_statfs(vfs_t *vfsp, struct statfs *s * We report the fragsize as the smallest block size we support, * and we report our blocksize as the filesystem's maximum blocksize. */ - statp->f_bsize = zfsvfs->z_vfs->vfs_bsize; - statp->f_iosize = zfsvfs->z_vfs->vfs_bsize; + statp->f_bsize = SPA_MINBLOCKSIZE; + statp->f_iosize = zfsvfs->z_vfs->mnt_stat.f_iosize; /* * The following report "total" blocks of various kinds in the @@ -826,7 +827,7 @@ zfs_statfs(vfs_t *vfsp, struct statfs *s * "fragment" size. */ - statp->f_blocks = (refdbytes + availbytes) / statp->f_bsize; + statp->f_blocks = (refdbytes + availbytes) >> SPA_MINBLOCKSHIFT; statp->f_bfree = availbytes / statp->f_bsize; statp->f_bavail = statp->f_bfree; /* no root reservation */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 21:11:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60A1C106566B; Fri, 19 Feb 2010 21:11:41 +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 370B08FC15; Fri, 19 Feb 2010 21: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 o1JLBfun000288; Fri, 19 Feb 2010 21:11:41 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JLBfDA000286; Fri, 19 Feb 2010 21:11:41 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002192111.o1JLBfDA000286@svn.freebsd.org> From: Marius Strobl Date: Fri, 19 Feb 2010 21:11: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: r204102 - head/sys/modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 21:11:41 -0000 Author: marius Date: Fri Feb 19 21:11:40 2010 New Revision: 204102 URL: http://svn.freebsd.org/changeset/base/204102 Log: Hook up nfs_common missed in r203968. Submitted by: kib Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Feb 19 20:18:16 2010 (r204101) +++ head/sys/modules/Makefile Fri Feb 19 21:11:40 2010 (r204102) @@ -194,6 +194,7 @@ SUBDIR= ${_3dfx} \ ${_ndis} \ ${_netgraph} \ ${_nfe} \ + nfs_common \ nfscl \ nfsclient \ nfscommon \ From owner-svn-src-head@FreeBSD.ORG Fri Feb 19 23:54:13 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B3DB106566C; Fri, 19 Feb 2010 23:54:13 +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 ED4528FC08; Fri, 19 Feb 2010 23:54: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 o1JNsCva035891; Fri, 19 Feb 2010 23:54:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JNsCZJ035886; Fri, 19 Feb 2010 23:54:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002192354.o1JNsCZJ035886@svn.freebsd.org> From: Xin LI Date: Fri, 19 Feb 2010 23:54: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: r204103 - in head/usr.bin: . seq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 23:54:13 -0000 Author: delphij Date: Fri Feb 19 23:54:12 2010 New Revision: 204103 URL: http://svn.freebsd.org/changeset/base/204103 Log: Add seq(1), a small utility to generate sequence number. Obtained from: NetBSD MFC after: 3 months Added: head/usr.bin/seq/ head/usr.bin/seq/Makefile (contents, props changed) head/usr.bin/seq/seq.1 (contents, props changed) head/usr.bin/seq/seq.c (contents, props changed) Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Fri Feb 19 21:11:40 2010 (r204102) +++ head/usr.bin/Makefile Fri Feb 19 23:54:12 2010 (r204103) @@ -172,6 +172,7 @@ SUBDIR= alias \ ${_rwho} \ script \ sed \ + seq \ shar \ showmount \ ${_smbutil} \ Added: head/usr.bin/seq/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/seq/Makefile Fri Feb 19 23:54:12 2010 (r204103) @@ -0,0 +1,8 @@ +# $NetBSD: Makefile,v 1.3 2009/04/14 22:15:26 lukem Exp $ +# $FreeBSD$ + +PROG= seq +DPADD= ${LIBM} +LDADD= -lm + +.include Added: head/usr.bin/seq/seq.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/seq/seq.1 Fri Feb 19 23:54:12 2010 (r204103) @@ -0,0 +1,187 @@ +.\" $NetBSD: seq.1,v 1.6 2008/11/26 15:03:47 ginsbach Exp $ +.\" +.\" Copyright (c) 2005 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to The NetBSD Foundation +.\" by Brian Ginsbach. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 19, 2010 +.Dt SEQ 1 +.Os +.Sh NAME +.Nm seq +.Nd print sequences of numbers +.Sh SYNOPSIS +.Nm +.Op Fl w +.Op Fl f Ar format +.Op Fl s Ar string +.Op Fl t Ar string +.Op Ar first Op Ar incr +.Ar last +.Sh DESCRIPTION +The +.Nm +utility prints a sequence of numbers, one per line +.Pq default , +from +.Ar first +.Pq default 1 , +to near +.Ar last +as possible, in increments of +.Ar incr +.Pq default 1 . +When +.Ar first +is larger than +.Ar last +the default +.Ar incr +is -1. +.Pp +All numbers are interpreted as floating point. +.Pp +Normally integer values are printed as decimal integers. +.Pp +The +.Nm +utility accepts the following options: +.Bl -tag -width Ar +.It Fl f Ar format +Use a +.Xr printf 3 +style +.Ar format +to print each number. +Only the +.Cm E , +.Cm e , +.Cm f , +.Cm G , +.Cm g , +and +.Cm % +conversion characters are valid, along with any optional +flags and an optional numeric minimum field width or precision. +The +.Ar format +can contain character escape sequences in backslash notation as +defined in +.St -ansiC . +The default is +.Cm %g . +.It Fl s Ar string +Use +.Ar string +to separate numbers. +The +.Ar string +can contain character escape sequences in backslash notation as +defined in +.St -ansiC . +The default is +.Cm \en . +.It Fl t Ar string +Use +.Ar string +to terminate sequence of numbers. +The +.Ar string +can contain character escape sequences in backslash notation as +defined in +.St -ansiC . +This option is useful when the default separator +does not contain a +.Cm \en . +.It Fl w +Equalize the widths of all numbers by padding with zeros as necessary. +This option has no effect with the +.Fl f +option. +If any sequence numbers will be printed in exponential notation, +the default conversion is changed to +.Cm %e . +.El +.Pp +The +.Nm +utility exits 0 on success and non-zero if an error occurs. +.Sh EXAMPLES +.Bd -literal -offset indent +# seq 1 3 +1 +2 +3 + +# seq 3 1 +3 +2 +1 + +# seq -w 0 .05 .1 +0.00 +0.05 +0.10 +.Ed +.Sh SEE ALSO +.Xr jot 1 , +.Xr printf 1 , +.Xr printf 3 +.Sh HISTORY +The +.Nm +command first appeared in +.Tn "Plan 9 from Bell Labs" . +A +.Nm +command appeared in +.Nx 3.0 , +and ported to +.Fx 9.0 . +This command was based on the command of the same name in +.Tn "Plan 9 from Bell Labs" +and the +.Tn GNU +core utilities. +The +.Tn GNU +.Nm +command first appeared in the 1.13 shell utilities release. +.Sh BUGS +The +.Fl w +option does not handle the transition from pure floating point +to exponent representation very well. +The +.Nm +command is not bug for bug compatible with the +.Tn "Plan 9 from Bell Labs" +or +.Tn GNU +versions of +.Nm . Added: head/usr.bin/seq/seq.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/seq/seq.c Fri Feb 19 23:54:12 2010 (r204103) @@ -0,0 +1,452 @@ +/* $NetBSD: seq.c,v 1.5 2008/07/21 14:19:26 lukem Exp $ */ +/* + * Copyright (c) 2005 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Brian Ginsbach. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define ZERO '0' +#define SPACE ' ' + +#define MAX(a, b) (((a) < (b))? (b) : (a)) +#define ISSIGN(c) ((int)(c) == '-' || (int)(c) == '+') +#define ISEXP(c) ((int)(c) == 'e' || (int)(c) == 'E') +#define ISODIGIT(c) ((int)(c) >= '0' && (int)(c) <= '7') + +/* Globals */ + +const char *decimal_point = "."; /* default */ +char default_format[] = { "%g" }; /* default */ + +/* Prototypes */ + +double e_atof(const char *); + +int decimal_places(const char *); +int main(int, char *[]); +int numeric(const char *); +int valid_format(const char *); + +char *generate_format(double, double, double, int, char); +char *unescape(char *); + +/* + * The seq command will print out a numeric sequence from 1, the default, + * to a user specified upper limit by 1. The lower bound and increment + * maybe indicated by the user on the command line. The sequence can + * be either whole, the default, or decimal numbers. + */ +int +main(int argc, char *argv[]) +{ + int c = 0, errflg = 0; + int equalize = 0; + double first = 1.0; + double last = 0.0; + double incr = 0.0; + struct lconv *locale; + char *fmt = NULL; + const char *sep = "\n"; + const char *term = NULL; + char pad = ZERO; + + /* Determine the locale's decimal point. */ + locale = localeconv(); + if (locale && locale->decimal_point && locale->decimal_point[0] != '\0') + decimal_point = locale->decimal_point; + + /* + * Process options, but handle negative numbers separately + * least they trip up getopt(3). + */ + while ((optind < argc) && !numeric(argv[optind]) && + (c = getopt(argc, argv, "f:hs:t:w")) != -1) { + + switch (c) { + case 'f': /* format (plan9) */ + fmt = optarg; + equalize = 0; + break; + case 's': /* separator (GNU) */ + sep = unescape(optarg); + break; + case 't': /* terminator (new) */ + term = unescape(optarg); + break; + case 'w': /* equal width (plan9) */ + if (!fmt) + if (equalize++) + pad = SPACE; + break; + case 'h': /* help (GNU) */ + default: + errflg++; + break; + } + } + + argc -= optind; + argv += optind; + if (argc < 1 || argc > 3) + errflg++; + + if (errflg) { + fprintf(stderr, + "usage: %s [-w] [-f format] [-s string] [-t string] [first [incr]] last\n", + getprogname()); + exit(1); + } + + last = e_atof(argv[argc - 1]); + + if (argc > 1) + first = e_atof(argv[0]); + + if (argc > 2) { + incr = e_atof(argv[1]); + /* Plan 9/GNU don't do zero */ + if (incr == 0.0) + errx(1, "zero %screment", (first < last)? "in" : "de"); + } + + /* default is one for Plan 9/GNU work alike */ + if (incr == 0.0) + incr = (first < last) ? 1.0 : -1.0; + + if (incr <= 0.0 && first < last) + errx(1, "needs positive increment"); + + if (incr >= 0.0 && first > last) + errx(1, "needs negative decrement"); + + if (fmt != NULL) { + if (!valid_format(fmt)) + errx(1, "invalid format string: `%s'", fmt); + fmt = unescape(fmt); + /* + * XXX to be bug for bug compatible with Plan 9 add a + * newline if none found at the end of the format string. + */ + } else + fmt = generate_format(first, incr, last, equalize, pad); + + if (incr > 0) { + for (; first <= last; first += incr) { + printf(fmt, first); + fputs(sep, stdout); + } + } else { + for (; first >= last; first += incr) { + printf(fmt, first); + fputs(sep, stdout); + } + } + if (term != NULL) + fputs(term, stdout); + + return (0); +} + +/* + * numeric - verify that string is numeric + */ +int +numeric(const char *s) +{ + int seen_decimal_pt, decimal_pt_len; + + /* skip any sign */ + if (ISSIGN((unsigned char)*s)) + s++; + + seen_decimal_pt = 0; + decimal_pt_len = strlen(decimal_point); + while (*s) { + if (!isdigit((unsigned char)*s)) { + if (!seen_decimal_pt && + strncmp(s, decimal_point, decimal_pt_len) == 0) { + s += decimal_pt_len; + seen_decimal_pt = 1; + continue; + } + if (ISEXP((unsigned char)*s)) { + s++; + if (ISSIGN((unsigned char)*s)) { + s++; + continue; + } + } + break; + } + s++; + } + return (*s == '\0'); +} + +/* + * valid_format - validate user specified format string + */ +int +valid_format(const char *fmt) +{ + int conversions = 0; + + while (*fmt != '\0') { + /* scan for conversions */ + if (*fmt != '\0' && *fmt != '%') { + do { + fmt++; + } while (*fmt != '\0' && *fmt != '%'); + } + /* scan a conversion */ + if (*fmt != '\0') { + do { + fmt++; + + /* ok %% */ + if (*fmt == '%') { + fmt++; + break; + } + /* valid conversions */ + if (strchr("eEfgG", *fmt) && + conversions++ < 1) { + fmt++; + break; + } + /* flags, width and precsision */ + if (isdigit((unsigned char)*fmt) || + strchr("+- 0#.", *fmt)) + continue; + + /* oops! bad conversion format! */ + return (0); + } while (*fmt != '\0'); + } + } + + return (conversions <= 1); +} + +/* + * unescape - handle C escapes in a string + */ +char * +unescape(char *orig) +{ + char c, *cp, *new = orig; + int i; + + for (cp = orig; (*orig = *cp); cp++, orig++) { + if (*cp != '\\') + continue; + + switch (*++cp) { + case 'a': /* alert (bell) */ + *orig = '\a'; + continue; + case 'b': /* backspace */ + *orig = '\b'; + continue; + case 'e': /* escape */ + *orig = '\e'; + continue; + case 'f': /* formfeed */ + *orig = '\f'; + continue; + case 'n': /* newline */ + *orig = '\n'; + continue; + case 'r': /* carriage return */ + *orig = '\r'; + continue; + case 't': /* horizontal tab */ + *orig = '\t'; + continue; + case 'v': /* vertical tab */ + *orig = '\v'; + continue; + case '\\': /* backslash */ + *orig = '\\'; + continue; + case '\'': /* single quote */ + *orig = '\''; + continue; + case '\"': /* double quote */ + *orig = '"'; + continue; + case '0': + case '1': + case '2': + case '3': /* octal */ + case '4': + case '5': + case '6': + case '7': /* number */ + for (i = 0, c = 0; + ISODIGIT((unsigned char)*cp) && i < 3; + i++, cp++) { + c <<= 3; + c |= (*cp - '0'); + } + *orig = c; + --cp; + continue; + case 'x': /* hexidecimal number */ + cp++; /* skip 'x' */ + for (i = 0, c = 0; + isxdigit((unsigned char)*cp) && i < 2; + i++, cp++) { + c <<= 4; + if (isdigit((unsigned char)*cp)) + c |= (*cp - '0'); + else + c |= ((toupper((unsigned char)*cp) - + 'A') + 10); + } + *orig = c; + --cp; + continue; + default: + --cp; + break; + } + } + + return (new); +} + +/* + * e_atof - convert an ASCII string to a double + * exit if string is not a valid double, or if converted value would + * cause overflow or underflow + */ +double +e_atof(const char *num) +{ + char *endp; + double dbl; + + errno = 0; + dbl = strtod(num, &endp); + + if (errno == ERANGE) + /* under or overflow */ + err(2, "%s", num); + else if (*endp != '\0') + /* "junk" left in number */ + errx(2, "invalid floating point argument: %s", num); + + /* zero shall have no sign */ + if (dbl == -0.0) + dbl = 0; + return (dbl); +} + +/* + * decimal_places - count decimal places in a number (string) + */ +int +decimal_places(const char *number) +{ + int places = 0; + char *dp; + + /* look for a decimal point */ + if ((dp = strstr(number, decimal_point))) { + dp += strlen(decimal_point); + + while (isdigit((unsigned char)*dp++)) + places++; + } + return (places); +} + +/* + * generate_format - create a format string + * + * XXX to be bug for bug compatable with Plan9 and GNU return "%g" + * when "%g" prints as "%e" (this way no width adjustments are made) + */ +char * +generate_format(double first, double incr, double last, int equalize, char pad) +{ + static char buf[256]; + char cc = '\0'; + int precision, width1, width2, places; + + if (equalize == 0) + return (default_format); + + /* figure out "last" value printed */ + if (first > last) + last = first - incr * floor((first - last) / incr); + else + last = first + incr * floor((last - first) / incr); + + sprintf(buf, "%g", incr); + if (strchr(buf, 'e')) + cc = 'e'; + precision = decimal_places(buf); + + width1 = sprintf(buf, "%g", first); + if (strchr(buf, 'e')) + cc = 'e'; + if ((places = decimal_places(buf))) + width1 -= (places + strlen(decimal_point)); + + precision = MAX(places, precision); + + width2 = sprintf(buf, "%g", last); + if (strchr(buf, 'e')) + cc = 'e'; + if ((places = decimal_places(buf))) + width2 -= (places + strlen(decimal_point)); + + if (precision) { + sprintf(buf, "%%%c%d.%d%c", pad, + MAX(width1, width2) + (int) strlen(decimal_point) + + precision, precision, (cc) ? cc : 'f'); + } else { + sprintf(buf, "%%%c%d%c", pad, MAX(width1, width2), + (cc) ? cc : 'g'); + } + + return (buf); +} From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 00:16:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B3191065670; Sat, 20 Feb 2010 00:16:45 +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 1AEB58FC08; Sat, 20 Feb 2010 00:16: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 o1K0Gisa040896; Sat, 20 Feb 2010 00:16:44 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1K0GiLW040894; Sat, 20 Feb 2010 00:16:44 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002200016.o1K0GiLW040894@svn.freebsd.org> From: Xin LI Date: Sat, 20 Feb 2010 00:16: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: r204104 - head/usr.bin/jot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 00:16:45 -0000 Author: delphij Date: Sat Feb 20 00:16:44 2010 New Revision: 204104 URL: http://svn.freebsd.org/changeset/base/204104 Log: Add a reference to newly added seq(1) command. Submitted by: jilles MFC after: 3 months Modified: head/usr.bin/jot/jot.1 Modified: head/usr.bin/jot/jot.1 ============================================================================== --- head/usr.bin/jot/jot.1 Fri Feb 19 23:54:12 2010 (r204103) +++ head/usr.bin/jot/jot.1 Sat Feb 20 00:16:44 2010 (r204104) @@ -32,7 +32,7 @@ .\" @(#)jot.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd November 6, 2006 +.Dd February 19, 2010 .Dt JOT 1 .Os .Sh NAME @@ -239,6 +239,7 @@ but only one is allowed. .Xr ed 1 , .Xr expand 1 , .Xr rs 1 , +.Xr seq 1 , .Xr yes 1 , .Xr arc4random 3 , .Xr printf 3 , From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 00:19:21 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA14B106566B; Sat, 20 Feb 2010 00:19:21 +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 C9F1F8FC0A; Sat, 20 Feb 2010 00:19: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 o1K0JLMd041484; Sat, 20 Feb 2010 00:19:21 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1K0JLUQ041482; Sat, 20 Feb 2010 00:19:21 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201002200019.o1K0JLUQ041482@svn.freebsd.org> From: Jung-uk Kim Date: Sat, 20 Feb 2010 00:19: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: r204105 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 00:19:21 -0000 Author: jkim Date: Sat Feb 20 00:19:21 2010 New Revision: 204105 URL: http://svn.freebsd.org/changeset/base/204105 Log: Return partially filled buffer for non-blocking read(2) in non-immediate mode. PR: kern/143855 Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Sat Feb 20 00:16:44 2010 (r204104) +++ head/sys/net/bpf.c Sat Feb 20 00:19:21 2010 (r204105) @@ -664,8 +664,9 @@ static int bpfread(struct cdev *dev, struct uio *uio, int ioflag) { struct bpf_d *d; - int timed_out; int error; + int non_block; + int timed_out; error = devfs_get_cdevpriv((void **)&d); if (error != 0) @@ -678,6 +679,8 @@ bpfread(struct cdev *dev, struct uio *ui if (uio->uio_resid != d->bd_bufsize) return (EINVAL); + non_block = ((ioflag & O_NONBLOCK) != 0); + BPFD_LOCK(d); d->bd_pid = curthread->td_proc->p_pid; if (d->bd_bufmode != BPF_BUFMODE_BUFFER) { @@ -694,14 +697,20 @@ bpfread(struct cdev *dev, struct uio *ui * have arrived to fill the store buffer. */ while (d->bd_hbuf == NULL) { - if ((d->bd_immediate || timed_out) && d->bd_slen != 0) { + if (d->bd_slen != 0) { /* * A packet(s) either arrived since the previous * read or arrived while we were asleep. - * Rotate the buffers and return what's here. */ - ROTATE_BUFFERS(d); - break; + if (d->bd_immediate || non_block || timed_out) { + /* + * Rotate the buffers and return what's here + * if we are in immediate mode, non-blocking + * flag is set, or this descriptor timed out. + */ + ROTATE_BUFFERS(d); + break; + } } /* @@ -715,7 +724,7 @@ bpfread(struct cdev *dev, struct uio *ui return (ENXIO); } - if (ioflag & O_NONBLOCK) { + if (non_block) { BPFD_UNLOCK(d); return (EWOULDBLOCK); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 01:05:30 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97347106566C; Sat, 20 Feb 2010 01:05:30 +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 865C98FC0A; Sat, 20 Feb 2010 01:05:30 +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 o1K15UEH051697; Sat, 20 Feb 2010 01:05:30 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1K15U3L051695; Sat, 20 Feb 2010 01:05:30 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201002200105.o1K15U3L051695@svn.freebsd.org> From: Ed Maste Date: Sat, 20 Feb 2010 01:05: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: r204106 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 01:05:30 -0000 Author: emaste Date: Sat Feb 20 01:05:30 2010 New Revision: 204106 URL: http://svn.freebsd.org/changeset/base/204106 Log: Avoid corrupting the list or queue if _REMOVE is invoked with a reference to the head. PR: kern/119307 MFC After: 1 week Modified: head/sys/sys/queue.h Modified: head/sys/sys/queue.h ============================================================================== --- head/sys/sys/queue.h Sat Feb 20 00:19:21 2010 (r204105) +++ head/sys/sys/queue.h Sat Feb 20 01:05:30 2010 (r204106) @@ -112,6 +112,7 @@ struct qm_trace { #define TRACEBUF struct qm_trace trace; #define TRASHIT(x) do {(x) = (void *)-1;} while (0) +#define QMD_SAVELINK(name, link) void **name = (void *)&(link) #define QMD_TRACE_HEAD(head) do { \ (head)->trace.prevline = (head)->trace.lastline; \ @@ -130,6 +131,7 @@ struct qm_trace { #else #define QMD_TRACE_ELEM(elem) #define QMD_TRACE_HEAD(head) +#define QMD_SAVELINK(name, link) #define TRACEBUF #define TRASHIT(x) #endif /* QUEUE_MACRO_DEBUG */ @@ -189,6 +191,7 @@ struct { \ #define SLIST_NEXT(elm, field) ((elm)->field.sle_next) #define SLIST_REMOVE(head, elm, type, field) do { \ + QMD_SAVELINK(oldnext, (elm)->field.sle_next); \ if (SLIST_FIRST((head)) == (elm)) { \ SLIST_REMOVE_HEAD((head), field); \ } \ @@ -198,7 +201,7 @@ struct { \ curelm = SLIST_NEXT(curelm, field); \ SLIST_REMOVE_AFTER(curelm, field); \ } \ - TRASHIT((elm)->field.sle_next); \ + TRASHIT(*oldnext); \ } while (0) #define SLIST_REMOVE_AFTER(elm, field) do { \ @@ -285,6 +288,7 @@ struct { \ #define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) #define STAILQ_REMOVE(head, elm, type, field) do { \ + QMD_SAVELINK(oldnext, (elm)->field.stqe_next); \ if (STAILQ_FIRST((head)) == (elm)) { \ STAILQ_REMOVE_HEAD((head), field); \ } \ @@ -294,7 +298,7 @@ struct { \ curelm = STAILQ_NEXT(curelm, field); \ STAILQ_REMOVE_AFTER(head, curelm, field); \ } \ - TRASHIT((elm)->field.stqe_next); \ + TRASHIT(*oldnext); \ } while (0) #define STAILQ_REMOVE_HEAD(head, field) do { \ @@ -415,14 +419,16 @@ struct { \ #define LIST_NEXT(elm, field) ((elm)->field.le_next) #define LIST_REMOVE(elm, field) do { \ + QMD_SAVELINK(oldnext, (elm)->field.le_next); \ + QMD_SAVELINK(oldprev, (elm)->field.le_prev); \ QMD_LIST_CHECK_NEXT(elm, field); \ QMD_LIST_CHECK_PREV(elm, field); \ if (LIST_NEXT((elm), field) != NULL) \ LIST_NEXT((elm), field)->field.le_prev = \ (elm)->field.le_prev; \ *(elm)->field.le_prev = LIST_NEXT((elm), field); \ - TRASHIT((elm)->field.le_next); \ - TRASHIT((elm)->field.le_prev); \ + TRASHIT(*oldnext); \ + TRASHIT(*oldprev); \ } while (0) #define LIST_SWAP(head1, head2, type, field) do { \ @@ -587,6 +593,8 @@ struct { \ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) #define TAILQ_REMOVE(head, elm, field) do { \ + QMD_SAVELINK(oldnext, (elm)->field.tqe_next); \ + QMD_SAVELINK(oldprev, (elm)->field.tqe_prev); \ QMD_TAILQ_CHECK_NEXT(elm, field); \ QMD_TAILQ_CHECK_PREV(elm, field); \ if ((TAILQ_NEXT((elm), field)) != NULL) \ @@ -597,8 +605,8 @@ struct { \ QMD_TRACE_HEAD(head); \ } \ *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \ - TRASHIT((elm)->field.tqe_next); \ - TRASHIT((elm)->field.tqe_prev); \ + TRASHIT(*oldnext); \ + TRASHIT(*oldprev); \ QMD_TRACE_ELEM(&(elm)->field); \ } while (0) From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 01:23:16 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E82A1065679; Sat, 20 Feb 2010 01:23:16 +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 1E1E28FC0C; Sat, 20 Feb 2010 01:23: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 o1K1NFv7055602; Sat, 20 Feb 2010 01:23:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1K1NFv3055600; Sat, 20 Feb 2010 01:23:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002200123.o1K1NFv3055600@svn.freebsd.org> From: Xin LI Date: Sat, 20 Feb 2010 01:23: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: r204107 - head/usr.bin/seq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 01:23:16 -0000 Author: delphij Date: Sat Feb 20 01:23:15 2010 New Revision: 204107 URL: http://svn.freebsd.org/changeset/base/204107 Log: Treat numbers after [Ee] a positive number rather than an invalid one. Modified: head/usr.bin/seq/seq.c Modified: head/usr.bin/seq/seq.c ============================================================================== --- head/usr.bin/seq/seq.c Sat Feb 20 01:05:30 2010 (r204106) +++ head/usr.bin/seq/seq.c Sat Feb 20 01:23:15 2010 (r204107) @@ -207,7 +207,8 @@ numeric(const char *s) } if (ISEXP((unsigned char)*s)) { s++; - if (ISSIGN((unsigned char)*s)) { + if (ISSIGN((unsigned char)*s) || + isdigit((unsigned char)*s)) { s++; continue; } From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 03:19:55 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 18950106566B; Sat, 20 Feb 2010 03:19:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Fri, 19 Feb 2010 22:19:42 -0500 User-Agent: KMail/1.6.2 References: <201002200019.o1K0JLUQ041482@svn.freebsd.org> In-Reply-To: <201002200019.o1K0JLUQ041482@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201002192219.46977.jkim@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r204105 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 03:19:55 -0000 On Friday 19 February 2010 07:19 pm, Jung-uk Kim wrote: > Author: jkim > Date: Sat Feb 20 00:19:21 2010 > New Revision: 204105 > URL: http://svn.freebsd.org/changeset/base/204105 > > Log: > Return partially filled buffer for non-blocking read(2) > in non-immediate mode. > > PR: kern/143855 Submitted by: Guy Harris Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 06:39:14 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D9511065672; Sat, 20 Feb 2010 06:39:14 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C4358FC0C; Sat, 20 Feb 2010 06:39: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 o1K6dEgc024991; Sat, 20 Feb 2010 06:39:14 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1K6dEfn024981; Sat, 20 Feb 2010 06:39:14 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201002200639.o1K6dEfn024981@svn.freebsd.org> From: Neel Natu Date: Sat, 20 Feb 2010 06:39: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: r204108 - in head/sys: conf mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 06:39:14 -0000 Author: neel Date: Sat Feb 20 06:39:14 2010 New Revision: 204108 URL: http://svn.freebsd.org/changeset/base/204108 Log: Get rid of unused options: KERNPHYSADDR, KERNVIRTADDR, PHYSADDR, PHYS_ADDR_64BIT Discussed with: gonzo, imp Modified: head/sys/conf/options.mips head/sys/mips/conf/ADM5120 head/sys/mips/conf/MALTA head/sys/mips/conf/MALTA64 head/sys/mips/conf/OCTEON1 head/sys/mips/conf/OCTEON1-32 head/sys/mips/conf/QEMU head/sys/mips/conf/SWARM head/sys/mips/conf/XLR Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Sat Feb 20 01:23:15 2010 (r204107) +++ head/sys/conf/options.mips Sat Feb 20 06:39:14 2010 (r204108) @@ -48,10 +48,6 @@ CFE_CONSOLE opt_global.h CFE_ENV opt_global.h CFE_ENV_SIZE opt_global.h -KERNPHYSADDR opt_global.h -KERNVIRTADDR opt_global.h -PHYSADDR opt_global.h -PHYS_ADDR_64BIT opt_global.h NOFPU opt_global.h TARGET_OCTEON opt_global.h TARGET_EMULATOR opt_ddb.h Modified: head/sys/mips/conf/ADM5120 ============================================================================== --- head/sys/mips/conf/ADM5120 Sat Feb 20 01:23:15 2010 (r204107) +++ head/sys/mips/conf/ADM5120 Sat Feb 20 06:39:14 2010 (r204108) @@ -25,7 +25,6 @@ makeoptions MIPS_LITTLE_ENDIAN=defined # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" -options KERNVIRTADDR=0x80100000 include "../adm5120/std.adm5120" hints "ADM5120.hints" #Default places to look for devices. Modified: head/sys/mips/conf/MALTA ============================================================================== --- head/sys/mips/conf/MALTA Sat Feb 20 01:23:15 2010 (r204107) +++ head/sys/mips/conf/MALTA Sat Feb 20 06:39:14 2010 (r204108) @@ -28,7 +28,6 @@ options YAMON # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" -options KERNVIRTADDR=0x80100000 options TICK_USE_YAMON_FREQ=defined #options TICK_USE_MALTA_RTC=defined Modified: head/sys/mips/conf/MALTA64 ============================================================================== --- head/sys/mips/conf/MALTA64 Sat Feb 20 01:23:15 2010 (r204107) +++ head/sys/mips/conf/MALTA64 Sat Feb 20 06:39:14 2010 (r204108) @@ -29,7 +29,6 @@ options YAMON # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" -options KERNVIRTADDR=0x80100000 options TICK_USE_YAMON_FREQ=defined #options TICK_USE_MALTA_RTC=defined Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Sat Feb 20 01:23:15 2010 (r204107) +++ head/sys/mips/conf/OCTEON1 Sat Feb 20 06:39:14 2010 (r204108) @@ -37,7 +37,6 @@ makeoptions TARGET_BIG_ENDIAN=define makeoptions TARGET_64BIT=defined makeoptions KERNLOADADDR=0xffffffff80100000 -options KERNVIRTADDR=0xffffffff80100000 include "../cavium/std.octeon1" hints "OCTEON1.hints" #Default places to look for devices. Modified: head/sys/mips/conf/OCTEON1-32 ============================================================================== --- head/sys/mips/conf/OCTEON1-32 Sat Feb 20 01:23:15 2010 (r204107) +++ head/sys/mips/conf/OCTEON1-32 Sat Feb 20 06:39:14 2010 (r204108) @@ -26,7 +26,6 @@ makeoptions MODULES_OVERRIDE="" makeoptions TARGET_BIG_ENDIAN=defined makeoptions LDSCRIPT_NAME=ldscript.mips.octeon1.32 -options KERNVIRTADDR=0x81000000 makeoptions KERNLOADADDR=0x81000000 include "../cavium/std.octeon1" Modified: head/sys/mips/conf/QEMU ============================================================================== --- head/sys/mips/conf/QEMU Sat Feb 20 01:23:15 2010 (r204107) +++ head/sys/mips/conf/QEMU Sat Feb 20 06:39:14 2010 (r204108) @@ -27,7 +27,6 @@ makeoptions ARCH_FLAGS=-march=mips32 # Don't build any modules yet. makeoptions MODULES_OVERRIDE="" -options KERNVIRTADDR=0x80100000 include "../adm5120/std.adm5120" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols Modified: head/sys/mips/conf/SWARM ============================================================================== --- head/sys/mips/conf/SWARM Sat Feb 20 01:23:15 2010 (r204107) +++ head/sys/mips/conf/SWARM Sat Feb 20 06:39:14 2010 (r204108) @@ -19,11 +19,6 @@ options CFE_CONSOLE options CFE_ENV options ALT_BREAK_TO_DEBUGGER -# cfe loader expects kernel at 0x80001000 for mips32 w/o backwards -# offsets in the linked elf image (see ldscript hack) -# XXX can we conditionalize the linker stuff on options CFE? -options KERNVIRTADDR=0x80001000 - makeoptions LDSCRIPT_NAME= ldscript.mips.cfe #cpu CPU_MIPS64 Modified: head/sys/mips/conf/XLR ============================================================================== --- head/sys/mips/conf/XLR Sat Feb 20 01:23:15 2010 (r204107) +++ head/sys/mips/conf/XLR Sat Feb 20 06:39:14 2010 (r204108) @@ -53,7 +53,6 @@ makeoptions MODULES_OVERRIDE="" makeoptions TARGET_BIG_ENDIAN # -options KERNVIRTADDR=0x80100000 include "../rmi/std.xlr" @@ -87,7 +86,6 @@ options ROOTDEVNAME=\"nfs:10.1.1.8:/usr #options ROOTDEVNAME=\"ufs:md0\" options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options HZ=1000 -options PHYS_ADDR_64BIT options NO_SWAPPING #Debugging options From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 07:34:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42E661065672; Sat, 20 Feb 2010 07:34:38 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3177B8FC08; Sat, 20 Feb 2010 07:34: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 o1K7Ycoe037181; Sat, 20 Feb 2010 07:34:38 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1K7Ycbs037179; Sat, 20 Feb 2010 07:34:38 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201002200734.o1K7Ycbs037179@svn.freebsd.org> From: Neel Natu Date: Sat, 20 Feb 2010 07:34: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: r204109 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 07:34:38 -0000 Author: neel Date: Sat Feb 20 07:34:37 2010 New Revision: 204109 URL: http://svn.freebsd.org/changeset/base/204109 Log: Fix DDB backtrace that includes a kernel exception frame. The backtrace code tries to look for an instruction of the form "sw ra, x(sp)" to figure out the program counter of the calling function. When we generate the kernel exception frame we store the 'ra' at the time of the exception using an instruction of the same form. The problem is that the 'ra' at the time of the exception is not the same as the 'program counter' at the time of the exception. The fix is to save the 'exception program counter' register by staging it through the 'ra' register. Modified: head/sys/mips/mips/exception.S Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Sat Feb 20 06:39:14 2010 (r204108) +++ head/sys/mips/mips/exception.S Sat Feb 20 07:34:37 2010 (r204109) @@ -275,6 +275,15 @@ SlowFault: mtc0 a0, COP_0_STATUS_REG #endif +/* + * Save CPU and CP0 register state. + * + * This is straightforward except for saving the exception program + * counter. The ddb backtrace code looks for the first instruction + * matching the form "sw ra, (off)sp" to figure out the address of the + * calling function. So we must make sure that we save the exception + * PC by staging it through 'ra' as opposed to any other register. + */ #define SAVE_CPU \ SAVE_REG(AT, AST, sp) ;\ .set at ; \ @@ -314,9 +323,12 @@ SlowFault: SAVE_REG(v1, MULHI, sp) ;\ SAVE_REG(a0, SR, sp) ;\ SAVE_REG(a1, CAUSE, sp) ;\ - SAVE_REG(ra, RA, sp) ;\ SAVE_REG(a2, BADVADDR, sp) ;\ - SAVE_REG(a3, PC, sp) ;\ + move t0, ra ;\ + move ra, a3 ;\ + SAVE_REG(ra, PC, sp) ;\ + move ra, t0 ;\ + SAVE_REG(ra, RA, sp) ;\ PTR_ADDU v0, sp, KERN_EXC_FRAME_SIZE ;\ SAVE_REG(v0, SP, sp) ;\ CLEAR_STATUS ;\ From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 08:19:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CD3B106566C; Sat, 20 Feb 2010 08:19:20 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3AFFA8FC16; Sat, 20 Feb 2010 08:19: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 o1K8JK9c046947; Sat, 20 Feb 2010 08:19:20 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1K8JKkg046945; Sat, 20 Feb 2010 08:19:20 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201002200819.o1K8JKkg046945@svn.freebsd.org> From: Gabor Kovesdan Date: Sat, 20 Feb 2010 08:19: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: r204110 - head/lib/libc/nls X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 08:19:20 -0000 Author: gabor Date: Sat Feb 20 08:19:19 2010 New Revision: 204110 URL: http://svn.freebsd.org/changeset/base/204110 Log: - More style(9) fixups Approved by: delphij (mentor) Modified: head/lib/libc/nls/msgcat.c Modified: head/lib/libc/nls/msgcat.c ============================================================================== --- head/lib/libc/nls/msgcat.c Sat Feb 20 07:34:37 2010 (r204109) +++ head/lib/libc/nls/msgcat.c Sat Feb 20 08:19:19 2010 (r204110) @@ -60,34 +60,35 @@ __FBSDID("$FreeBSD$"); #define _DEFAULT_NLS_PATH "/usr/share/nls/%L/%N.cat:/usr/share/nls/%N/%L:/usr/local/share/nls/%L/%N.cat:/usr/local/share/nls/%N/%L" -#define RLOCK(fail) { int ret; \ - if (__isthreaded && \ - ((ret = _pthread_rwlock_rdlock(&rwlock)) != 0)) { \ - errno = ret; \ - return (fail); \ +#define RLOCK(fail) { int ret; \ + if (__isthreaded && \ + ((ret = _pthread_rwlock_rdlock(&rwlock)) != 0)) { \ + errno = ret; \ + return (fail); \ }} -#define WLOCK(fail) { int ret; \ - if (__isthreaded && \ - ((ret = _pthread_rwlock_wrlock(&rwlock)) != 0)) { \ - errno = ret; \ - return (fail); \ +#define WLOCK(fail) { int ret; \ + if (__isthreaded && \ + ((ret = _pthread_rwlock_wrlock(&rwlock)) != 0)) { \ + errno = ret; \ + return (fail); \ }} -#define UNLOCK { if (__isthreaded) \ +#define UNLOCK { if (__isthreaded) \ _pthread_rwlock_unlock(&rwlock); } #define NLERR ((nl_catd) -1) #define NLRETERR(errc) { errno = errc; return (NLERR); } -#define SAVEFAIL(n, l, e) { WLOCK(NLERR); \ - np = malloc(sizeof(struct catentry)); \ - if (np != NULL) { \ - np->name = strdup(n); \ - np->path = NULL; \ - np->lang = (l == NULL) ? NULL : strdup(l); \ - np->caterrno = e; \ - SLIST_INSERT_HEAD(&cache, np, list); \ - } \ - UNLOCK; \ - errno = e; \ +#define SAVEFAIL(n, l, e) { WLOCK(NLERR); \ + np = malloc(sizeof(struct catentry)); \ + if (np != NULL) { \ + np->name = strdup(n); \ + np->path = NULL; \ + np->lang = (l == NULL) ? NULL : \ + strdup(l); \ + np->caterrno = e; \ + SLIST_INSERT_HEAD(&cache, np, list); \ + } \ + UNLOCK; \ + errno = e; \ } static nl_catd load_msgcat(const char *, const char *, const char *); @@ -209,7 +210,7 @@ catopen(const char *name, int type) break; case '%': ++nlspath; - /* fallthrough */ + /* FALLTHROUGH */ default: if (pathP - path >= sizeof(path) - 1) @@ -369,7 +370,8 @@ load_msgcat(const char *path, const char /* path/name will never be NULL here */ - /* One more try in cache; if it was not found by name, + /* + * One more try in cache; if it was not found by name, * it might still be found by absolute path. */ RLOCK(NLERR); @@ -393,8 +395,9 @@ load_msgcat(const char *path, const char NLRETERR(EFTYPE); } - /* If the file size cannot be held in size_t we cannot mmap() - * it to the memory. Probably, this will not be a problem given + /* + * If the file size cannot be held in size_t we cannot mmap() + * it to the memory. Probably, this will not be a problem given * that catalog files are usually small. */ if (st.st_size > SIZE_T_MAX) { From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 09:39:48 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E814A1065670 for ; Sat, 20 Feb 2010 09:39:48 +0000 (UTC) (envelope-from decado@gmail.com) Received: from mail-gx0-f221.google.com (mail-gx0-f221.google.com [209.85.217.221]) by mx1.freebsd.org (Postfix) with ESMTP id 9DBFF8FC0C for ; Sat, 20 Feb 2010 09:39:48 +0000 (UTC) Received: by gxk21 with SMTP id 21so620530gxk.13 for ; Sat, 20 Feb 2010 01:39:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=+XfXnjUE0sNyihksUCt5wRkwSzK2IT317KWBPP8s7fI=; b=hnmXnYuz1a06YGDGgb0hmq3QXMvxemRxAgd8m/8oQ01mWuZFQl//23tuAMF6sTarD7 H3WuXvUUoH4x9vqSY3f2/7VHGuU+skLgHogg0dLcqO4Km0xNK6XUxCeJT0r2O20v7inb qW13gQNq1jYn00VMqfqc1RjlSyxP4Nq7juuu4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=p5HMMnPndGIlQlKpTTa8ovkFARkyLubJkmlFN1dbl0arZZfPY5QfoeK+7pAnpZVqVa oTv3p4YBHuEhD10g8ghz8iomTiG+hoxMafM4avhEYJlqzAYls1GB3gHZNI0I5cs9WLAl fc9cUyRolNLiQoY6uuz6DTVclpcA1GKFw4cbM= Received: by 10.150.194.16 with SMTP id r16mr144956ybf.194.1266657104300; Sat, 20 Feb 2010 01:11:44 -0800 (PST) Received: from ?192.168.20.100? (CPE-121-220-37-25.lnse2.win.bigpond.net.au [121.220.37.25]) by mx.google.com with ESMTPS id 5sm483175yxd.35.2010.02.20.01.11.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 20 Feb 2010 01:11:43 -0800 (PST) Message-ID: <4B7FB534.5000701@gmail.com> Date: Sat, 20 Feb 2010 20:11:00 +1000 From: "Andrew D. Boyd" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 MIME-Version: 1.0 To: svn-src-head@freebsd.org References: <201002181545.o1IFjiAq007348@svn.freebsd.org> In-Reply-To: <201002181545.o1IFjiAq007348@svn.freebsd.org> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: svn commit: r204044 - head/release/scripts X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 09:39:49 -0000 On 19/02/2010 1:45 AM, Ken Smith wrote: > Author: kensmith > Date: Thu Feb 18 15:45:43 2010 > New Revision: 204044 > URL: http://svn.freebsd.org/changeset/base/204044 > > Log: > Provide a script that can be used to create the memstick images. For now > it isn't being integrated into 'make release' because for the forseeable > future the memstick images will be identical to what's on the DVD except > for which package set is provided. If/when what's on the memstick diverges > from what's on the DVD it would make more sense to generate a "memstick" > directory in $CHROOT/R/cdrom and build the memstick image along with the > ISO images. > > Reviewed by: jhb, ru, Garrett Cooper (yanefbsd at gmail dot com) > > Added: > head/release/scripts/make-memstick.sh (contents, props changed) > > Added: head/release/scripts/make-memstick.sh > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/release/scripts/make-memstick.sh Thu Feb 18 15:45:43 2010 (r204044) > @@ -0,0 +1,83 @@ > +#!/bin/sh > +# > +# This script generates a "memstick image" (image that can be copied to a > +# USB memory stick) from a directory tree. Note that the script does not > +# clean up after itself very well for error conditions on purpose so the > +# problem can be diagnosed (full filesystem most likely but ...). > +# > +# Usage: make-memstick.sh > +# > +# $FreeBSD$ > +# > + > +PATH=/bin:/usr/bin:/sbin:/usr/sbin > +export PATH > + > +BLOCKSIZE=10240 > + > +if [ $# -ne 2 ]; then > + echo "make-memstick.sh /path/to/directory /path/to/image/file" > + exit 1 > +fi > + > +tempfile="${2}.$$" > + > +if [ ! -d ${1} ]; then > + echo "${1} must be a directory" > + exit 1 > +fi > + > +if [ -e ${2} ]; then > + echo "won't overwrite ${2}" > + exit 1 > +fi > + > +rm -f ${tempfile} > +makefs ${tempfile} ${1} > +if [ $? -ne 0 ]; then > + echo "makefs failed" > + exit 1 > +fi > + > +# > +# Use $BLOCKSIZE for transfers to improve efficiency. When calculating > +# how many blocks to transfer "+ 2" is to account for truncation in the > +# division and to provide space for the label. > +# > + > +filesize=`stat -f "%z" ${tempfile}` > +blocks=$(($filesize / ${BLOCKSIZE} + 2)) > +dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks} > +if [ $? -ne 0 ]; then > + echo "creation of image file failed" > + exit 1 > +fi > + > +unit=`mdconfig -a -t vnode -f ${2}` > +if [ $? -ne 0 ]; then > + echo "mdconfig failed" > + exit 1 > +fi > + > +fdisk -BIq /dev/${unit} > +if [ $? -ne 0 ]; then > + echo "fdisk failed" > + exit 1 > +fi > + > +bsdlabel -B -w /dev/${unit} > +if [ $? -ne 0 ]; then > + echo "bsdlabel failed" > + exit 1 > +fi > + > +dd if=${tempfile} of=/dev/${unit}a bs=$BLOCKSIZE conv=sync > +if [ $? -ne 0 ]; then > + echo "copying filesystem into image file failed" > + exit 1 > +fi > + > +mdconfig -d -u ${unit} > + > +rm -f ${tempfile} > + > _______________________________________________ > 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" > I think trap should be used to clean up the tempfile in the case of the script exiting before cleaning it up. -- Andrew D. Boyd (decado@gmail.com) From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 10:19:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 229C1106566B; Sat, 20 Feb 2010 10:19:20 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E59A8FC14; Sat, 20 Feb 2010 10:19: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 o1KAJJfx074173; Sat, 20 Feb 2010 10:19:19 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KAJJAm074161; Sat, 20 Feb 2010 10:19:19 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201002201019.o1KAJJAm074161@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 20 Feb 2010 10: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: r204111 - in head: lib/libarchive sbin/restore sys/dev/cxgb/ulp/iw_cxgb sys/fs/ext2fs sys/fs/msdosfs usr.bin/cpio usr.bin/tar usr.bin/tar/test usr.bin/xinstall usr.sbin/mtree X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 10:19:20 -0000 Author: uqs Date: Sat Feb 20 10:19:19 2010 New Revision: 204111 URL: http://svn.freebsd.org/changeset/base/204111 Log: Fix common misspelling of hierarchy Pointed out by: bf1783 at gmail Approved by: np (cxgb), kientzle (tar, etc.), philip (mentor) Modified: head/lib/libarchive/archive_write_disk.3 head/sbin/restore/restore.h head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/msdosfs/msdosfs_vnops.c head/usr.bin/cpio/bsdcpio.1 head/usr.bin/tar/test/test_option_T.c head/usr.bin/tar/test/test_option_s.c head/usr.bin/tar/tree.c head/usr.bin/xinstall/xinstall.c head/usr.sbin/mtree/mtree.5 Modified: head/lib/libarchive/archive_write_disk.3 ============================================================================== --- head/lib/libarchive/archive_write_disk.3 Sat Feb 20 08:19:19 2010 (r204110) +++ head/lib/libarchive/archive_write_disk.3 Sat Feb 20 10:19:19 2010 (r204111) @@ -339,7 +339,7 @@ In particular, the directory .Pa aa is created as well as the final object .Pa bb . -In theory, this can be exploited to create an entire directory heirarchy +In theory, this can be exploited to create an entire directory hierarchy with a single request. Of course, this does not work if the .Cm ARCHIVE_EXTRACT_NODOTDOT @@ -371,5 +371,5 @@ compact implementation when appropriate. .Pp There should be a corresponding .Nm archive_read_disk -interface that walks a directory heirarchy and returns archive +interface that walks a directory hierarchy and returns archive entry objects. Modified: head/sbin/restore/restore.h ============================================================================== --- head/sbin/restore/restore.h Sat Feb 20 08:19:19 2010 (r204110) +++ head/sbin/restore/restore.h Sat Feb 20 10:19:19 2010 (r204111) @@ -41,7 +41,7 @@ extern int bflag; /* set input block size */ extern int dflag; /* print out debugging info */ extern int Dflag; /* degraded mode - try hard to get stuff back */ -extern int hflag; /* restore heirarchies */ +extern int hflag; /* restore hierarchies */ extern int mflag; /* restore by name instead of inode number */ extern int Nflag; /* do not write the disk */ extern int uflag; /* unlink symlink targets */ Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c ============================================================================== --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c Sat Feb 20 08:19:19 2010 (r204110) +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_qp.c Sat Feb 20 10:19:19 2010 (r204111) @@ -675,7 +675,7 @@ static void __flush_qp(struct iwch_qp *q qhp->refcnt++; mtx_unlock(&qhp->lock); - /* locking heirarchy: cq lock first, then qp lock. */ + /* locking hierarchy: cq lock first, then qp lock. */ mtx_lock(&rchp->lock); mtx_lock(&qhp->lock); cxio_flush_hw_cq(&rchp->cq); @@ -685,7 +685,7 @@ static void __flush_qp(struct iwch_qp *q mtx_unlock(&rchp->lock); (*rchp->ibcq.comp_handler)(&rchp->ibcq, rchp->ibcq.cq_context); - /* locking heirarchy: cq lock first, then qp lock. */ + /* locking hierarchy: cq lock first, then qp lock. */ mtx_lock(&schp->lock); mtx_lock(&qhp->lock); cxio_flush_hw_cq(&schp->cq); Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Sat Feb 20 08:19:19 2010 (r204110) +++ head/sys/fs/ext2fs/ext2_vnops.c Sat Feb 20 10:19:19 2010 (r204111) @@ -894,7 +894,7 @@ abortit: /* * If ".." must be changed (ie the directory gets a new * parent) then the source directory must not be in the - * directory heirarchy above the target, as this would + * directory hierarchy above the target, as this would * orphan everything below the source directory. Also * the user must have write permission in the source so * as to be able to change "..". We must repeat the call Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Sat Feb 20 08:19:19 2010 (r204110) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Sat Feb 20 10:19:19 2010 (r204111) @@ -1072,7 +1072,7 @@ abortit: /* * If ".." must be changed (ie the directory gets a new * parent) then the source directory must not be in the - * directory heirarchy above the target, as this would + * directory hierarchy above the target, as this would * orphan everything below the source directory. Also * the user must have write permission in the source so * as to be able to change "..". We must repeat the call Modified: head/usr.bin/cpio/bsdcpio.1 ============================================================================== --- head/usr.bin/cpio/bsdcpio.1 Sat Feb 20 08:19:19 2010 (r204110) +++ head/usr.bin/cpio/bsdcpio.1 Sat Feb 20 10:19:19 2010 (r204111) @@ -266,7 +266,7 @@ for more information. .Sh EXAMPLES The .Nm -command is traditionally used to copy file heirarchies in conjunction +command is traditionally used to copy file hierarchies in conjunction with the .Xr find 1 command. Modified: head/usr.bin/tar/test/test_option_T.c ============================================================================== --- head/usr.bin/tar/test/test_option_T.c Sat Feb 20 08:19:19 2010 (r204110) +++ head/usr.bin/tar/test/test_option_T.c Sat Feb 20 10:19:19 2010 (r204111) @@ -43,7 +43,7 @@ DEFINE_TEST(test_option_T) int r; struct stat st; - /* Create a simple dir heirarchy; bail if anything fails. */ + /* Create a simple dir hierarchy; bail if anything fails. */ if (!assertEqualInt(0, mkdir("d1", 0755))) return; if (!assertEqualInt(0, mkdir("d1/d2", 0755))) return; if (!touch("d1/f1")) return; Modified: head/usr.bin/tar/test/test_option_s.c ============================================================================== --- head/usr.bin/tar/test/test_option_s.c Sat Feb 20 08:19:19 2010 (r204110) +++ head/usr.bin/tar/test/test_option_s.c Sat Feb 20 10:19:19 2010 (r204111) @@ -44,7 +44,7 @@ DEFINE_TEST(test_option_s) { struct stat st; - /* Create a sample file heirarchy. */ + /* Create a sample file hierarchy. */ assertEqualInt(0, mkdir("in", 0755)); assertEqualInt(0, mkdir("in/d1", 0755)); assertEqualInt(0, mkfile("in/d1/foo", "foo")); Modified: head/usr.bin/tar/tree.c ============================================================================== --- head/usr.bin/tar/tree.c Sat Feb 20 08:19:19 2010 (r204110) +++ head/usr.bin/tar/tree.c Sat Feb 20 10:19:19 2010 (r204111) @@ -313,7 +313,7 @@ tree_next(struct tree *t) * violation. Just crash now. */ if (t->visit_type == TREE_ERROR_FATAL) { const char *msg = "Unable to continue traversing" - " directory heirarchy after a fatal error."; + " directory hierarchy after a fatal error."; write(2, msg, strlen(msg)); *(int *)0 = 1; /* Deliberate SEGV; NULL pointer dereference. */ exit(1); /* In case the SEGV didn't work. */ Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Sat Feb 20 08:19:19 2010 (r204110) +++ head/usr.bin/xinstall/xinstall.c Sat Feb 20 10:19:19 2010 (r204111) @@ -733,7 +733,7 @@ strip(const char *to_name) /* * install_dir -- - * build directory heirarchy + * build directory hierarchy */ static void install_dir(char *path) Modified: head/usr.sbin/mtree/mtree.5 ============================================================================== --- head/usr.sbin/mtree/mtree.5 Sat Feb 20 08:19:19 2010 (r204110) +++ head/usr.sbin/mtree/mtree.5 Sat Feb 20 10:19:19 2010 (r204111) @@ -33,12 +33,12 @@ .Os .Sh NAME .Nm mtree -.Nd format of mtree dir heirarchy files +.Nd format of mtree dir hierarchy files .Sh DESCRIPTION The .Nm format is a textual format that describes a collection of filesystem objects. -Such files are typically used to create or verify directory heirarchies. +Such files are typically used to create or verify directory hierarchies. .Ss General Format An .Nm From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 11:56:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 54EEC106566C; Sat, 20 Feb 2010 11:56:09 +0000 (UTC) Date: Sat, 20 Feb 2010 11:56:09 +0000 From: Alexey Dokuchaev To: Pawel Jakub Dawidek Message-ID: <20100220115609.GA94735@FreeBSD.org> References: <201002192018.o1JKIHta088414@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201002192018.o1JKIHta088414@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204101 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 11:56:09 -0000 On Fri, Feb 19, 2010 at 08:18:17PM +0000, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Fri Feb 19 20:18:16 2010 > New Revision: 204101 > URL: http://svn.freebsd.org/changeset/base/204101 > > Don't set f_bsize to recordsize. It might confuse some software (like squid). Can submitter (or maybe you, Pawel) elaborate on the subject please? Particularly, what exactly breaks squid and in what way? This was not immediately obvious from reading the diff. Thanks. ./danfe From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 11:58:38 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 597DA106568D; Sat, 20 Feb 2010 11:58:38 +0000 (UTC) Date: Sat, 20 Feb 2010 11:58:38 +0000 From: Alexey Dokuchaev To: Xin LI Message-ID: <20100220115838.GB94735@FreeBSD.org> References: <201002192354.o1JNsCZJ035886@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201002192354.o1JNsCZJ035886@svn.freebsd.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204103 - in head/usr.bin: . seq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 11:58:38 -0000 On Fri, Feb 19, 2010 at 11:54:12PM +0000, Xin LI wrote: > Author: delphij > Date: Fri Feb 19 23:54:12 2010 > New Revision: 204103 > URL: http://svn.freebsd.org/changeset/base/204103 > > Log: > Add seq(1), a small utility to generate sequence number. Why do we need this when we have jot(1)? ./danfe From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 13:19:33 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B931C1065694; Sat, 20 Feb 2010 13:19:33 +0000 (UTC) (envelope-from dimitry@andric.com) 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 7ECE98FC19; Sat, 20 Feb 2010 13:19:33 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:705d:318e:2cb0:5f81] (unknown [IPv6:2001:7b8:3a7:0:705d:318e:2cb0:5f81]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 974885C59; Sat, 20 Feb 2010 14:19:32 +0100 (CET) Message-ID: <4B7FE166.7010002@andric.com> Date: Sat, 20 Feb 2010 14:19:34 +0100 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.2pre) Gecko/20100218 Lanikai/3.1b1pre MIME-Version: 1.0 To: Alexey Dokuchaev References: <201002192018.o1JKIHta088414@svn.freebsd.org> <20100220115609.GA94735@FreeBSD.org> In-Reply-To: <20100220115609.GA94735@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r204101 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 13:19:33 -0000 On 2010-02-20 12:56, Alexey Dokuchaev wrote: >> URL: http://svn.freebsd.org/changeset/base/204101 >> >> Don't set f_bsize to recordsize. It might confuse some software (like squid). > > Can submitter (or maybe you, Pawel) elaborate on the subject please? > Particularly, what exactly breaks squid and in what way? This was not > immediately obvious from reading the diff. Thanks. See here for the original post to -current: http://lists.freebsd.org/pipermail/freebsd-current/2010-February/015494.html From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 13:24:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 1D5FF106566C; Sat, 20 Feb 2010 13:24:09 +0000 (UTC) Date: Sat, 20 Feb 2010 13:24:09 +0000 From: Alexey Dokuchaev To: Dimitry Andric Message-ID: <20100220132408.GA57083@FreeBSD.org> References: <201002192018.o1JKIHta088414@svn.freebsd.org> <20100220115609.GA94735@FreeBSD.org> <4B7FE166.7010002@andric.com> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <4B7FE166.7010002@andric.com> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r204101 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 13:24:09 -0000 On Sat, Feb 20, 2010 at 02:19:34PM +0100, Dimitry Andric wrote: > On 2010-02-20 12:56, Alexey Dokuchaev wrote: > >>URL: http://svn.freebsd.org/changeset/base/204101 > >> > >>Don't set f_bsize to recordsize. It might confuse some software (like > >>squid). > > > >Can submitter (or maybe you, Pawel) elaborate on the subject please? > >Particularly, what exactly breaks squid and in what way? > > See here for the original post to -current: > > http://lists.freebsd.org/pipermail/freebsd-current/2010-February/015494.html Thanks a lot, Dimitry, this quite answers my question. ./danfe From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 13:33:50 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE0581065670; Sat, 20 Feb 2010 13:33:50 +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 DEEC48FC13; Sat, 20 Feb 2010 13:33: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 o1KDXo7d017354; Sat, 20 Feb 2010 13:33:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KDXoos017352; Sat, 20 Feb 2010 13:33:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201002201333.o1KDXoos017352@svn.freebsd.org> From: Ed Schouten Date: Sat, 20 Feb 2010 13:33: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: r204118 - head/sys/amd64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 13:33:51 -0000 Author: ed Date: Sat Feb 20 13:33:50 2010 New Revision: 204118 URL: http://svn.freebsd.org/changeset/base/204118 Log: Add . This header file uses __packed, without including . This means it cannot be used in the way described in sysarch(3) by only including . Modified: head/sys/amd64/include/sysarch.h Modified: head/sys/amd64/include/sysarch.h ============================================================================== --- head/sys/amd64/include/sysarch.h Sat Feb 20 12:48:44 2010 (r204117) +++ head/sys/amd64/include/sysarch.h Sat Feb 20 13:33:50 2010 (r204118) @@ -35,6 +35,8 @@ #ifndef _MACHINE_SYSARCH_H_ #define _MACHINE_SYSARCH_H_ +#include + #define I386_GET_LDT 0 #define I386_SET_LDT 1 #define LDT_AUTO_ALLOC 0xffffffff From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 13:35:22 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5AE21065741; Sat, 20 Feb 2010 13:35:22 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2001:470:9a47::1]) by mx1.freebsd.org (Postfix) with ESMTP id 409998FC13; Sat, 20 Feb 2010 13:35:22 +0000 (UTC) Received: from acme.spoerlein.net (localhost.spoerlein.net [IPv6:::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id o1KDZLxR007446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 20 Feb 2010 14:35:21 +0100 (CET) (envelope-from uqs@FreeBSD.org) Received: (from uqs@localhost) by acme.spoerlein.net (8.14.4/8.14.4/Submit) id o1KDZLFF007442; Sat, 20 Feb 2010 14:35:21 +0100 (CET) (envelope-from uqs@FreeBSD.org) Date: Sat, 20 Feb 2010 14:35:20 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Alexey Dokuchaev Message-ID: <20100220133520.GB57731@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Alexey Dokuchaev , Xin LI , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201002192354.o1JNsCZJ035886@svn.freebsd.org> <20100220115838.GB94735@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100220115838.GB94735@FreeBSD.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Xin LI Subject: Re: svn commit: r204103 - in head/usr.bin: . seq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 13:35:22 -0000 On Sat, 20.02.2010 at 11:58:38 +0000, Alexey Dokuchaev wrote: > On Fri, Feb 19, 2010 at 11:54:12PM +0000, Xin LI wrote: > > Author: delphij > > Date: Fri Feb 19 23:54:12 2010 > > New Revision: 204103 > > URL: http://svn.freebsd.org/changeset/base/204103 > > > > Log: > > Add seq(1), a small utility to generate sequence number. > > Why do we need this when we have jot(1)? Compatibility with shell scripts, I suppose. Some ports may use seq(1) in their test or build targets, etc. There is no jot(1) on any Linux or Solaris I've seen so usage of seq(1) is fairly common. I wonder though, if we could merge functionality into jot(1) and employ a link to seq. Uli From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 13:57:04 2010 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 34D5F1065679; Sat, 20 Feb 2010 13:57:04 +0000 (UTC) Date: Sat, 20 Feb 2010 13:57:04 +0000 From: Alexey Dokuchaev To: Ulrich Sp??rlein , Xin LI , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-ID: <20100220135704.GA57372@FreeBSD.org> References: <201002192354.o1JNsCZJ035886@svn.freebsd.org> <20100220115838.GB94735@FreeBSD.org> <20100220133520.GB57731@acme.spoerlein.net> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20100220133520.GB57731@acme.spoerlein.net> User-Agent: Mutt/1.4.2.1i Cc: Subject: Re: svn commit: r204103 - in head/usr.bin: . seq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 13:57:04 -0000 On Sat, Feb 20, 2010 at 02:35:20PM +0100, Ulrich Sp??rlein wrote: > On Sat, 20.02.2010 at 11:58:38 +0000, Alexey Dokuchaev wrote: > > Why do we need [seq] when we have jot(1)? > > Compatibility with shell scripts, I suppose. Some ports may use seq(1) > in their test or build targets, etc. There is no jot(1) on any Linux or > Solaris I've seen so usage of seq(1) is fairly common. True, jot(1) is BSD specific. But if we speak for ports, trivial patch can turn seq(1) expression into jot(1) one, thus getting rid of gratuitous dependency. > I wonder though, if we could merge functionality into jot(1) and employ > a link to seq. I would probably be OK with the last suggestion. :-) ./danfe From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 14:13:47 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6E50106568B; Sat, 20 Feb 2010 14:13:47 +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 A75B78FC17; Sat, 20 Feb 2010 14:13: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 o1KEDlAJ026189; Sat, 20 Feb 2010 14:13:47 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KEDltK026187; Sat, 20 Feb 2010 14:13:47 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201002201413.o1KEDltK026187@svn.freebsd.org> From: Ed Schouten Date: Sat, 20 Feb 2010 14:13: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: r204120 - head/sys/amd64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 14:13:47 -0000 Author: ed Date: Sat Feb 20 14:13:47 2010 New Revision: 204120 URL: http://svn.freebsd.org/changeset/base/204120 Log: Remove redundant inclusion of . In my previous commit I should have moved the inclusion to the top, instead of adding a second one. Modified: head/sys/amd64/include/sysarch.h Modified: head/sys/amd64/include/sysarch.h ============================================================================== --- head/sys/amd64/include/sysarch.h Sat Feb 20 13:35:05 2010 (r204119) +++ head/sys/amd64/include/sysarch.h Sat Feb 20 14:13:47 2010 (r204120) @@ -70,8 +70,6 @@ struct i386_ioperm_args { }; #ifndef _KERNEL -#include - __BEGIN_DECLS int amd64_get_fsbase(void **); int amd64_get_gsbase(void **); From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 14:29:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F417D106566B; Sat, 20 Feb 2010 14:29:04 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id AC3C08FC12; Sat, 20 Feb 2010 14:29:02 +0000 (UTC) Received: by pwj7 with SMTP id 7so1316366pwj.13 for ; Sat, 20 Feb 2010 06:29:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=mxOSZFiZ13aP8qRl5IbJxx7DT7rjr5S3mDky6rxpV1Q=; b=EkH51gl8/8ZYaMST2D8UHBtrFsD5Mwoi2NPafpy/+xp8FcXDgs2/vkoDbC0lst5bBE iY3iUtua7HijrLWDGHNcspTQ1wQyYFjUc5L/qtVYYyR2y3K2NuPHYA3nDVPPxJ8Ih9n7 ig3MPXQ1TI1R7E0IREYoJv8JuCEkJzOA+i/Yw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=swNM2itC3wmslXopsGw8YRfJQRoQCX+rVhSu7F5jegjG5Uehy+Q1mkV+zdN8qQRlkV Qyy8dIHZPvMHDPXtLjkyLcytX+B42G5IoEVLFBZQxxd4Y71VL25xb9NMXaSYw2DD89uJ Z5EIQn2U+kAhRSFOZbUejYgX1hXbv9ZRT1mxg= MIME-Version: 1.0 Received: by 10.114.68.12 with SMTP id q12mr918844waa.67.1266676139841; Sat, 20 Feb 2010 06:28:59 -0800 (PST) In-Reply-To: <20100220133520.GB57731@acme.spoerlein.net> References: <201002192354.o1JNsCZJ035886@svn.freebsd.org> <20100220115838.GB94735@FreeBSD.org> <20100220133520.GB57731@acme.spoerlein.net> Date: Sat, 20 Feb 2010 06:28:59 -0800 Message-ID: From: Xin LI To: =?UTF-8?Q?Ulrich_Sp=C3=B6rlein?= , Alexey Dokuchaev , Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: svn commit: r204103 - in head/usr.bin: . seq X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 14:29:05 -0000 On Sat, Feb 20, 2010 at 5:35 AM, Ulrich Sp=C3=B6rlein wro= te: > On Sat, 20.02.2010 at 11:58:38 +0000, Alexey Dokuchaev wrote: >> On Fri, Feb 19, 2010 at 11:54:12PM +0000, Xin LI wrote: >> > Author: delphij >> > Date: Fri Feb 19 23:54:12 2010 >> > New Revision: 204103 >> > URL: http://svn.freebsd.org/changeset/base/204103 >> > >> > Log: >> > =C2=A0 Add seq(1), a small utility to generate sequence number. >> >> Why do we need this when we have jot(1)? > > Compatibility with shell scripts, I suppose. Some ports may use seq(1) > in their test or build targets, etc. There is no jot(1) on any Linux or > Solaris I've seen so usage of seq(1) is fairly common. Yes exactly. > I wonder though, if we could merge functionality into jot(1) and employ > a link to seq. The primary difference between the two is the command line parsing and option handling and seq uses double number. I think we will not benefit a lot from the shared code unfortunately... Cheers, --=20 Xin LI http://www.delphij.net From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 14:52:08 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30094106568B; Sat, 20 Feb 2010 14:52:08 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2017C8FC1C; Sat, 20 Feb 2010 14:52: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 o1KEq81v034618; Sat, 20 Feb 2010 14:52:08 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KEq76Y034616; Sat, 20 Feb 2010 14:52:07 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201002201452.o1KEq76Y034616@svn.freebsd.org> From: Kevin Lo Date: Sat, 20 Feb 2010 14:52: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: r204121 - head/sys/arm/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 14:52:08 -0000 Author: kevlo Date: Sat Feb 20 14:52:07 2010 New Revision: 204121 URL: http://svn.freebsd.org/changeset/base/204121 Log: Correct both FA526/FA626TE cpu ids since the cpu id is always masked with 0xfffffff0 Modified: head/sys/arm/include/armreg.h Modified: head/sys/arm/include/armreg.h ============================================================================== --- head/sys/arm/include/armreg.h Sat Feb 20 14:13:47 2010 (r204120) +++ head/sys/arm/include/armreg.h Sat Feb 20 14:52:07 2010 (r204121) @@ -151,8 +151,8 @@ #define CPU_ID_MV88FR131 0x56251310 /* Marvell Feroceon 88FR131 Core */ #define CPU_ID_MV88FR571_VD 0x56155710 /* Marvell Feroceon 88FR571-VD Core (ID from datasheet) */ #define CPU_ID_MV88FR571_41 0x41159260 /* Marvell Feroceon 88FR571-VD Core (actual ID from CPU reg) */ -#define CPU_ID_FA526 0x66015261 -#define CPU_ID_FA626TE 0x66056261 +#define CPU_ID_FA526 0x66015260 +#define CPU_ID_FA626TE 0x66056260 #define CPU_ID_SA1110 0x6901b110 #define CPU_ID_IXP1200 0x6901c120 #define CPU_ID_80200 0x69052000 From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 14:54:11 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62054106566B; Sat, 20 Feb 2010 14:54:11 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51E9E8FC16; Sat, 20 Feb 2010 14:54: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 o1KEsBGW035085; Sat, 20 Feb 2010 14:54:11 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KEsBuH035081; Sat, 20 Feb 2010 14:54:11 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201002201454.o1KEsBuH035081@svn.freebsd.org> From: Kevin Lo Date: Sat, 20 Feb 2010 14:54: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: r204122 - in head/sys/arm: arm include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 14:54:11 -0000 Author: kevlo Date: Sat Feb 20 14:54:11 2010 New Revision: 204122 URL: http://svn.freebsd.org/changeset/base/204122 Log: Show the cpu info for fa526 Submitted by: Yohanes Nugroho Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/identcpu.c head/sys/arm/include/md_var.h Modified: head/sys/arm/arm/cpufunc.c ============================================================================== --- head/sys/arm/arm/cpufunc.c Sat Feb 20 14:52:07 2010 (r204121) +++ head/sys/arm/arm/cpufunc.c Sat Feb 20 14:54:11 2010 (r204122) @@ -2119,7 +2119,8 @@ fa526_setup(char *args) cpuctrl = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_32BP_ENABLE | CPU_CONTROL_32BD_ENABLE | CPU_CONTROL_SYST_ENABLE | CPU_CONTROL_IC_ENABLE | CPU_CONTROL_DC_ENABLE - | CPU_CONTROL_WBUF_ENABLE | CPU_CONTROL_LABT_ENABLE; + | CPU_CONTROL_WBUF_ENABLE | CPU_CONTROL_LABT_ENABLE + | CPU_CONTROL_BPRD_ENABLE; cpuctrlmask = CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_32BP_ENABLE | CPU_CONTROL_32BD_ENABLE | CPU_CONTROL_SYST_ENABLE | CPU_CONTROL_IC_ENABLE | CPU_CONTROL_DC_ENABLE Modified: head/sys/arm/arm/identcpu.c ============================================================================== --- head/sys/arm/arm/identcpu.c Sat Feb 20 14:52:07 2010 (r204121) +++ head/sys/arm/arm/identcpu.c Sat Feb 20 14:54:11 2010 (r204122) @@ -220,6 +220,9 @@ const struct cpuidtab cpuids[] = { generic_steppings }, { CPU_ID_ARM966ESR1, CPU_CLASS_ARM9ES, "ARM966E-S", generic_steppings }, + { CPU_ID_FA526, CPU_CLASS_ARM9, "FA526", + generic_steppings }, + { CPU_ID_TI925T, CPU_CLASS_ARM9TDMI, "TI ARM925T", generic_steppings }, @@ -317,6 +320,7 @@ const struct cpu_classtab cpu_classes[] { "ARM7", "CPU_ARM7" }, /* CPU_CLASS_ARM7 */ { "ARM7TDMI", "CPU_ARM7TDMI" }, /* CPU_CLASS_ARM7TDMI */ { "ARM8", "CPU_ARM8" }, /* CPU_CLASS_ARM8 */ + { "ARM9", "CPU_ARM9" }, /* CPU_CLASS_ARM9 */ { "ARM9TDMI", "CPU_ARM9TDMI" }, /* CPU_CLASS_ARM9TDMI */ { "ARM9E-S", "CPU_ARM9E" }, /* CPU_CLASS_ARM9ES */ { "ARM9EJ-S", "CPU_ARM9E" }, /* CPU_CLASS_ARM9EJS */ Modified: head/sys/arm/include/md_var.h ============================================================================== --- head/sys/arm/include/md_var.h Sat Feb 20 14:52:07 2010 (r204121) +++ head/sys/arm/include/md_var.h Sat Feb 20 14:54:11 2010 (r204122) @@ -57,6 +57,7 @@ enum cpu_class { CPU_CLASS_ARM7, CPU_CLASS_ARM7TDMI, CPU_CLASS_ARM8, + CPU_CLASS_ARM9, CPU_CLASS_ARM9TDMI, CPU_CLASS_ARM9ES, CPU_CLASS_ARM9EJS, From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 15:20:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 472A8106566C; Sat, 20 Feb 2010 15:20:29 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 354858FC08; Sat, 20 Feb 2010 15:20: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 o1KFKTWv041064; Sat, 20 Feb 2010 15:20:29 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KFKT9A041062; Sat, 20 Feb 2010 15:20:29 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201002201520.o1KFKT9A041062@svn.freebsd.org> From: Attilio Rao Date: Sat, 20 Feb 2010 15:20: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: r204123 - in head/tools/regression/kthread: . kld X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 15:20:29 -0000 Author: attilio Date: Sat Feb 20 15:20:28 2010 New Revision: 204123 URL: http://svn.freebsd.org/changeset/base/204123 Log: Add a regression test for the kthread(9) interface. Submitted by: Giovanni Trematerra Added: head/tools/regression/kthread/ head/tools/regression/kthread/kld/ head/tools/regression/kthread/kld/Makefile (contents, props changed) head/tools/regression/kthread/kld/kthrdlk.c (contents, props changed) Added: head/tools/regression/kthread/kld/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/kthread/kld/Makefile Sat Feb 20 15:20:28 2010 (r204123) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR} + +KMOD= kthrdlk +NO_MAN= +SRCS= kthrdlk.c +WARNS?= 2 + +.include Added: head/tools/regression/kthread/kld/kthrdlk.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/kthread/kld/kthrdlk.c Sat Feb 20 15:20:28 2010 (r204123) @@ -0,0 +1,204 @@ +/*- + * Copyright (c) 2010 Giovanni Trematerra + * 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. + */ + +/* + * PURPOSE: + * + * This kernel module helped to identify a deadlock in kthread + * interface, also pointed out a race in kthread_exit function. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef TESTPAUSE_DEBUG +#define DPRINTF(x) do { \ + printf (x); \ +} while (0) +#else +#define DPRINTF(x) +#endif + +static struct mtx test_global_lock; +static int global_condvar; +static int test_thrcnt; +volatile int QUIT; + +static void +thr_suspender(void *arg) +{ + struct thread *td = (struct thread *) arg; + int error; + + for (;;) { + if (QUIT == 1) + break; + error = kthread_suspend(td, 10*hz); + if (error != 0 && QUIT == 0) { + if (error == EWOULDBLOCK) + panic("Ooops: kthread deadlock\n"); + else + panic("kthread_suspend error: %d\n", error); + break; + } + } + + mtx_lock(&test_global_lock); + test_thrcnt--; + wakeup(&global_condvar); + mtx_unlock(&test_global_lock); + + kthread_exit(); +} + +static void +thr_resumer(void *arg) +{ + struct thread *td = (struct thread *) arg; + int error; + + for (;;) { + /* must be the last thread to exit */ + if (QUIT == 1 && test_thrcnt == 1) + break; + error = kthread_resume(td); + if (error != 0) + panic("%s: error on kthread_resume. error: %d\n", + __func__, error); + } + + mtx_lock(&test_global_lock); + test_thrcnt--; + wakeup(&global_condvar); + mtx_unlock(&test_global_lock); + + kthread_exit(); +} + +static void +thr_getsuspended(void *arg) +{ + for (;;) { + if (QUIT == 1) + break; + kthread_suspend_check(); + } + + mtx_lock(&test_global_lock); + test_thrcnt--; + wakeup(&global_condvar); + mtx_unlock(&test_global_lock); + + kthread_exit(); +} + +static void +kthrdlk_init(void) +{ + struct proc *testproc; + struct thread *newthr; + int error; + + QUIT = 0; + test_thrcnt = 3; + mtx_init(&test_global_lock, "kthrdlk_lock", NULL, MTX_DEF); + testproc = NULL; + error = kproc_kthread_add(thr_getsuspended, NULL, &testproc, &newthr, + 0, 0, "kthrdlk", "thr_getsuspended"); + if (error != 0) + panic("cannot start thr_getsuspended error: %d\n", error); + + error = kproc_kthread_add(thr_resumer, newthr, &testproc, NULL, 0, 0, + "kthrdlk", "thr_resumer"); + if (error != 0) + panic("cannot start thr_resumer error: %d\n", error); + + error = kproc_kthread_add(thr_suspender, newthr, &testproc, NULL, 0, 0, + "kthrdlk", "thr_suspender"); + if (error != 0) + panic("cannot start thr_suspender error: %d\n", error); +} + +static void +kthrdlk_done(void) +{ + int ret; + DPRINTF(("sending QUIT signal to the thrdlk threads\n")); + + /* wait kernel threads end */ + mtx_lock(&test_global_lock); + QUIT = 1; + while (test_thrcnt != 0) { + ret = mtx_sleep(&global_condvar, &test_global_lock, 0, "waiting thrs end", 30 * hz); + if (ret == EWOULDBLOCK) { + panic("some threads not die! remaing: %d", test_thrcnt); + break; + } + } + if (test_thrcnt == 0) + DPRINTF(("All test_pause threads die\n")); + + mtx_destroy(&test_global_lock); +} + +static int +kthrdlk_handler(module_t mod, int /*modeventtype_t*/ what, + void *arg) +{ + switch (what) { + case MOD_LOAD: + kthrdlk_init(); + uprintf("kthrdlk loaded!\n"); + return (0); + case MOD_UNLOAD: + kthrdlk_done(); + uprintf("Bye Bye! kthrdlk unloaded!\n"); + return (0); + } + + return (EOPNOTSUPP); +} + +static moduledata_t mod_data= { + "kthrdlk", + kthrdlk_handler, + 0 + }; + +MODULE_VERSION(kthrdlk, 1); + +DECLARE_MODULE(kthrdlk, mod_data, SI_SUB_EXEC, SI_ORDER_ANY); + From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 16:13:44 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44F791065676; Sat, 20 Feb 2010 16:13:44 +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 330108FC17; Sat, 20 Feb 2010 16:13: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 o1KGDipB053067; Sat, 20 Feb 2010 16:13:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KGDiiK053065; Sat, 20 Feb 2010 16:13:44 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002201613.o1KGDiiK053065@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 20 Feb 2010 16:13:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204126 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 16:13:44 -0000 Author: nwhitehorn Date: Sat Feb 20 16:13:43 2010 New Revision: 204126 URL: http://svn.freebsd.org/changeset/base/204126 Log: Merge r198724 to Book-E. casuword() non-atomically read the current value of its argument before atomically replacing it, which could occasionally return the wrong value on an SMP system. This resulted in user mutex operations hanging when using threaded applications. Modified: head/sys/powerpc/booke/copyinout.c Modified: head/sys/powerpc/booke/copyinout.c ============================================================================== --- head/sys/powerpc/booke/copyinout.c Sat Feb 20 16:12:37 2010 (r204125) +++ head/sys/powerpc/booke/copyinout.c Sat Feb 20 16:13:43 2010 (r204126) @@ -295,8 +295,19 @@ casuword(volatile u_long *addr, u_long o return (EFAULT); } - val = *addr; - (void) atomic_cmpset_32((volatile uint32_t *)addr, old, new); + __asm __volatile ( + "1:\tlwarx %0, 0, %2\n\t" /* load old value */ + "cmplw %3, %0\n\t" /* compare */ + "bne 2f\n\t" /* exit if not equal */ + "stwcx. %4, 0, %2\n\t" /* attempt to store */ + "bne- 1b\n\t" /* spin if failed */ + "b 3f\n\t" /* we've succeeded */ + "2:\n\t" + "stwcx. %0, 0, %2\n\t" /* clear reservation (74xx) */ + "3:\n\t" + : "=&r" (val), "=m" (*addr) + : "r" (addr), "r" (old), "r" (new), "m" (*addr) + : "cc", "memory"); td->td_pcb->pcb_onfault = NULL; From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 16:14:19 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7E5D1065693; Sat, 20 Feb 2010 16:14:19 +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 D62348FC1E; Sat, 20 Feb 2010 16:14: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 o1KGEJdC053234; Sat, 20 Feb 2010 16:14:19 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KGEJ6p053232; Sat, 20 Feb 2010 16:14:19 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002201614.o1KGEJ6p053232@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 20 Feb 2010 16:14: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: r204127 - head/sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 16:14:20 -0000 Author: nwhitehorn Date: Sat Feb 20 16:14:19 2010 New Revision: 204127 URL: http://svn.freebsd.org/changeset/base/204127 Log: Turn on experimental support for DEEPNAP on the 970MP. Modified: head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Sat Feb 20 16:13:43 2010 (r204126) +++ head/sys/powerpc/powerpc/cpu.c Sat Feb 20 16:14:19 2010 (r204127) @@ -446,8 +446,16 @@ cpu_970_setup(int cpuid, uint16_t vers) : "=r" (hid0_hi), "=r" (hid0_lo) : "K" (SPR_HID0)); /* Configure power-saving mode */ - hid0_hi |= (HID0_NAP | HID0_DPM); - hid0_hi &= ~(HID0_DOZE | HID0_DEEPNAP); + switch (vers) { + case IBM970MP: + hid0_hi |= (HID0_DEEPNAP | HID0_DPM); + hid0_hi &= ~(HID0_DOZE | HID0_NAP); + break; + default: + hid0_hi |= (HID0_NAP | HID0_DPM); + hid0_hi &= ~(HID0_DOZE | HID0_DEEPNAP); + break; + } powerpc_pow_enabled = 1; __asm __volatile (" \ From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 16:23:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C67E8106566B; Sat, 20 Feb 2010 16:23:29 +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 B32368FC14; Sat, 20 Feb 2010 16:23: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 o1KGNTYo055289; Sat, 20 Feb 2010 16:23:29 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KGNTV9055282; Sat, 20 Feb 2010 16:23:29 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002201623.o1KGNTV9055282@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 20 Feb 2010 16:23: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: r204128 - in head/sys/powerpc: aim include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 16:23:30 -0000 Author: nwhitehorn Date: Sat Feb 20 16:23:29 2010 New Revision: 204128 URL: http://svn.freebsd.org/changeset/base/204128 Log: Reduce KVA pressure on OEA64 systems running in bridge mode by mapping UMA segments at their physical addresses instead of into KVA. This emulates the direct mapping behavior of OEA32 in an ad-hoc way. To make this work properly required sharing the entire kernel PMAP with Open Firmware, so ofw_pmap is transformed into a stub on 64-bit CPUs. Also implement some more tweaks to get more mileage out of our limited amount of KVA, principally by extending KVA into segment 16 until the beginning of the first OFW mapping. Reported by: linimon Modified: head/sys/powerpc/aim/machdep.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/uma_machdep.c head/sys/powerpc/include/sr.h head/sys/powerpc/include/vmparam.h Modified: head/sys/powerpc/aim/machdep.c ============================================================================== --- head/sys/powerpc/aim/machdep.c Sat Feb 20 16:14:19 2010 (r204127) +++ head/sys/powerpc/aim/machdep.c Sat Feb 20 16:23:29 2010 (r204128) @@ -198,6 +198,11 @@ cpu_startup(void *dummy) ptoa(physmem) / 1048576); realmem = physmem; + if (bootverbose) + printf("available KVA = %zd (%zd MB)\n", + virtual_end - virtual_avail, + (virtual_end - virtual_avail) / 1048576); + /* * Display any holes after the first chunk of extended memory. */ Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Sat Feb 20 16:14:19 2010 (r204127) +++ head/sys/powerpc/aim/mmu_oea.c Sat Feb 20 16:23:29 2010 (r204128) @@ -909,7 +909,7 @@ moea_bootstrap(mmu_t mmup, vm_offset_t k * Set the start and end of kva. */ virtual_avail = VM_MIN_KERNEL_ADDRESS; - virtual_end = VM_MAX_KERNEL_ADDRESS; + virtual_end = VM_MAX_SAFE_KERNEL_ADDRESS; /* * Allocate a kernel stack with a guard page for thread0 and map it @@ -2413,7 +2413,7 @@ moea_unmapdev(mmu_t mmu, vm_offset_t va, * If this is outside kernel virtual space, then it's a * battable entry and doesn't require unmapping */ - if ((va >= VM_MIN_KERNEL_ADDRESS) && (va <= VM_MAX_KERNEL_ADDRESS)) { + if ((va >= VM_MIN_KERNEL_ADDRESS) && (va <= virtual_end)) { base = trunc_page(va); offset = va & PAGE_MASK; size = roundup(offset + size, PAGE_SIZE); Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sat Feb 20 16:14:19 2010 (r204127) +++ head/sys/powerpc/aim/mmu_oea64.c Sat Feb 20 16:23:29 2010 (r204128) @@ -297,9 +297,6 @@ struct pvo_head moea64_pvo_unmanaged = uma_zone_t moea64_upvo_zone; /* zone for pvo entries for unmanaged pages */ uma_zone_t moea64_mpvo_zone; /* zone for pvo entries for managed pages */ -vm_offset_t pvo_allocator_start; -vm_offset_t pvo_allocator_end; - #define BPVO_POOL_SIZE 327680 static struct pvo_entry *moea64_bpvo_pool; static int moea64_bpvo_pool_index = 0; @@ -699,6 +696,7 @@ moea64_add_ofw_mappings(mmu_t mmup, phan struct ofw_map translations[sz/sizeof(struct ofw_map)]; register_t msr; vm_offset_t off; + vm_paddr_t pa_base; int i, ofw_mappings; bzero(translations, sz); @@ -720,33 +718,18 @@ moea64_add_ofw_mappings(mmu_t mmup, phan if (translations[i].om_pa_hi) panic("OFW translations above 32-bit boundary!"); + pa_base = translations[i].om_pa_lo; + /* Now enter the pages for this mapping */ - /* - * Lock the ofw pmap. pmap_kenter(), which we use for the - * pages the kernel also needs, does its own locking. - */ - PMAP_LOCK(&ofw_pmap); DISABLE_TRANS(msr); for (off = 0; off < translations[i].om_len; off += PAGE_SIZE) { - struct vm_page m; - - /* Map low memory mappings into the kernel pmap, too. - * These are typically mappings made by the loader, - * so we need them if we want to keep executing. */ - - if (translations[i].om_va + off < SEGMENT_LENGTH) - moea64_kenter(mmup, translations[i].om_va + off, - translations[i].om_va + off); - - m.phys_addr = translations[i].om_pa_lo + off; - moea64_enter_locked(&ofw_pmap, - translations[i].om_va + off, &m, VM_PROT_ALL, 1); + moea64_kenter(mmup, translations[i].om_va + off, + pa_base + off); ofw_mappings++; } ENABLE_TRANS(msr); - PMAP_UNLOCK(&ofw_pmap); } } @@ -926,8 +909,8 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o */ moea64_pinit(mmup, &ofw_pmap); - ofw_pmap.pm_sr[KERNEL_SR] = kernel_pmap->pm_sr[KERNEL_SR]; - ofw_pmap.pm_sr[KERNEL2_SR] = kernel_pmap->pm_sr[KERNEL2_SR]; + for (i = 0; i < 16; i++) + ofw_pmap.pm_sr[i] = kernel_pmap->pm_sr[i]; if ((chosen = OF_finddevice("/chosen")) == -1) panic("moea64_bootstrap: can't find /chosen"); @@ -965,15 +948,20 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o * Set the start and end of kva. */ virtual_avail = VM_MIN_KERNEL_ADDRESS; - virtual_end = VM_MAX_KERNEL_ADDRESS; + virtual_end = VM_MAX_SAFE_KERNEL_ADDRESS; /* - * Allocate some stupid buffer regions. + * Figure out how far we can extend virtual_end into segment 16 + * without running into existing mappings. Segment 16 is guaranteed + * to contain neither RAM nor devices (at least on Apple hardware), + * but will generally contain some OFW mappings we should not + * step on. */ - pvo_allocator_start = virtual_avail; - virtual_avail += SEGMENT_LENGTH/4; - pvo_allocator_end = virtual_avail; + PMAP_LOCK(kernel_pmap); + while (moea64_pvo_find_va(kernel_pmap, virtual_end+1, NULL) == NULL) + virtual_end += PAGE_SIZE; + PMAP_UNLOCK(kernel_pmap); /* * Allocate some things for page zeroing @@ -1014,26 +1002,20 @@ moea64_bridge_bootstrap(mmu_t mmup, vm_o * Allocate virtual address space for the message buffer. */ pa = msgbuf_phys = moea64_bootstrap_alloc(MSGBUF_SIZE, PAGE_SIZE); - msgbufp = (struct msgbuf *)virtual_avail; - va = virtual_avail; - virtual_avail += round_page(MSGBUF_SIZE); - while (va < virtual_avail) { - moea64_kenter(mmup, va, pa); + msgbufp = (struct msgbuf *)msgbuf_phys; + while (pa - msgbuf_phys < MSGBUF_SIZE) { + moea64_kenter(mmup, pa, pa); pa += PAGE_SIZE; - va += PAGE_SIZE; } /* * Allocate virtual address space for the dynamic percpu area. */ pa = moea64_bootstrap_alloc(DPCPU_SIZE, PAGE_SIZE); - dpcpu = (void *)virtual_avail; - va = virtual_avail; - virtual_avail += DPCPU_SIZE; - while (va < virtual_avail) { - moea64_kenter(mmup, va, pa); + dpcpu = (void *)pa; + while (pa - (vm_offset_t)dpcpu < DPCPU_SIZE) { + moea64_kenter(mmup, pa, pa); pa += PAGE_SIZE; - va += PAGE_SIZE; } dpcpu_init(dpcpu, 0); } @@ -1412,14 +1394,10 @@ moea64_uma_page_alloc(uma_zone_t zone, i break; } - va = pvo_allocator_start; - pvo_allocator_start += PAGE_SIZE; - - if (pvo_allocator_start >= pvo_allocator_end) - panic("Ran out of PVO allocator buffer space!"); + va = VM_PAGE_TO_PHYS(m); moea64_pvo_enter(kernel_pmap, moea64_upvo_zone, - &moea64_pvo_kunmanaged, va, VM_PAGE_TO_PHYS(m), LPTE_M, + &moea64_pvo_kunmanaged, va, VM_PAGE_TO_PHYS(m), LPTE_M, PVO_WIRED | PVO_BOOTSTRAP); if (needed_lock) @@ -1557,10 +1535,12 @@ moea64_kenter(mmu_t mmu, vm_offset_t va, uint64_t pte_lo; int error; +#if 0 if (!pmap_bootstrapped) { - if (va >= VM_MIN_KERNEL_ADDRESS && va < VM_MAX_KERNEL_ADDRESS) + if (va >= VM_MIN_KERNEL_ADDRESS && va < virtual_end) panic("Trying to enter an address in KVA -- %#x!\n",pa); } +#endif pte_lo = moea64_calc_wimg(pa); Modified: head/sys/powerpc/aim/uma_machdep.c ============================================================================== --- head/sys/powerpc/aim/uma_machdep.c Sat Feb 20 16:14:19 2010 (r204127) +++ head/sys/powerpc/aim/uma_machdep.c Sat Feb 20 16:23:29 2010 (r204128) @@ -56,13 +56,6 @@ uma_small_alloc(uma_zone_t zone, int byt vm_page_t m; int pflags; - if (!hw_direct_map) { - *flags = UMA_SLAB_KMEM; - va = (void *)kmem_malloc(kmem_map, bytes, wait); - - return va; - } - *flags = UMA_SLAB_PRIV; if ((wait & (M_NOWAIT|M_USE_RESERVE)) == M_NOWAIT) pflags = VM_ALLOC_INTERRUPT | VM_ALLOC_WIRED; @@ -82,6 +75,10 @@ uma_small_alloc(uma_zone_t zone, int byt } va = (void *) VM_PAGE_TO_PHYS(m); + + if (!hw_direct_map) + pmap_kenter((vm_offset_t)va, VM_PAGE_TO_PHYS(m)); + if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) bzero(va, PAGE_SIZE); atomic_add_int(&hw_uma_mdpages, 1); @@ -94,13 +91,11 @@ uma_small_free(void *mem, int size, u_in { vm_page_t m; - if (!hw_direct_map) { - kmem_free(kmem_map, (vm_offset_t)mem, size); - - return; - } + if (!hw_direct_map) + pmap_remove(kernel_pmap,(vm_offset_t)mem, + (vm_offset_t)mem + PAGE_SIZE); - m = PHYS_TO_VM_PAGE((u_int32_t)mem); + m = PHYS_TO_VM_PAGE((vm_offset_t)mem); m->wire_count--; vm_page_free(m); atomic_subtract_int(&cnt.v_wire_count, 1); Modified: head/sys/powerpc/include/sr.h ============================================================================== --- head/sys/powerpc/include/sr.h Sat Feb 20 16:14:19 2010 (r204127) +++ head/sys/powerpc/include/sr.h Sat Feb 20 16:23:29 2010 (r204128) @@ -45,6 +45,7 @@ #define USER_SR 12 #define KERNEL_SR 13 #define KERNEL2_SR 14 +#define KERNEL3_SR 15 #define KERNEL_VSIDBITS 0xfffff #define KERNEL_SEGMENT (0xfffff0 + KERNEL_SR) #define KERNEL2_SEGMENT (0xfffff0 + KERNEL2_SR) Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Sat Feb 20 16:14:19 2010 (r204127) +++ head/sys/powerpc/include/vmparam.h Sat Feb 20 16:23:29 2010 (r204128) @@ -98,7 +98,8 @@ #define KERNBASE 0x00100000 /* start of kernel virtual */ #define VM_MIN_KERNEL_ADDRESS ((vm_offset_t)(KERNEL_SR << ADDR_SR_SHFT)) -#define VM_MAX_KERNEL_ADDRESS (VM_MIN_KERNEL_ADDRESS + 2*SEGMENT_LENGTH - 1) +#define VM_MAX_SAFE_KERNEL_ADDRESS (VM_MIN_KERNEL_ADDRESS + 2*SEGMENT_LENGTH -1) +#define VM_MAX_KERNEL_ADDRESS (VM_MIN_KERNEL_ADDRESS + 3*SEGMENT_LENGTH - 1) /* * Use the direct-mapped BAT registers for UMA small allocs. This @@ -106,13 +107,6 @@ */ #define UMA_MD_SMALL_ALLOC -/* - * On 64-bit systems in bridge mode, we have no direct map, so we fake - * the small_alloc() calls. But we need the VM to be in a reasonable - * state first. - */ -#define UMA_MD_SMALL_ALLOC_NEEDS_VM - #else /* From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 16:28:37 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DED2D1065679; Sat, 20 Feb 2010 16:28:37 +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 CD2458FC0A; Sat, 20 Feb 2010 16:28: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 o1KGSbm0056452; Sat, 20 Feb 2010 16:28:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KGSbPO056450; Sat, 20 Feb 2010 16:28:37 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201002201628.o1KGSbPO056450@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 20 Feb 2010 16:28: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: r204129 - head/sys/boot/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 16:28:38 -0000 Author: nwhitehorn Date: Sat Feb 20 16:28:37 2010 New Revision: 204129 URL: http://svn.freebsd.org/changeset/base/204129 Log: Enable NETIF_OPEN_CLOSE_ONCE on PowerPC OFW. This fixes netbooting on PowerPC Book-S hardware, which had been broken for a very long time. Submitted by: Andreas Tobler MFC after: 1 week Modified: head/sys/boot/powerpc/ofw/Makefile Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Sat Feb 20 16:23:29 2010 (r204128) +++ head/sys/boot/powerpc/ofw/Makefile Sat Feb 20 16:28:37 2010 (r204129) @@ -56,6 +56,11 @@ CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../.. LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif +# Avoid the open-close-dance for every file access as some firmwares perform +# an auto-negotiation on every open of the network interface and thus causes +# netbooting to take horribly long. +CFLAGS+= -DNETIF_OPEN_CLOSE_ONCE + # Always add MI sources .PATH: ${.CURDIR}/../../common .include "${.CURDIR}/../../common/Makefile.inc" From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 16:30:29 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB21910656B3; Sat, 20 Feb 2010 16:30:29 +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 98D898FC1C; Sat, 20 Feb 2010 16:30: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 o1KGUTan056897; Sat, 20 Feb 2010 16:30:29 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KGUTlQ056893; Sat, 20 Feb 2010 16:30:29 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201002201630.o1KGUTlQ056893@svn.freebsd.org> From: Randall Stewart Date: Sat, 20 Feb 2010 16:30: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: r204130 - in head/sys/mips: include rmi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 16:30:29 -0000 Author: rrs Date: Sat Feb 20 16:30:29 2010 New Revision: 204130 URL: http://svn.freebsd.org/changeset/base/204130 Log: Some fixes to the current RMI interrupt handling, changes in this patch are: - (cleanup) remove rmi specific 'struct mips_intrhand' - this is no longer needed since 'struct intr_event' have all the required hooks - add xlr_cpu_establish_hardintr, which has args for pre/post ithread and filter hooks, so that the PCI code can add the PCI controller interrupt ack code here - make 'cpu_establish_hardintr' use the above function. - (fix) change type of eirr/eimr from register_t to uint64_t. These have to be 64bit otherwise we cannot handle interrupts from 32. - (fix) use eimr to mask eirr before checking interrupts, so that we will not handle masked interrupts. Obtained from: C. Jayachandran - c.jayachandran@gmail.com Modified: head/sys/mips/include/intr_machdep.h head/sys/mips/rmi/interrupt.h head/sys/mips/rmi/intr_machdep.c Modified: head/sys/mips/include/intr_machdep.h ============================================================================== --- head/sys/mips/include/intr_machdep.h Sat Feb 20 16:28:37 2010 (r204129) +++ head/sys/mips/include/intr_machdep.h Sat Feb 20 16:30:29 2010 (r204130) @@ -30,21 +30,7 @@ #define _MACHINE_INTR_MACHDEP_H_ #ifdef TARGET_XLR_XLS -/* - * XLR/XLS uses its own intr_machdep.c and has - * a different number of interupts. This probably - * should be placed somewhere else. - */ - -struct mips_intrhand { - struct intr_event *mih_event; - driver_intr_t *mih_disable; - volatile long *cntp; /* interrupt counter */ -}; - -extern struct mips_intrhand mips_intr_handlers[]; #define XLR_MAX_INTR 64 - #else #define NHARD_IRQS 6 #define NSOFT_IRQS 2 Modified: head/sys/mips/rmi/interrupt.h ============================================================================== --- head/sys/mips/rmi/interrupt.h Sat Feb 20 16:28:37 2010 (r204129) +++ head/sys/mips/rmi/interrupt.h Sat Feb 20 16:30:29 2010 (r204130) @@ -25,7 +25,7 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * + *__FBSDID("$FreeBSD$") * RMI_BSD */ #ifndef _RMI_INTERRUPT_H_ #define _RMI_INTERRUPT_H_ @@ -39,4 +39,14 @@ #define IRQ_MSGRING 6 #define IRQ_TIMER 7 +/* + * XLR needs custom pre and post handlers for PCI/PCI-e interrupts + * XXX: maybe follow i386 intsrc model + */ +void xlr_cpu_establish_hardintr(const char *, driver_filter_t *, + driver_intr_t *, void *, int, int, void **, void (*)(void *), + void (*)(void *), void (*)(void *), int (*)(void *, u_char)); +void xlr_mask_hard_irq(void *); +void xlr_unmask_hard_irq(void *); + #endif /* _RMI_INTERRUPT_H_ */ Modified: head/sys/mips/rmi/intr_machdep.c ============================================================================== --- head/sys/mips/rmi/intr_machdep.c Sat Feb 20 16:28:37 2010 (r204129) +++ head/sys/mips/rmi/intr_machdep.c Sat Feb 20 16:30:29 2010 (r204130) @@ -51,19 +51,19 @@ __FBSDID("$FreeBSD$"); /*#include */ static mips_intrcnt_t mips_intr_counters[XLR_MAX_INTR]; -struct mips_intrhand mips_intr_handlers[XLR_MAX_INTR]; +static struct intr_event *mips_intr_events[XLR_MAX_INTR]; static int intrcnt_index; -static void -mips_mask_hard_irq(void *source) +void +xlr_mask_hard_irq(void *source) { uintptr_t irq = (uintptr_t) source; write_c0_eimr64(read_c0_eimr64() & ~(1ULL << irq)); } -static void -mips_unmask_hard_irq(void *source) +void +xlr_unmask_hard_irq(void *source) { uintptr_t irq = (uintptr_t) source; @@ -71,10 +71,11 @@ mips_unmask_hard_irq(void *source) } void -cpu_establish_hardintr(const char *name, driver_filter_t * filt, - void (*handler) (void *), void *arg, int irq, int flags, void **cookiep) +xlr_cpu_establish_hardintr(const char *name, driver_filter_t * filt, + void (*handler) (void *), void *arg, int irq, int flags, void **cookiep, + void (*pre_ithread)(void *), void (*post_ithread)(void *), + void (*post_filter)(void *), int (*assign_cpu)(void *, u_char)) { - struct mips_intrhand *mih; /* descriptor for the IRQ */ struct intr_event *ie; /* descriptor for the IRQ */ int errcode; @@ -85,25 +86,33 @@ cpu_establish_hardintr(const char *name, * FIXME locking - not needed now, because we do this only on * startup from CPU0 */ - mih = &mips_intr_handlers[irq]; + ie = mips_intr_events[irq]; /* mih->cntp = &intrcnt[irq]; */ - ie = mih->mih_event; if (ie == NULL) { errcode = intr_event_create(&ie, (void *)(uintptr_t) irq, 0, - irq, mips_mask_hard_irq, mips_unmask_hard_irq, - NULL, NULL, "hard intr%d:", irq); + irq, pre_ithread, post_ithread, post_filter, assign_cpu, + "hard intr%d:", irq); if (errcode) { printf("Could not create event for intr %d\n", irq); return; } + mips_intr_events[irq] = ie; } + intr_event_add_handler(ie, name, filt, handler, arg, intr_priority(flags), flags, cookiep); - mih->mih_event = ie; - mips_unmask_hard_irq((void *)(uintptr_t) irq); + xlr_unmask_hard_irq((void *)(uintptr_t) irq); } +void +cpu_establish_hardintr(const char *name, driver_filter_t * filt, + void (*handler) (void *), void *arg, int irq, int flags, void **cookiep) +{ + xlr_cpu_establish_hardintr(name, filt, handler, arg, irq, + flags, cookiep, xlr_mask_hard_irq, xlr_unmask_hard_irq, + NULL, NULL); +} void cpu_establish_softintr(const char *name, driver_filter_t * filt, @@ -111,20 +120,26 @@ cpu_establish_softintr(const char *name, void **cookiep) { /* we don't separate them into soft/hard like other mips */ - cpu_establish_hardintr(name, filt, handler, arg, irq, flags, cookiep); + xlr_cpu_establish_hardintr(name, filt, handler, arg, irq, + flags, cookiep, xlr_mask_hard_irq, xlr_unmask_hard_irq, + NULL, NULL); } void cpu_intr(struct trapframe *tf) { - struct mips_intrhand *mih; struct intr_event *ie; - register_t eirr; + uint64_t eirr, eimr; int i; critical_enter(); + + /* find a list of enabled interrupts */ eirr = read_c0_eirr64(); - if (eirr == 0) { + eimr = read_c0_eimr64(); + eirr &= eimr; + + if (eirr == 0) { critical_exit(); return; } @@ -162,9 +177,8 @@ cpu_intr(struct trapframe *tf) } #endif #endif - mih = &mips_intr_handlers[i]; + ie = mips_intr_events[i]; /* atomic_add_long(mih->cntp, 1); */ - ie = mih->mih_event; write_c0_eirr64(1ULL << i); pic_ack(i, 0); From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 16:32:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B218106566B; Sat, 20 Feb 2010 16:32:34 +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 188FE8FC13; Sat, 20 Feb 2010 16:32: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 o1KGWXTQ057400; Sat, 20 Feb 2010 16:32:33 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KGWXF7057398; Sat, 20 Feb 2010 16:32:33 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201002201632.o1KGWXF7057398@svn.freebsd.org> From: Randall Stewart Date: Sat, 20 Feb 2010 16:32: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: r204131 - head/sys/mips/rmi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 16:32:34 -0000 Author: rrs Date: Sat Feb 20 16:32:33 2010 New Revision: 204131 URL: http://svn.freebsd.org/changeset/base/204131 Log: Cleanups for sys/mips/rmi/bus_space_rmi.c - remove pci related code from bus_space_rmi.c, we will have another file for PCI bus space functions which will do byte-swapping. - remove local SWAP implementation - added TODO stub for unimplemented functions Obtained from: C. Jayachandran - c.jayachandran@gmail.com Modified: head/sys/mips/rmi/bus_space_rmi.c Modified: head/sys/mips/rmi/bus_space_rmi.c ============================================================================== --- head/sys/mips/rmi/bus_space_rmi.c Sat Feb 20 16:30:29 2010 (r204130) +++ head/sys/mips/rmi/bus_space_rmi.c Sat Feb 20 16:32:33 2010 (r204131) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -42,14 +43,12 @@ __FBSDID("$FreeBSD$"); #include #include -void xlr_print_int(uint32_t); static int rmi_bus_space_map(void *t, bus_addr_t addr, bus_size_t size, int flags, bus_space_handle_t * bshp); - static void rmi_bus_space_unmap(void *t, bus_space_handle_t bsh, bus_size_t size); @@ -132,6 +131,7 @@ rmi_bus_space_write_multi_1(void *t, bus_size_t offset, const u_int8_t * addr, size_t count); + static void rmi_bus_space_write_multi_2(void *t, bus_space_handle_t handle, @@ -176,7 +176,6 @@ static void rmi_bus_space_barrier(void *tag __unused, bus_space_handle_t bsh __unused, bus_size_t offset __unused, bus_size_t len __unused, int flags); - static void rmi_bus_space_copy_region_2(void *t, bus_space_handle_t bsh1, @@ -244,7 +243,8 @@ rmi_bus_space_write_multi_stream_4(void const u_int32_t * addr, size_t count); - +#define TODO() printf("XLR memory bus space function '%s' unimplemented\n", __func__) + static struct bus_space local_rmi_bus_space = { /* cookie */ (void *)0, @@ -355,27 +355,9 @@ static struct bus_space local_rmi_bus_sp /* generic bus_space tag */ bus_space_tag_t rmi_bus_space = &local_rmi_bus_space; -#define MIPS_BUS_SPACE_IO 0 /* space is i/o space */ -#define MIPS_BUS_SPACE_MEM 1 /* space is mem space */ -#define MIPS_BUS_SPACE_PCI 10 /* avoid conflict with other spaces */ - -#define BUS_SPACE_UNRESTRICTED (~0) - -#define SWAP32(x)\ - (((x) & 0xff000000) >> 24) | \ - (((x) & 0x000000ff) << 24) | \ - (((x) & 0x0000ff00) << 8) | \ - (((x) & 0x00ff0000) >> 8) - -#define SWAP16(x)\ - (((x) & 0xff00) >> 8) | \ - (((x) & 0x00ff) << 8) - /* * Map a region of device bus space into CPU virtual address space. */ - - static int rmi_bus_space_map(void *t __unused, bus_addr_t addr, bus_size_t size __unused, int flags __unused, @@ -417,34 +399,24 @@ static u_int8_t rmi_bus_space_read_1(void *tag, bus_space_handle_t handle, bus_size_t offset) { - if ((int)tag == MIPS_BUS_SPACE_PCI) - return (u_int8_t) (*(volatile u_int8_t *)(handle + offset)); - else - return (u_int8_t) (*(volatile u_int32_t *)(handle + offset)); + return (u_int8_t) (*(volatile u_int32_t *)(handle + offset)); } static u_int16_t rmi_bus_space_read_2(void *tag, bus_space_handle_t handle, bus_size_t offset) { - if ((int)tag == MIPS_BUS_SPACE_PCI) - return SWAP16((u_int16_t) (*(volatile u_int16_t *)(handle + offset))); - else - return *(volatile u_int16_t *)(handle + offset); + return (u_int16_t)(*(volatile u_int32_t *)(handle + offset)); } static u_int32_t rmi_bus_space_read_4(void *tag, bus_space_handle_t handle, bus_size_t offset) { - if ((int)tag == MIPS_BUS_SPACE_PCI) - return SWAP32((*(volatile u_int32_t *)(handle + offset))); - else - return (*(volatile u_int32_t *)(handle + offset)); + return (*(volatile u_int32_t *)(handle + offset)); } - /* * Read `count' 1, 2, 4, or 8 byte quantities from bus space * described by tag/handle/offset and copy into buffer provided. @@ -453,41 +425,21 @@ static void rmi_bus_space_read_multi_1(void *tag, bus_space_handle_t handle, bus_size_t offset, u_int8_t * addr, size_t count) { - - if ((int)tag != MIPS_BUS_SPACE_PCI) - return; - while (count--) { - *addr = (*(volatile u_int8_t *)(handle + offset)); - addr++; - } + TODO(); } static void rmi_bus_space_read_multi_2(void *tag, bus_space_handle_t handle, bus_size_t offset, u_int16_t * addr, size_t count) { - - if ((int)tag != MIPS_BUS_SPACE_PCI) - return; - while (count--) { - *addr = *(volatile u_int16_t *)(handle + offset); - *addr = SWAP16(*addr); - addr++; - } + TODO(); } static void rmi_bus_space_read_multi_4(void *tag, bus_space_handle_t handle, bus_size_t offset, u_int32_t * addr, size_t count) { - - if ((int)tag != MIPS_BUS_SPACE_PCI) - return; - while (count--) { - *addr = *(volatile u_int32_t *)(handle + offset); - *addr = SWAP32(*addr); - addr++; - } + TODO(); } /* @@ -495,43 +447,28 @@ rmi_bus_space_read_multi_4(void *tag, bu * described by tag/handle/offset. */ - static void rmi_bus_space_write_1(void *tag, bus_space_handle_t handle, bus_size_t offset, u_int8_t value) { - mips_sync(); - if ((int)tag == MIPS_BUS_SPACE_PCI) - *(volatile u_int8_t *)(handle + offset) = value; - else - *(volatile u_int32_t *)(handle + offset) = (u_int32_t) value; + *(volatile u_int32_t *)(handle + offset) = (u_int32_t)value; } static void rmi_bus_space_write_2(void *tag, bus_space_handle_t handle, bus_size_t offset, u_int16_t value) { - mips_sync(); - if ((int)tag == MIPS_BUS_SPACE_PCI) { - *(volatile u_int16_t *)(handle + offset) = SWAP16(value); - } else - *(volatile u_int16_t *)(handle + offset) = value; + *(volatile u_int32_t *)(handle + offset) = (u_int32_t)value; } - static void rmi_bus_space_write_4(void *tag, bus_space_handle_t handle, bus_size_t offset, u_int32_t value) { - mips_sync(); - if ((int)tag == MIPS_BUS_SPACE_PCI) { - *(volatile u_int32_t *)(handle + offset) = SWAP32(value); - } else - *(volatile u_int32_t *)(handle + offset) = value; + *(volatile u_int32_t *)(handle + offset) = value; } - /* * Write `count' 1, 2, 4, or 8 byte quantities from the buffer * provided to bus space described by tag/handle/offset. @@ -542,39 +479,21 @@ static void rmi_bus_space_write_multi_1(void *tag, bus_space_handle_t handle, bus_size_t offset, const u_int8_t * addr, size_t count) { - mips_sync(); - if ((int)tag != MIPS_BUS_SPACE_PCI) - return; - while (count--) { - (*(volatile u_int8_t *)(handle + offset)) = *addr; - addr++; - } + TODO(); } static void rmi_bus_space_write_multi_2(void *tag, bus_space_handle_t handle, bus_size_t offset, const u_int16_t * addr, size_t count) { - mips_sync(); - if ((int)tag != MIPS_BUS_SPACE_PCI) - return; - while (count--) { - (*(volatile u_int16_t *)(handle + offset)) = SWAP16(*addr); - addr++; - } + TODO(); } static void rmi_bus_space_write_multi_4(void *tag, bus_space_handle_t handle, bus_size_t offset, const u_int32_t * addr, size_t count) { - mips_sync(); - if ((int)tag != MIPS_BUS_SPACE_PCI) - return; - while (count--) { - (*(volatile u_int32_t *)(handle + offset)) = SWAP32(*addr); - addr++; - } + TODO(); } /* @@ -589,7 +508,7 @@ rmi_bus_space_set_region_2(void *t, bus_ bus_addr_t addr = bsh + offset; for (; count != 0; count--, addr += 2) - (*(volatile u_int16_t *)(addr)) = value; + (*(volatile u_int32_t *)(addr)) = value; } static void @@ -649,43 +568,24 @@ static void rmi_bus_space_read_multi_stream_1(void *tag, bus_space_handle_t handle, bus_size_t offset, u_int8_t * addr, size_t count) { - - if ((int)tag != MIPS_BUS_SPACE_PCI) - return; - while (count--) { - *addr = (*(volatile u_int8_t *)(handle + offset)); - addr++; - } + TODO(); } static void rmi_bus_space_read_multi_stream_2(void *tag, bus_space_handle_t handle, bus_size_t offset, u_int16_t * addr, size_t count) { - - if ((int)tag != MIPS_BUS_SPACE_PCI) - return; - while (count--) { - *addr = (*(volatile u_int16_t *)(handle + offset)); - addr++; - } + TODO(); } static void rmi_bus_space_read_multi_stream_4(void *tag, bus_space_handle_t handle, bus_size_t offset, u_int32_t * addr, size_t count) { - - if ((int)tag != MIPS_BUS_SPACE_PCI) - return; - while (count--) { - *addr = (*(volatile u_int32_t *)(handle + offset)); - addr++; - } + TODO(); } - /* * Read `count' 1, 2, 4, or 8 byte quantities from bus space * described by tag/handle and starting at `offset' and copy into @@ -695,24 +595,14 @@ void rmi_bus_space_read_region_1(void *t, bus_space_handle_t bsh, bus_size_t offset, u_int8_t * addr, size_t count) { - bus_addr_t baddr = bsh + offset; - - while (count--) { - *addr++ = (*(volatile u_int8_t *)(baddr)); - baddr += 1; - } + TODO(); } void rmi_bus_space_read_region_2(void *t, bus_space_handle_t bsh, bus_size_t offset, u_int16_t * addr, size_t count) { - bus_addr_t baddr = bsh + offset; - - while (count--) { - *addr++ = (*(volatile u_int16_t *)(baddr)); - baddr += 2; - } + TODO(); } void @@ -727,13 +617,11 @@ rmi_bus_space_read_region_4(void *t, bus } } - void rmi_bus_space_write_stream_1(void *t, bus_space_handle_t handle, bus_size_t offset, u_int8_t value) { - mips_sync(); - *(volatile u_int8_t *)(handle + offset) = value; + TODO(); } @@ -741,8 +629,7 @@ static void rmi_bus_space_write_stream_2(void *t, bus_space_handle_t handle, bus_size_t offset, u_int16_t value) { - mips_sync(); - *(volatile u_int16_t *)(handle + offset) = value; + TODO(); } @@ -750,8 +637,7 @@ static void rmi_bus_space_write_stream_4(void *t, bus_space_handle_t handle, bus_size_t offset, u_int32_t value) { - mips_sync(); - *(volatile u_int32_t *)(handle + offset) = value; + TODO(); } @@ -759,39 +645,21 @@ static void rmi_bus_space_write_multi_stream_1(void *tag, bus_space_handle_t handle, bus_size_t offset, const u_int8_t * addr, size_t count) { - mips_sync(); - if ((int)tag != MIPS_BUS_SPACE_PCI) - return; - while (count--) { - (*(volatile u_int8_t *)(handle + offset)) = *addr; - addr++; - } + TODO(); } static void rmi_bus_space_write_multi_stream_2(void *tag, bus_space_handle_t handle, bus_size_t offset, const u_int16_t * addr, size_t count) { - mips_sync(); - if ((int)tag != MIPS_BUS_SPACE_PCI) - return; - while (count--) { - (*(volatile u_int16_t *)(handle + offset)) = *addr; - addr++; - } + TODO(); } static void rmi_bus_space_write_multi_stream_4(void *tag, bus_space_handle_t handle, bus_size_t offset, const u_int32_t * addr, size_t count) { - mips_sync(); - if ((int)tag != MIPS_BUS_SPACE_PCI) - return; - while (count--) { - (*(volatile u_int32_t *)(handle + offset)) = *addr; - addr++; - } + TODO(); } void @@ -801,31 +669,18 @@ rmi_bus_space_write_region_2(void *t, const u_int16_t * addr, size_t count) { - bus_addr_t baddr = (bus_addr_t) bsh + offset; - - while (count--) { - (*(volatile u_int16_t *)(baddr)) = *addr; - addr++; - baddr += 2; - } + TODO(); } void rmi_bus_space_write_region_4(void *t, bus_space_handle_t bsh, bus_size_t offset, const u_int32_t * addr, size_t count) { - bus_addr_t baddr = bsh + offset; - - while (count--) { - (*(volatile u_int32_t *)(baddr)) = *addr; - addr++; - baddr += 4; - } + TODO(); } static void rmi_bus_space_barrier(void *tag __unused, bus_space_handle_t bsh __unused, bus_size_t offset __unused, bus_size_t len __unused, int flags) { - } From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 17:12:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A8361065676; Sat, 20 Feb 2010 17:12:07 +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 6750A8FC08; Sat, 20 Feb 2010 17:12: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 o1KHC72F066480; Sat, 20 Feb 2010 17:12:07 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KHC7vR066478; Sat, 20 Feb 2010 17:12:07 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201002201712.o1KHC7vR066478@svn.freebsd.org> From: Randall Stewart Date: Sat, 20 Feb 2010 17:12: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: r204135 - head/sys/mips/rmi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 17:12:07 -0000 Author: rrs Date: Sat Feb 20 17:12:07 2010 New Revision: 204135 URL: http://svn.freebsd.org/changeset/base/204135 Log: Opps forgot to add this: - add bus_space_rmi_pci.c for PCI bus space Obtained from: C. Jayachandran - Added: head/sys/mips/rmi/bus_space_rmi_pci.c (contents, props changed) Added: head/sys/mips/rmi/bus_space_rmi_pci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/rmi/bus_space_rmi_pci.c Sat Feb 20 17:12:07 2010 (r204135) @@ -0,0 +1,760 @@ +/*- + * Copyright (c) 2009 RMI Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +static int +rmi_pci_bus_space_map(void *t, bus_addr_t addr, + bus_size_t size, int flags, + bus_space_handle_t * bshp); + +static void +rmi_pci_bus_space_unmap(void *t, bus_space_handle_t bsh, + bus_size_t size); + +static int +rmi_pci_bus_space_subregion(void *t, + bus_space_handle_t bsh, + bus_size_t offset, bus_size_t size, + bus_space_handle_t * nbshp); + +static u_int8_t +rmi_pci_bus_space_read_1(void *t, + bus_space_handle_t handle, + bus_size_t offset); + +static u_int16_t +rmi_pci_bus_space_read_2(void *t, + bus_space_handle_t handle, + bus_size_t offset); + +static u_int32_t +rmi_pci_bus_space_read_4(void *t, + bus_space_handle_t handle, + bus_size_t offset); + +static void +rmi_pci_bus_space_read_multi_1(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int8_t * addr, + size_t count); + +static void +rmi_pci_bus_space_read_multi_2(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int16_t * addr, + size_t count); + +static void +rmi_pci_bus_space_read_multi_4(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int32_t * addr, + size_t count); + +static void +rmi_pci_bus_space_read_region_1(void *t, + bus_space_handle_t bsh, + bus_size_t offset, u_int8_t * addr, + size_t count); + +static void +rmi_pci_bus_space_read_region_2(void *t, + bus_space_handle_t bsh, + bus_size_t offset, u_int16_t * addr, + size_t count); + +static void +rmi_pci_bus_space_read_region_4(void *t, + bus_space_handle_t bsh, + bus_size_t offset, u_int32_t * addr, + size_t count); + +static void +rmi_pci_bus_space_write_1(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int8_t value); + +static void +rmi_pci_bus_space_write_2(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int16_t value); + +static void +rmi_pci_bus_space_write_4(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int32_t value); + +static void +rmi_pci_bus_space_write_multi_1(void *t, + bus_space_handle_t handle, + bus_size_t offset, + const u_int8_t * addr, + size_t count); + +static void +rmi_pci_bus_space_write_multi_2(void *t, + bus_space_handle_t handle, + bus_size_t offset, + const u_int16_t * addr, + size_t count); + +static void +rmi_pci_bus_space_write_multi_4(void *t, + bus_space_handle_t handle, + bus_size_t offset, + const u_int32_t * addr, + size_t count); + +static void +rmi_pci_bus_space_write_region_2(void *t, + bus_space_handle_t bsh, + bus_size_t offset, + const u_int16_t * addr, + size_t count); + +static void +rmi_pci_bus_space_write_region_4(void *t, + bus_space_handle_t bsh, + bus_size_t offset, + const u_int32_t * addr, + size_t count); + + +static void +rmi_pci_bus_space_set_region_2(void *t, + bus_space_handle_t bsh, + bus_size_t offset, u_int16_t value, + size_t count); +static void +rmi_pci_bus_space_set_region_4(void *t, + bus_space_handle_t bsh, + bus_size_t offset, u_int32_t value, + size_t count); + +static void +rmi_pci_bus_space_barrier(void *tag __unused, bus_space_handle_t bsh __unused, + bus_size_t offset __unused, bus_size_t len __unused, int flags); + +static void +rmi_pci_bus_space_copy_region_2(void *t, + bus_space_handle_t bsh1, + bus_size_t off1, + bus_space_handle_t bsh2, + bus_size_t off2, size_t count); + +u_int8_t +rmi_pci_bus_space_read_stream_1(void *t, bus_space_handle_t handle, + bus_size_t offset); + +static u_int16_t +rmi_pci_bus_space_read_stream_2(void *t, bus_space_handle_t handle, + bus_size_t offset); + +static u_int32_t +rmi_pci_bus_space_read_stream_4(void *t, bus_space_handle_t handle, + bus_size_t offset); +static void +rmi_pci_bus_space_read_multi_stream_1(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int8_t * addr, + size_t count); + +static void +rmi_pci_bus_space_read_multi_stream_2(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int16_t * addr, + size_t count); + +static void +rmi_pci_bus_space_read_multi_stream_4(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int32_t * addr, + size_t count); + +void +rmi_pci_bus_space_write_stream_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, u_int8_t value); +static void +rmi_pci_bus_space_write_stream_2(void *t, bus_space_handle_t handle, + bus_size_t offset, u_int16_t value); + +static void +rmi_pci_bus_space_write_stream_4(void *t, bus_space_handle_t handle, + bus_size_t offset, u_int32_t value); + +static void +rmi_pci_bus_space_write_multi_stream_1(void *t, + bus_space_handle_t handle, + bus_size_t offset, + const u_int8_t * addr, + size_t count); +static void +rmi_pci_bus_space_write_multi_stream_2(void *t, + bus_space_handle_t handle, + bus_size_t offset, + const u_int16_t * addr, + size_t count); + +static void +rmi_pci_bus_space_write_multi_stream_4(void *t, + bus_space_handle_t handle, + bus_size_t offset, + const u_int32_t * addr, + size_t count); + +#define TODO() printf("XLR memory bus space function '%s' unimplemented\n", __func__) + +static struct bus_space local_rmi_pci_bus_space = { + /* cookie */ + (void *)0, + + /* mapping/unmapping */ + rmi_pci_bus_space_map, + rmi_pci_bus_space_unmap, + rmi_pci_bus_space_subregion, + + /* allocation/deallocation */ + NULL, + NULL, + + /* barrier */ + rmi_pci_bus_space_barrier, + + /* read (single) */ + rmi_pci_bus_space_read_1, + rmi_pci_bus_space_read_2, + rmi_pci_bus_space_read_4, + NULL, + + /* read multiple */ + rmi_pci_bus_space_read_multi_1, + rmi_pci_bus_space_read_multi_2, + rmi_pci_bus_space_read_multi_4, + NULL, + + /* read region */ + rmi_pci_bus_space_read_region_1, + rmi_pci_bus_space_read_region_2, + rmi_pci_bus_space_read_region_4, + NULL, + + /* write (single) */ + rmi_pci_bus_space_write_1, + rmi_pci_bus_space_write_2, + rmi_pci_bus_space_write_4, + NULL, + + /* write multiple */ + rmi_pci_bus_space_write_multi_1, + rmi_pci_bus_space_write_multi_2, + rmi_pci_bus_space_write_multi_4, + NULL, + + /* write region */ + NULL, + rmi_pci_bus_space_write_region_2, + rmi_pci_bus_space_write_region_4, + NULL, + + /* set multiple */ + NULL, + NULL, + NULL, + NULL, + + /* set region */ + NULL, + rmi_pci_bus_space_set_region_2, + rmi_pci_bus_space_set_region_4, + NULL, + + /* copy */ + NULL, + rmi_pci_bus_space_copy_region_2, + NULL, + NULL, + + /* read (single) stream */ + rmi_pci_bus_space_read_stream_1, + rmi_pci_bus_space_read_stream_2, + rmi_pci_bus_space_read_stream_4, + NULL, + + /* read multiple stream */ + rmi_pci_bus_space_read_multi_stream_1, + rmi_pci_bus_space_read_multi_stream_2, + rmi_pci_bus_space_read_multi_stream_4, + NULL, + + /* read region stream */ + rmi_pci_bus_space_read_region_1, + rmi_pci_bus_space_read_region_2, + rmi_pci_bus_space_read_region_4, + NULL, + + /* write (single) stream */ + rmi_pci_bus_space_write_stream_1, + rmi_pci_bus_space_write_stream_2, + rmi_pci_bus_space_write_stream_4, + NULL, + + /* write multiple stream */ + rmi_pci_bus_space_write_multi_stream_1, + rmi_pci_bus_space_write_multi_stream_2, + rmi_pci_bus_space_write_multi_stream_4, + NULL, + + /* write region stream */ + NULL, + rmi_pci_bus_space_write_region_2, + rmi_pci_bus_space_write_region_4, + NULL, +}; + +/* generic bus_space tag */ +bus_space_tag_t rmi_pci_bus_space = &local_rmi_pci_bus_space; + +/* + * Map a region of device bus space into CPU virtual address space. + */ +static int +rmi_pci_bus_space_map(void *t __unused, bus_addr_t addr, + bus_size_t size __unused, int flags __unused, + bus_space_handle_t * bshp) +{ + *bshp = addr; + return (0); +} + +/* + * Unmap a region of device bus space. + */ +static void +rmi_pci_bus_space_unmap(void *t __unused, bus_space_handle_t bsh __unused, + bus_size_t size __unused) +{ +} + +/* + * Get a new handle for a subregion of an already-mapped area of bus space. + */ + +static int +rmi_pci_bus_space_subregion(void *t __unused, bus_space_handle_t bsh, + bus_size_t offset, bus_size_t size __unused, + bus_space_handle_t * nbshp) +{ + *nbshp = bsh + offset; + return (0); +} + +/* + * Read a 1, 2, 4, or 8 byte quantity from bus space + * described by tag/handle/offset. + */ + +static u_int8_t +rmi_pci_bus_space_read_1(void *tag, bus_space_handle_t handle, + bus_size_t offset) +{ + return (u_int8_t) (*(volatile u_int8_t *)(handle + offset)); +} + +static u_int16_t +rmi_pci_bus_space_read_2(void *tag, bus_space_handle_t handle, + bus_size_t offset) +{ + return bswap16((u_int16_t) (*(volatile u_int16_t *)(handle + offset))); +} + +static u_int32_t +rmi_pci_bus_space_read_4(void *tag, bus_space_handle_t handle, + bus_size_t offset) +{ + return bswap32((*(volatile u_int32_t *)(handle + offset))); +} + + +/* + * Read `count' 1, 2, 4, or 8 byte quantities from bus space + * described by tag/handle/offset and copy into buffer provided. + */ +static void +rmi_pci_bus_space_read_multi_1(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int8_t * addr, size_t count) +{ + while (count--) { + *addr = (*(volatile u_int8_t *)(handle + offset)); + addr++; + } +} + +static void +rmi_pci_bus_space_read_multi_2(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int16_t * addr, size_t count) +{ + + while (count--) { + *addr = *(volatile u_int16_t *)(handle + offset); + *addr = bswap16(*addr); + addr++; + } +} + +static void +rmi_pci_bus_space_read_multi_4(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int32_t * addr, size_t count) +{ + + while (count--) { + *addr = *(volatile u_int32_t *)(handle + offset); + *addr = bswap32(*addr); + addr++; + } +} + +/* + * Write the 1, 2, 4, or 8 byte value `value' to bus space + * described by tag/handle/offset. + */ + +static void +rmi_pci_bus_space_write_1(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int8_t value) +{ + mips_sync(); + *(volatile u_int8_t *)(handle + offset) = value; +} + +static void +rmi_pci_bus_space_write_2(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int16_t value) +{ + mips_sync(); + *(volatile u_int16_t *)(handle + offset) = bswap16(value); +} + + +static void +rmi_pci_bus_space_write_4(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int32_t value) +{ + mips_sync(); + *(volatile u_int32_t *)(handle + offset) = bswap32(value); +} + +/* + * Write `count' 1, 2, 4, or 8 byte quantities from the buffer + * provided to bus space described by tag/handle/offset. + */ + + +static void +rmi_pci_bus_space_write_multi_1(void *tag, bus_space_handle_t handle, + bus_size_t offset, const u_int8_t * addr, size_t count) +{ + mips_sync(); + while (count--) { + (*(volatile u_int8_t *)(handle + offset)) = *addr; + addr++; + } +} + +static void +rmi_pci_bus_space_write_multi_2(void *tag, bus_space_handle_t handle, + bus_size_t offset, const u_int16_t * addr, size_t count) +{ + mips_sync(); + while (count--) { + (*(volatile u_int16_t *)(handle + offset)) = bswap16(*addr); + addr++; + } +} + +static void +rmi_pci_bus_space_write_multi_4(void *tag, bus_space_handle_t handle, + bus_size_t offset, const u_int32_t * addr, size_t count) +{ + mips_sync(); + while (count--) { + (*(volatile u_int32_t *)(handle + offset)) = bswap32(*addr); + addr++; + } +} + +/* + * Write `count' 1, 2, 4, or 8 byte value `val' to bus space described + * by tag/handle starting at `offset'. + */ + +static void +rmi_pci_bus_space_set_region_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, u_int16_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + for (; count != 0; count--, addr += 2) + (*(volatile u_int16_t *)(addr)) = value; +} + +static void +rmi_pci_bus_space_set_region_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, u_int32_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + for (; count != 0; count--, addr += 4) + (*(volatile u_int32_t *)(addr)) = value; +} + + +/* + * Copy `count' 1, 2, 4, or 8 byte values from bus space starting + * at tag/bsh1/off1 to bus space starting at tag/bsh2/off2. + */ +static void +rmi_pci_bus_space_copy_region_2(void *t, bus_space_handle_t bsh1, + bus_size_t off1, bus_space_handle_t bsh2, + bus_size_t off2, size_t count) +{ + TODO(); +} + +/* + * Read `count' 1, 2, 4, or 8 byte quantities from bus space + * described by tag/handle/offset and copy into buffer provided. + */ + +u_int8_t +rmi_pci_bus_space_read_stream_1(void *t, bus_space_handle_t handle, + bus_size_t offset) +{ + + return *((volatile u_int8_t *)(handle + offset)); +} + + +static u_int16_t +rmi_pci_bus_space_read_stream_2(void *t, bus_space_handle_t handle, + bus_size_t offset) +{ + return *(volatile u_int16_t *)(handle + offset); +} + + +static u_int32_t +rmi_pci_bus_space_read_stream_4(void *t, bus_space_handle_t handle, + bus_size_t offset) +{ + return (*(volatile u_int32_t *)(handle + offset)); +} + + +static void +rmi_pci_bus_space_read_multi_stream_1(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int8_t * addr, size_t count) +{ + while (count--) { + *addr = (*(volatile u_int8_t *)(handle + offset)); + addr++; + } +} + +static void +rmi_pci_bus_space_read_multi_stream_2(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int16_t * addr, size_t count) +{ + while (count--) { + *addr = (*(volatile u_int16_t *)(handle + offset)); + addr++; + } +} + +static void +rmi_pci_bus_space_read_multi_stream_4(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int32_t * addr, size_t count) +{ + while (count--) { + *addr = (*(volatile u_int32_t *)(handle + offset)); + addr++; + } +} + + + +/* + * Read `count' 1, 2, 4, or 8 byte quantities from bus space + * described by tag/handle and starting at `offset' and copy into + * buffer provided. + */ +void +rmi_pci_bus_space_read_region_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, u_int8_t * addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + *addr++ = (*(volatile u_int8_t *)(baddr)); + baddr += 1; + } +} + +void +rmi_pci_bus_space_read_region_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, u_int16_t * addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + *addr++ = (*(volatile u_int16_t *)(baddr)); + baddr += 2; + } +} + +void +rmi_pci_bus_space_read_region_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, u_int32_t * addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + *addr++ = (*(volatile u_int32_t *)(baddr)); + baddr += 4; + } +} + + +void +rmi_pci_bus_space_write_stream_1(void *t, bus_space_handle_t handle, + bus_size_t offset, u_int8_t value) +{ + mips_sync(); + *(volatile u_int8_t *)(handle + offset) = value; +} + +static void +rmi_pci_bus_space_write_stream_2(void *t, bus_space_handle_t handle, + bus_size_t offset, u_int16_t value) +{ + mips_sync(); + *(volatile u_int16_t *)(handle + offset) = value; +} + + +static void +rmi_pci_bus_space_write_stream_4(void *t, bus_space_handle_t handle, + bus_size_t offset, u_int32_t value) +{ + mips_sync(); + *(volatile u_int32_t *)(handle + offset) = value; +} + + +static void +rmi_pci_bus_space_write_multi_stream_1(void *tag, bus_space_handle_t handle, + bus_size_t offset, const u_int8_t * addr, size_t count) +{ + mips_sync(); + while (count--) { + (*(volatile u_int8_t *)(handle + offset)) = *addr; + addr++; + } +} + +static void +rmi_pci_bus_space_write_multi_stream_2(void *tag, bus_space_handle_t handle, + bus_size_t offset, const u_int16_t * addr, size_t count) +{ + mips_sync(); + while (count--) { + (*(volatile u_int16_t *)(handle + offset)) = *addr; + addr++; + } +} + +static void +rmi_pci_bus_space_write_multi_stream_4(void *tag, bus_space_handle_t handle, + bus_size_t offset, const u_int32_t * addr, size_t count) +{ + mips_sync(); + while (count--) { + (*(volatile u_int32_t *)(handle + offset)) = *addr; + addr++; + } +} + +void +rmi_pci_bus_space_write_region_2(void *t, + bus_space_handle_t bsh, + bus_size_t offset, + const u_int16_t * addr, + size_t count) +{ + bus_addr_t baddr = (bus_addr_t) bsh + offset; + + while (count--) { + (*(volatile u_int16_t *)(baddr)) = *addr; + addr++; + baddr += 2; + } +} + +void +rmi_pci_bus_space_write_region_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, const u_int32_t * addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + (*(volatile u_int32_t *)(baddr)) = *addr; + addr++; + baddr += 4; + } +} + +static void +rmi_pci_bus_space_barrier(void *tag __unused, bus_space_handle_t bsh __unused, + bus_size_t offset __unused, bus_size_t len __unused, int flags) +{ + +} From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 17:19:17 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EA98106566B; Sat, 20 Feb 2010 17:19:17 +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 4B5338FC0C; Sat, 20 Feb 2010 17:19: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 o1KHJHTG068098; Sat, 20 Feb 2010 17:19:17 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KHJHt3068093; Sat, 20 Feb 2010 17:19:17 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201002201719.o1KHJHt3068093@svn.freebsd.org> From: Randall Stewart Date: Sat, 20 Feb 2010 17:19: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: r204136 - head/sys/mips/rmi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 17:19:17 -0000 Author: rrs Date: Sat Feb 20 17:19:16 2010 New Revision: 204136 URL: http://svn.freebsd.org/changeset/base/204136 Log: Changes for pci and pci-e support - add bus_space_rmi_pci.c for PCI bus space - files.xlr update for changes in files - pcibus.c merged into xlr_pci.c (they were small files with inter-dependencies) - xlr_pci.c - lot of changes here with few fixes, formatting cleanup Obtained from: C. Jayachandran (JC) - c.jayachandran@gmail.com Modified: head/sys/mips/rmi/bus_space_rmi_pci.c head/sys/mips/rmi/files.xlr head/sys/mips/rmi/pcibus.h head/sys/mips/rmi/xlr_pci.c Modified: head/sys/mips/rmi/bus_space_rmi_pci.c ============================================================================== --- head/sys/mips/rmi/bus_space_rmi_pci.c Sat Feb 20 17:12:07 2010 (r204135) +++ head/sys/mips/rmi/bus_space_rmi_pci.c Sat Feb 20 17:19:16 2010 (r204136) @@ -23,6 +23,767 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * $FreeBSD$ + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +static int +rmi_pci_bus_space_map(void *t, bus_addr_t addr, + bus_size_t size, int flags, + bus_space_handle_t * bshp); + +static void +rmi_pci_bus_space_unmap(void *t, bus_space_handle_t bsh, + bus_size_t size); + +static int +rmi_pci_bus_space_subregion(void *t, + bus_space_handle_t bsh, + bus_size_t offset, bus_size_t size, + bus_space_handle_t * nbshp); + +static u_int8_t +rmi_pci_bus_space_read_1(void *t, + bus_space_handle_t handle, + bus_size_t offset); + +static u_int16_t +rmi_pci_bus_space_read_2(void *t, + bus_space_handle_t handle, + bus_size_t offset); + +static u_int32_t +rmi_pci_bus_space_read_4(void *t, + bus_space_handle_t handle, + bus_size_t offset); + +static void +rmi_pci_bus_space_read_multi_1(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int8_t * addr, + size_t count); + +static void +rmi_pci_bus_space_read_multi_2(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int16_t * addr, + size_t count); + +static void +rmi_pci_bus_space_read_multi_4(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int32_t * addr, + size_t count); + +static void +rmi_pci_bus_space_read_region_1(void *t, + bus_space_handle_t bsh, + bus_size_t offset, u_int8_t * addr, + size_t count); + +static void +rmi_pci_bus_space_read_region_2(void *t, + bus_space_handle_t bsh, + bus_size_t offset, u_int16_t * addr, + size_t count); + +static void +rmi_pci_bus_space_read_region_4(void *t, + bus_space_handle_t bsh, + bus_size_t offset, u_int32_t * addr, + size_t count); + +static void +rmi_pci_bus_space_write_1(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int8_t value); + +static void +rmi_pci_bus_space_write_2(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int16_t value); + +static void +rmi_pci_bus_space_write_4(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int32_t value); + +static void +rmi_pci_bus_space_write_multi_1(void *t, + bus_space_handle_t handle, + bus_size_t offset, + const u_int8_t * addr, + size_t count); + +static void +rmi_pci_bus_space_write_multi_2(void *t, + bus_space_handle_t handle, + bus_size_t offset, + const u_int16_t * addr, + size_t count); + +static void +rmi_pci_bus_space_write_multi_4(void *t, + bus_space_handle_t handle, + bus_size_t offset, + const u_int32_t * addr, + size_t count); + +static void +rmi_pci_bus_space_write_region_2(void *t, + bus_space_handle_t bsh, + bus_size_t offset, + const u_int16_t * addr, + size_t count); + +static void +rmi_pci_bus_space_write_region_4(void *t, + bus_space_handle_t bsh, + bus_size_t offset, + const u_int32_t * addr, + size_t count); + + +static void +rmi_pci_bus_space_set_region_2(void *t, + bus_space_handle_t bsh, + bus_size_t offset, u_int16_t value, + size_t count); +static void +rmi_pci_bus_space_set_region_4(void *t, + bus_space_handle_t bsh, + bus_size_t offset, u_int32_t value, + size_t count); + +static void +rmi_pci_bus_space_barrier(void *tag __unused, bus_space_handle_t bsh __unused, + bus_size_t offset __unused, bus_size_t len __unused, int flags); + +static void +rmi_pci_bus_space_copy_region_2(void *t, + bus_space_handle_t bsh1, + bus_size_t off1, + bus_space_handle_t bsh2, + bus_size_t off2, size_t count); + +u_int8_t +rmi_pci_bus_space_read_stream_1(void *t, bus_space_handle_t handle, + bus_size_t offset); + +static u_int16_t +rmi_pci_bus_space_read_stream_2(void *t, bus_space_handle_t handle, + bus_size_t offset); + +static u_int32_t +rmi_pci_bus_space_read_stream_4(void *t, bus_space_handle_t handle, + bus_size_t offset); +static void +rmi_pci_bus_space_read_multi_stream_1(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int8_t * addr, + size_t count); + +static void +rmi_pci_bus_space_read_multi_stream_2(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int16_t * addr, + size_t count); + +static void +rmi_pci_bus_space_read_multi_stream_4(void *t, + bus_space_handle_t handle, + bus_size_t offset, u_int32_t * addr, + size_t count); + +void +rmi_pci_bus_space_write_stream_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, u_int8_t value); +static void +rmi_pci_bus_space_write_stream_2(void *t, bus_space_handle_t handle, + bus_size_t offset, u_int16_t value); + +static void +rmi_pci_bus_space_write_stream_4(void *t, bus_space_handle_t handle, + bus_size_t offset, u_int32_t value); + +static void +rmi_pci_bus_space_write_multi_stream_1(void *t, + bus_space_handle_t handle, + bus_size_t offset, + const u_int8_t * addr, + size_t count); +static void +rmi_pci_bus_space_write_multi_stream_2(void *t, + bus_space_handle_t handle, + bus_size_t offset, + const u_int16_t * addr, + size_t count); + +static void +rmi_pci_bus_space_write_multi_stream_4(void *t, + bus_space_handle_t handle, + bus_size_t offset, + const u_int32_t * addr, + size_t count); + +#define TODO() printf("XLR memory bus space function '%s' unimplemented\n", __func__) + +static struct bus_space local_rmi_pci_bus_space = { + /* cookie */ + (void *)0, + + /* mapping/unmapping */ + rmi_pci_bus_space_map, + rmi_pci_bus_space_unmap, + rmi_pci_bus_space_subregion, + + /* allocation/deallocation */ + NULL, + NULL, + + /* barrier */ + rmi_pci_bus_space_barrier, + + /* read (single) */ + rmi_pci_bus_space_read_1, + rmi_pci_bus_space_read_2, + rmi_pci_bus_space_read_4, + NULL, + + /* read multiple */ + rmi_pci_bus_space_read_multi_1, + rmi_pci_bus_space_read_multi_2, + rmi_pci_bus_space_read_multi_4, + NULL, + + /* read region */ + rmi_pci_bus_space_read_region_1, + rmi_pci_bus_space_read_region_2, + rmi_pci_bus_space_read_region_4, + NULL, + + /* write (single) */ + rmi_pci_bus_space_write_1, + rmi_pci_bus_space_write_2, + rmi_pci_bus_space_write_4, + NULL, + + /* write multiple */ + rmi_pci_bus_space_write_multi_1, + rmi_pci_bus_space_write_multi_2, + rmi_pci_bus_space_write_multi_4, + NULL, + + /* write region */ + NULL, + rmi_pci_bus_space_write_region_2, + rmi_pci_bus_space_write_region_4, + NULL, + + /* set multiple */ + NULL, + NULL, + NULL, + NULL, + + /* set region */ + NULL, + rmi_pci_bus_space_set_region_2, + rmi_pci_bus_space_set_region_4, + NULL, + + /* copy */ + NULL, + rmi_pci_bus_space_copy_region_2, + NULL, + NULL, + + /* read (single) stream */ + rmi_pci_bus_space_read_stream_1, + rmi_pci_bus_space_read_stream_2, + rmi_pci_bus_space_read_stream_4, + NULL, + + /* read multiple stream */ + rmi_pci_bus_space_read_multi_stream_1, + rmi_pci_bus_space_read_multi_stream_2, + rmi_pci_bus_space_read_multi_stream_4, + NULL, + + /* read region stream */ + rmi_pci_bus_space_read_region_1, + rmi_pci_bus_space_read_region_2, + rmi_pci_bus_space_read_region_4, + NULL, + + /* write (single) stream */ + rmi_pci_bus_space_write_stream_1, + rmi_pci_bus_space_write_stream_2, + rmi_pci_bus_space_write_stream_4, + NULL, + + /* write multiple stream */ + rmi_pci_bus_space_write_multi_stream_1, + rmi_pci_bus_space_write_multi_stream_2, + rmi_pci_bus_space_write_multi_stream_4, + NULL, + + /* write region stream */ + NULL, + rmi_pci_bus_space_write_region_2, + rmi_pci_bus_space_write_region_4, + NULL, +}; + +/* generic bus_space tag */ +bus_space_tag_t rmi_pci_bus_space = &local_rmi_pci_bus_space; + +/* + * Map a region of device bus space into CPU virtual address space. + */ +static int +rmi_pci_bus_space_map(void *t __unused, bus_addr_t addr, + bus_size_t size __unused, int flags __unused, + bus_space_handle_t * bshp) +{ + *bshp = addr; + return (0); +} + +/* + * Unmap a region of device bus space. + */ +static void +rmi_pci_bus_space_unmap(void *t __unused, bus_space_handle_t bsh __unused, + bus_size_t size __unused) +{ +} + +/* + * Get a new handle for a subregion of an already-mapped area of bus space. + */ + +static int +rmi_pci_bus_space_subregion(void *t __unused, bus_space_handle_t bsh, + bus_size_t offset, bus_size_t size __unused, + bus_space_handle_t * nbshp) +{ + *nbshp = bsh + offset; + return (0); +} + +/* + * Read a 1, 2, 4, or 8 byte quantity from bus space + * described by tag/handle/offset. + */ + +static u_int8_t +rmi_pci_bus_space_read_1(void *tag, bus_space_handle_t handle, + bus_size_t offset) +{ + return (u_int8_t) (*(volatile u_int8_t *)(handle + offset)); +} + +static u_int16_t +rmi_pci_bus_space_read_2(void *tag, bus_space_handle_t handle, + bus_size_t offset) +{ + return bswap16((u_int16_t) (*(volatile u_int16_t *)(handle + offset))); +} + +static u_int32_t +rmi_pci_bus_space_read_4(void *tag, bus_space_handle_t handle, + bus_size_t offset) +{ + return bswap32((*(volatile u_int32_t *)(handle + offset))); +} + + +/* + * Read `count' 1, 2, 4, or 8 byte quantities from bus space + * described by tag/handle/offset and copy into buffer provided. + */ +static void +rmi_pci_bus_space_read_multi_1(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int8_t * addr, size_t count) +{ + while (count--) { + *addr = (*(volatile u_int8_t *)(handle + offset)); + addr++; + } +} + +static void +rmi_pci_bus_space_read_multi_2(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int16_t * addr, size_t count) +{ + + while (count--) { + *addr = *(volatile u_int16_t *)(handle + offset); + *addr = bswap16(*addr); + addr++; + } +} + +static void +rmi_pci_bus_space_read_multi_4(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int32_t * addr, size_t count) +{ + + while (count--) { + *addr = *(volatile u_int32_t *)(handle + offset); + *addr = bswap32(*addr); + addr++; + } +} + +/* + * Write the 1, 2, 4, or 8 byte value `value' to bus space + * described by tag/handle/offset. + */ + +static void +rmi_pci_bus_space_write_1(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int8_t value) +{ + mips_sync(); + *(volatile u_int8_t *)(handle + offset) = value; +} + +static void +rmi_pci_bus_space_write_2(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int16_t value) +{ + mips_sync(); + *(volatile u_int16_t *)(handle + offset) = bswap16(value); +} + + +static void +rmi_pci_bus_space_write_4(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int32_t value) +{ + mips_sync(); + *(volatile u_int32_t *)(handle + offset) = bswap32(value); +} + +/* + * Write `count' 1, 2, 4, or 8 byte quantities from the buffer + * provided to bus space described by tag/handle/offset. + */ + + +static void +rmi_pci_bus_space_write_multi_1(void *tag, bus_space_handle_t handle, + bus_size_t offset, const u_int8_t * addr, size_t count) +{ + mips_sync(); + while (count--) { + (*(volatile u_int8_t *)(handle + offset)) = *addr; + addr++; + } +} + +static void +rmi_pci_bus_space_write_multi_2(void *tag, bus_space_handle_t handle, + bus_size_t offset, const u_int16_t * addr, size_t count) +{ + mips_sync(); + while (count--) { + (*(volatile u_int16_t *)(handle + offset)) = bswap16(*addr); + addr++; + } +} + +static void +rmi_pci_bus_space_write_multi_4(void *tag, bus_space_handle_t handle, + bus_size_t offset, const u_int32_t * addr, size_t count) +{ + mips_sync(); + while (count--) { + (*(volatile u_int32_t *)(handle + offset)) = bswap32(*addr); + addr++; + } +} + +/* + * Write `count' 1, 2, 4, or 8 byte value `val' to bus space described + * by tag/handle starting at `offset'. + */ + +static void +rmi_pci_bus_space_set_region_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, u_int16_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + for (; count != 0; count--, addr += 2) + (*(volatile u_int16_t *)(addr)) = value; +} + +static void +rmi_pci_bus_space_set_region_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, u_int32_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + for (; count != 0; count--, addr += 4) + (*(volatile u_int32_t *)(addr)) = value; +} + + +/* + * Copy `count' 1, 2, 4, or 8 byte values from bus space starting + * at tag/bsh1/off1 to bus space starting at tag/bsh2/off2. + */ +static void +rmi_pci_bus_space_copy_region_2(void *t, bus_space_handle_t bsh1, + bus_size_t off1, bus_space_handle_t bsh2, + bus_size_t off2, size_t count) +{ + TODO(); +} + +/* + * Read `count' 1, 2, 4, or 8 byte quantities from bus space + * described by tag/handle/offset and copy into buffer provided. + */ + +u_int8_t +rmi_pci_bus_space_read_stream_1(void *t, bus_space_handle_t handle, + bus_size_t offset) +{ + + return *((volatile u_int8_t *)(handle + offset)); +} + + +static u_int16_t +rmi_pci_bus_space_read_stream_2(void *t, bus_space_handle_t handle, + bus_size_t offset) +{ + return *(volatile u_int16_t *)(handle + offset); +} + + +static u_int32_t +rmi_pci_bus_space_read_stream_4(void *t, bus_space_handle_t handle, + bus_size_t offset) +{ + return (*(volatile u_int32_t *)(handle + offset)); +} + + +static void +rmi_pci_bus_space_read_multi_stream_1(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int8_t * addr, size_t count) +{ + while (count--) { + *addr = (*(volatile u_int8_t *)(handle + offset)); + addr++; + } +} + +static void +rmi_pci_bus_space_read_multi_stream_2(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int16_t * addr, size_t count) +{ + while (count--) { + *addr = (*(volatile u_int16_t *)(handle + offset)); + addr++; + } +} + +static void +rmi_pci_bus_space_read_multi_stream_4(void *tag, bus_space_handle_t handle, + bus_size_t offset, u_int32_t * addr, size_t count) +{ + while (count--) { + *addr = (*(volatile u_int32_t *)(handle + offset)); + addr++; + } +} + + + +/* + * Read `count' 1, 2, 4, or 8 byte quantities from bus space + * described by tag/handle and starting at `offset' and copy into + * buffer provided. + */ +void +rmi_pci_bus_space_read_region_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, u_int8_t * addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + *addr++ = (*(volatile u_int8_t *)(baddr)); + baddr += 1; + } +} + +void +rmi_pci_bus_space_read_region_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, u_int16_t * addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + *addr++ = (*(volatile u_int16_t *)(baddr)); + baddr += 2; + } +} + +void +rmi_pci_bus_space_read_region_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, u_int32_t * addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + *addr++ = (*(volatile u_int32_t *)(baddr)); + baddr += 4; + } +} + + +void +rmi_pci_bus_space_write_stream_1(void *t, bus_space_handle_t handle, + bus_size_t offset, u_int8_t value) +{ + mips_sync(); + *(volatile u_int8_t *)(handle + offset) = value; +} + +static void +rmi_pci_bus_space_write_stream_2(void *t, bus_space_handle_t handle, + bus_size_t offset, u_int16_t value) +{ + mips_sync(); + *(volatile u_int16_t *)(handle + offset) = value; +} + + +static void +rmi_pci_bus_space_write_stream_4(void *t, bus_space_handle_t handle, + bus_size_t offset, u_int32_t value) +{ + mips_sync(); + *(volatile u_int32_t *)(handle + offset) = value; +} + + +static void +rmi_pci_bus_space_write_multi_stream_1(void *tag, bus_space_handle_t handle, + bus_size_t offset, const u_int8_t * addr, size_t count) +{ + mips_sync(); + while (count--) { + (*(volatile u_int8_t *)(handle + offset)) = *addr; + addr++; + } +} + +static void +rmi_pci_bus_space_write_multi_stream_2(void *tag, bus_space_handle_t handle, + bus_size_t offset, const u_int16_t * addr, size_t count) +{ + mips_sync(); + while (count--) { + (*(volatile u_int16_t *)(handle + offset)) = *addr; + addr++; + } +} + +static void +rmi_pci_bus_space_write_multi_stream_4(void *tag, bus_space_handle_t handle, + bus_size_t offset, const u_int32_t * addr, size_t count) +{ + mips_sync(); + while (count--) { + (*(volatile u_int32_t *)(handle + offset)) = *addr; + addr++; + } +} + +void +rmi_pci_bus_space_write_region_2(void *t, + bus_space_handle_t bsh, + bus_size_t offset, + const u_int16_t * addr, + size_t count) +{ + bus_addr_t baddr = (bus_addr_t) bsh + offset; + + while (count--) { + (*(volatile u_int16_t *)(baddr)) = *addr; + addr++; + baddr += 2; + } +} + +void +rmi_pci_bus_space_write_region_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, const u_int32_t * addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + (*(volatile u_int32_t *)(baddr)) = *addr; + addr++; + baddr += 4; + } +} + +static void +rmi_pci_bus_space_barrier(void *tag __unused, bus_space_handle_t bsh __unused, + bus_size_t offset __unused, bus_size_t len __unused, int flags) +{ + +} +/*- + * Copyright (c) 2009 RMI Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * */ #include __FBSDID("$FreeBSD$"); Modified: head/sys/mips/rmi/files.xlr ============================================================================== --- head/sys/mips/rmi/files.xlr Sat Feb 20 17:12:07 2010 (r204135) +++ head/sys/mips/rmi/files.xlr Sat Feb 20 17:19:16 2010 (r204136) @@ -14,10 +14,10 @@ mips/rmi/uart_bus_xlr_iodi.c optional mips/rmi/uart_cpu_mips_xlr.c optional uart mips/rmi/perfmon_kern.c optional xlr_perfmon mips/rmi/perfmon_percpu.c optional xlr_perfmon -#mips/rmi/pcibus.c optional pci -#mips/rmi/xlr_pci.c optional pci +mips/rmi/xlr_pci.c optional pci #mips/rmi/xls_ehci.c optional usb ehci mips/rmi/bus_space_rmi.c standard +mips/rmi/bus_space_rmi_pci.c optional pci mips/rmi/dev/sec/rmisec.c optional rmisec mips/rmi/dev/sec/rmilib.c optional rmisec mips/rmi/dev/xlr/rge.c optional rge Modified: head/sys/mips/rmi/pcibus.h ============================================================================== --- head/sys/mips/rmi/pcibus.h Sat Feb 20 17:12:07 2010 (r204135) +++ head/sys/mips/rmi/pcibus.h Sat Feb 20 17:19:16 2010 (r204136) @@ -25,38 +25,11 @@ * * $FreeBSD$ */ -#define DEFAULT_PCI_CONFIG_BASE 0x18000000 +#define DEFAULT_PCI_CONFIG_BASE 0x18000000 +#define MSI_MIPS_ADDR_BASE 0xfee00000 -#define MSI_MIPS_ADDR_BASE 0xfee00000 +#define PCIE_LINK0_MSI_STATUS 0x90 +#define PCIE_LINK1_MSI_STATUS 0x94 +#define PCIE_LINK2_MSI_STATUS 0x190 +#define PCIE_LINK3_MSI_STATUS 0x194 - -#define PCIE_LINK0_MSI_STATUS 0x90 -#define PCIE_LINK1_MSI_STATUS 0x94 -#define PCIE_LINK2_MSI_STATUS 0x190 -#define PCIE_LINK3_MSI_STATUS 0x194 - -void pci_init_resources(void); -struct resource * -xlr_pci_alloc_resource(device_t bus, device_t child, - int type, int *rid, - u_long start, u_long end, u_long count, - u_int flags); -int -pci_activate_resource(device_t bus, device_t child, int type, int rid, - struct resource *r); -int -pci_deactivate_resource(device_t bus, device_t child, int type, int rid, - struct resource *r); -int -pci_release_resource(device_t bus, device_t child, int type, int rid, - struct resource *r); -struct rman *pci_get_rman(device_t dev, int type); - -int -mips_platform_pci_setup_intr(device_t dev, device_t child, - struct resource *irq, int flags, - driver_filter_t * filt, - driver_intr_t * intr, void *arg, - void **cookiep); -int - mips_pci_route_interrupt(device_t bus, device_t dev, int pin); Modified: head/sys/mips/rmi/xlr_pci.c ============================================================================== --- head/sys/mips/rmi/xlr_pci.c Sat Feb 20 17:12:07 2010 (r204135) +++ head/sys/mips/rmi/xlr_pci.c Sat Feb 20 17:19:16 2010 (r204136) @@ -28,17 +28,21 @@ * * RMI_BSD */ #include +__FBSDID("$FreeBSD$"); #include -#include #include +#include #include #include #include #include +#include #include #include +#include #include +#include #include #include #include @@ -47,50 +51,46 @@ #include #include #include -#include #include #include #include #include #include + #include "pcib_if.h" +#define pci_cfg_offset(bus,slot,devfn,where) (((bus)<<16) + ((slot) << 11)+((devfn)<<8)+(where)) +#define PCIE_LINK_STATE 0x4000 + #define LSU_CFG0_REGID 0 #define LSU_CERRLOG_REGID 9 #define LSU_CERROVF_REGID 10 #define LSU_CERRINT_REGID 11 -#define SWAP32(x)\ - (((x) & 0xff000000) >> 24) | \ - (((x) & 0x000000ff) << 24) | \ - (((x) & 0x0000ff00) << 8) | \ - (((x) & 0x00ff0000) >> 8) - /* MSI support */ - -#define MSI_MIPS_ADDR_DEST 0x000ff000 -#define MSI_MIPS_ADDR_RH 0x00000008 -#define MSI_MIPS_ADDR_RH_OFF 0x00000000 -#define MSI_MIPS_ADDR_RH_ON 0x00000008 -#define MSI_MIPS_ADDR_DM 0x00000004 -#define MSI_MIPS_ADDR_DM_PHYSICAL 0x00000000 -#define MSI_MIPS_ADDR_DM_LOGICAL 0x00000004 +#define MSI_MIPS_ADDR_DEST 0x000ff000 +#define MSI_MIPS_ADDR_RH 0x00000008 +#define MSI_MIPS_ADDR_RH_OFF 0x00000000 +#define MSI_MIPS_ADDR_RH_ON 0x00000008 +#define MSI_MIPS_ADDR_DM 0x00000004 +#define MSI_MIPS_ADDR_DM_PHYSICAL 0x00000000 +#define MSI_MIPS_ADDR_DM_LOGICAL 0x00000004 /* Fields in data for Intel MSI messages. */ -#define MSI_MIPS_DATA_TRGRMOD 0x00008000 /* Trigger mode */ -#define MSI_MIPS_DATA_TRGREDG 0x00000000 /* edge */ -#define MSI_MIPS_DATA_TRGRLVL 0x00008000 /* level */ - -#define MSI_MIPS_DATA_LEVEL 0x00004000 /* Polarity. */ -#define MSI_MIPS_DATA_DEASSERT 0x00000000 -#define MSI_MIPS_DATA_ASSERT 0x00004000 - -#define MSI_MIPS_DATA_DELMOD 0x00000700 /* Delivery Mode */ -#define MSI_MIPS_DATA_DELFIXED 0x00000000 /* fixed */ -#define MSI_MIPS_DATA_DELLOPRI 0x00000100 /* lowest priority */ +#define MSI_MIPS_DATA_TRGRMOD 0x00008000 /* Trigger mode */ +#define MSI_MIPS_DATA_TRGREDG 0x00000000 /* edge */ +#define MSI_MIPS_DATA_TRGRLVL 0x00008000 /* level */ + +#define MSI_MIPS_DATA_LEVEL 0x00004000 /* Polarity. */ +#define MSI_MIPS_DATA_DEASSERT 0x00000000 +#define MSI_MIPS_DATA_ASSERT 0x00004000 + +#define MSI_MIPS_DATA_DELMOD 0x00000700 /* Delivery Mode */ +#define MSI_MIPS_DATA_DELFIXED 0x00000000 /* fixed */ +#define MSI_MIPS_DATA_DELLOPRI 0x00000100 /* lowest priority */ -#define MSI_MIPS_DATA_INTVEC 0x000000ff +#define MSI_MIPS_DATA_INTVEC 0x000000ff /* * Build Intel MSI message and data values from a source. AMD64 systems @@ -104,52 +104,95 @@ (MSI_MIPS_DATA_TRGRLVL | MSI_MIPS_DATA_DELFIXED | \ MSI_MIPS_DATA_ASSERT | (irq)) -struct xlr_hose_softc { +#define DEBUG +#ifdef DEBUG +#define dbg_devprintf device_printf +#else +#define dbg_devprintf(dev, fmt, ...) +#endif + +struct xlr_pcib_softc { int junk; /* no softc */ }; + +extern bus_space_tag_t rmi_pci_bus_space; static devclass_t pcib_devclass; -static int pci_bus_status = 0; -static void *pci_config_base; +static void *xlr_pci_config_base; +static struct rman irq_rman, port_rman, mem_rman; -static uint32_t pci_cfg_read_32bit(uint32_t addr); -static void pci_cfg_write_32bit(uint32_t addr, uint32_t data); +static void +xlr_pci_init_resources(void) +{ + irq_rman.rm_start = 0; + irq_rman.rm_end = 255; + irq_rman.rm_type = RMAN_ARRAY; + irq_rman.rm_descr = "PCI Mapped Interrupts"; + if (rman_init(&irq_rman) + || rman_manage_region(&irq_rman, 0, 255)) + panic("pci_init_resources irq_rman"); + + port_rman.rm_start = 0; + port_rman.rm_end = ~0u; + port_rman.rm_type = RMAN_ARRAY; + port_rman.rm_descr = "I/O ports"; + if (rman_init(&port_rman) + || rman_manage_region(&port_rman, 0x10000000, 0x1fffffff)) + panic("pci_init_resources port_rman"); + + mem_rman.rm_start = 0; + mem_rman.rm_end = ~0u; + mem_rman.rm_type = RMAN_ARRAY; + mem_rman.rm_descr = "I/O memory"; + if (rman_init(&mem_rman) + || rman_manage_region(&mem_rman, 0xd0000000, 0xdfffffff)) + panic("pci_init_resources mem_rman"); +} static int xlr_pcib_probe(device_t dev) { - device_set_desc(dev, "xlr system bridge controller"); + if (xlr_board_info.is_xls) + device_set_desc(dev, "XLS PCIe bus"); + else + device_set_desc(dev, "XLR PCI bus"); - pci_init_resources(); - pci_config_base = (void *)MIPS_PHYS_TO_KSEG1(DEFAULT_PCI_CONFIG_BASE); - pci_bus_status = 1; + xlr_pci_init_resources(); + xlr_pci_config_base = (void *)MIPS_PHYS_TO_KSEG1(DEFAULT_PCI_CONFIG_BASE); return 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 17:24:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D8D91065695; Sat, 20 Feb 2010 17:24:34 +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 D5C8E8FC17; Sat, 20 Feb 2010 17:24: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 o1KHOXAe069335; Sat, 20 Feb 2010 17:24:33 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KHOXiJ069332; Sat, 20 Feb 2010 17:24:33 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201002201724.o1KHOXiJ069332@svn.freebsd.org> From: Randall Stewart Date: Sat, 20 Feb 2010 17:24: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: r204137 - head/sys/mips/rmi X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 17:24:34 -0000 Author: rrs Date: Sat Feb 20 17:24:33 2010 New Revision: 204137 URL: http://svn.freebsd.org/changeset/base/204137 Log: Fix for the rge driver for boards without rge6 and rge7. - changes to avoid adding theses instances on specific chips Obtained from: C. Jayachandran - JC - c.jayachandran@gmail.com Modified: head/sys/mips/rmi/board.c head/sys/mips/rmi/iodi.c Modified: head/sys/mips/rmi/board.c ============================================================================== --- head/sys/mips/rmi/board.c Sat Feb 20 17:19:16 2010 (r204136) +++ head/sys/mips/rmi/board.c Sat Feb 20 17:24:33 2010 (r204137) @@ -27,6 +27,8 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * *****************************RMI_2**********************************/ +#include /* RCS ID & Copyright macro defns */ +__FBSDID("$FreeBSD$"); #include #include #include @@ -93,6 +95,7 @@ struct xlr_board_info xlr_board_info; int xlr_board_info_setup() { + if (xlr_is_xls()) { xlr_board_info.is_xls = 1; xlr_board_info.nr_cpus = 8; @@ -122,6 +125,18 @@ xlr_board_info_setup() /* network block 1 */ xlr_board_info.gmac_block[1].type = XLR_GMAC; xlr_board_info.gmac_block[1].enabled = 0xf; + if (xlr_is_xls4xx()) { + xlr_reg_t *mmio = xlr_io_mmio(XLR_IO_GPIO_OFFSET); + uint32_t tmp; + + /* some ports are not enabled on 4xx, figure this out + from the GPIO fuse bank */ + tmp = xlr_read_reg(mmio, 35); + if (tmp & (1<<28)) + xlr_board_info.gmac_block[1].enabled &= ~0x8; + if (tmp & (1<<29)) + xlr_board_info.gmac_block[1].enabled &= ~0x4; + } xlr_board_info.gmac_block[1].credit_config = &xls_cc_table_gmac1; xlr_board_info.gmac_block[1].station_txbase = MSGRNG_STNID_GMAC1_TX0; xlr_board_info.gmac_block[1].station_rfr = MSGRNG_STNID_GMAC1_FR_0; Modified: head/sys/mips/rmi/iodi.c ============================================================================== --- head/sys/mips/rmi/iodi.c Sat Feb 20 17:19:16 2010 (r204136) +++ head/sys/mips/rmi/iodi.c Sat Feb 20 17:24:33 2010 (r204137) @@ -271,11 +271,15 @@ iodi_attach(device_t dev) tmpd = device_add_child(dev, "rge", 5); device_set_ivars(tmpd, &xlr_board_info.gmac_block[1]); - tmpd = device_add_child(dev, "rge", 6); - device_set_ivars(tmpd, &xlr_board_info.gmac_block[1]); - - tmpd = device_add_child(dev, "rge", 7); - device_set_ivars(tmpd, &xlr_board_info.gmac_block[1]); + if (xlr_board_info.gmac_block[1].enabled & 0x4) { + tmpd = device_add_child(dev, "rge", 6); + device_set_ivars(tmpd, &xlr_board_info.gmac_block[1]); + } + + if (xlr_board_info.gmac_block[1].enabled & 0x8) { + tmpd = device_add_child(dev, "rge", 7); + device_set_ivars(tmpd, &xlr_board_info.gmac_block[1]); + } } else if (xlr_board_info.gmac_block[1].type == XLR_XGMAC) { #if 0 /* XGMAC not yet */ tmpd = device_add_child(dev, "rge", 4); From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 17:29:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 263B4106566B; Sat, 20 Feb 2010 17:29:28 +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 122168FC18; Sat, 20 Feb 2010 17:29: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 o1KHTRir070435; Sat, 20 Feb 2010 17:29:27 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KHTRH3070429; Sat, 20 Feb 2010 17:29:27 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201002201729.o1KHTRH3070429@svn.freebsd.org> From: Randall Stewart Date: Sat, 20 Feb 2010 17:29: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: r204138 - in head: contrib/gdb/gdb gnu/usr.bin gnu/usr.bin/gdb/arch/mips gnu/usr.bin/gdb/kgdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 17:29:28 -0000 Author: rrs Date: Sat Feb 20 17:29:27 2010 New Revision: 204138 URL: http://svn.freebsd.org/changeset/base/204138 Log: These contain JC's patch to get gdb sort of working on mips. Its not fully done yet but its a start. Obtained from: JC - c.jayachandran@gmail.com M gnu/usr.bin/gdb/kgdb/trgt_mips.c M gnu/usr.bin/gdb/arch/mips/init.c M gnu/usr.bin/gdb/arch/mips/Makefile M gnu/usr.bin/Makefile M contrib/gdb/gdb/mips-tdep.h Modified: head/contrib/gdb/gdb/mips-tdep.h head/gnu/usr.bin/Makefile head/gnu/usr.bin/gdb/arch/mips/Makefile head/gnu/usr.bin/gdb/arch/mips/init.c head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Modified: head/contrib/gdb/gdb/mips-tdep.h ============================================================================== --- head/contrib/gdb/gdb/mips-tdep.h Sat Feb 20 17:24:33 2010 (r204137) +++ head/contrib/gdb/gdb/mips-tdep.h Sat Feb 20 17:29:27 2010 (r204138) @@ -62,6 +62,17 @@ struct mips_regnum extern const struct mips_regnum *mips_regnum (struct gdbarch *gdbarch); enum { + MIPS_S0_REGNUM = 16, + MIPS_S1_REGNUM = 17, + MIPS_S2_REGNUM = 18, + MIPS_S3_REGNUM = 19, + MIPS_S4_REGNUM = 20, + MIPS_S5_REGNUM = 21, + MIPS_S6_REGNUM = 22, + MIPS_S7_REGNUM = 23, + MIPS_SP_REGNUM = 29, + MIPS_FP_REGNUM = 30, + MIPS_RA_REGNUM = 31, MIPS_EMBED_LO_REGNUM = 33, MIPS_EMBED_HI_REGNUM = 34, MIPS_EMBED_BADVADDR_REGNUM = 35, Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Sat Feb 20 17:24:33 2010 (r204137) +++ head/gnu/usr.bin/Makefile Sat Feb 20 17:29:27 2010 (r204138) @@ -21,10 +21,6 @@ SUBDIR= ${_binutils} \ sort \ ${_texinfo} -.if ${MACHINE_ARCH} == "mips" -MK_GDB=no # not yet -.endif - .if ${MK_CXX} != "no" _gperf= gperf .if ${MK_GROFF} != "no" Modified: head/gnu/usr.bin/gdb/arch/mips/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/arch/mips/Makefile Sat Feb 20 17:24:33 2010 (r204137) +++ head/gnu/usr.bin/gdb/arch/mips/Makefile Sat Feb 20 17:29:27 2010 (r204138) @@ -1,10 +1,10 @@ # $FreeBSD$ .if !defined(GDB_CROSS_DEBUGGER) -LIBSRCS+= mips-nat.c mips-nat.c mipsfbsd-nat.c +LIBSRCS+= mipsfbsd-nat.c .endif LIBSRCS+= solib.c solib-svr4.c -LIBSRCS+= mips-tdep.c mipsfbsd-tdep.c +LIBSRCS+= mips-tdep.c mipsfbsd-tdep.c fbsd-proc.c nm.h: echo '#include "mips/nm-fbsd.h"' > ${.TARGET} Modified: head/gnu/usr.bin/gdb/arch/mips/init.c ============================================================================== --- head/gnu/usr.bin/gdb/arch/mips/init.c Sat Feb 20 17:24:33 2010 (r204137) +++ head/gnu/usr.bin/gdb/arch/mips/init.c Sat Feb 20 17:29:27 2010 (r204138) @@ -123,15 +123,19 @@ initialize_all_files (void) _initialize_ser_pipe (); _initialize_ser_tcp (); #ifndef CROSS_DEBUGGER +#if 0 _initialize_mipsfbsd_nat (); _initialize_mips_nat (); +#endif _initialize_kernel_u_addr (); _initialize_infptrace (); _initialize_inftarg (); _initialize_solib (); _initialize_svr4_solib (); +#if 0 _initialize_svr4_lm (); #endif +#endif _initialize_remote (); _initialize_dcache (); _initialize_sr_support (); Modified: head/gnu/usr.bin/gdb/kgdb/trgt_mips.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Sat Feb 20 17:24:33 2010 (r204137) +++ head/gnu/usr.bin/gdb/kgdb/trgt_mips.c Sat Feb 20 17:29:27 2010 (r204138) @@ -61,18 +61,17 @@ kgdb_trgt_fetch_registers(int regno __un warnx("kvm_read: %s", kvm_geterr(kvm)); memset(&pcb, 0, sizeof(pcb)); } - supply_register(MIPS_S0_REGNUM, (char *)&pcb.pcb_context.val[0]); - supply_register(MIPS_S1_REGNUM, (char *)&pcb.pcb_context.val[1]); - supply_register(MIPS_S2_REGNUM, (char *)&pcb.pcb_context.val[2]); - supply_register(MIPS_S3_REGNUM, (char *)&pcb.pcb_context.val[3]); - supply_register(MIPS_S4_REGNUM, (char *)&pcb.pcb_context.val[4]); - supply_register(MIPS_S5_REGNUM, (char *)&pcb.pcb_context.val[5]); - supply_register(MIPS_S6_REGNUM, (char *)&pcb.pcb_context.val[6]); - supply_register(MIPS_S7_REGNUM, (char *)&pcb.pcb_context.val[7]); - supply_register(MIPS_SP_REGNUM, (char *)&pcb.pcb_context.val[8]); - supply_register(MIPS_SP_REGNUM, (char *)&pcb.pcb_context.val[8]); - supply_register(MIPS_FP_REGNUM, (char *)&pcb.pcb_context.val[9]); - supply_register(MIPS_RA_REGNUM, (char *)&pcb.pcb_context.val[10]); + supply_register(MIPS_S0_REGNUM, (char *)&pcb.pcb_context[0]); + supply_register(MIPS_S1_REGNUM, (char *)&pcb.pcb_context[1]); + supply_register(MIPS_S2_REGNUM, (char *)&pcb.pcb_context[2]); + supply_register(MIPS_S3_REGNUM, (char *)&pcb.pcb_context[3]); + supply_register(MIPS_S4_REGNUM, (char *)&pcb.pcb_context[4]); + supply_register(MIPS_S5_REGNUM, (char *)&pcb.pcb_context[5]); + supply_register(MIPS_S6_REGNUM, (char *)&pcb.pcb_context[6]); + supply_register(MIPS_S7_REGNUM, (char *)&pcb.pcb_context[7]); + supply_register(MIPS_SP_REGNUM, (char *)&pcb.pcb_context[8]); + supply_register(MIPS_FP_REGNUM, (char *)&pcb.pcb_context[9]); + supply_register(MIPS_RA_REGNUM, (char *)&pcb.pcb_context[10]); } void From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 18:17:34 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1645C106566B; Sat, 20 Feb 2010 18:17:34 +0000 (UTC) (envelope-from raj@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id AC9EB8FC12; Sat, 20 Feb 2010 18:17:33 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id BFA46C427C; Sat, 20 Feb 2010 19:19:20 +0100 (CET) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id 1iqBt1yw8rtE; Sat, 20 Feb 2010 19:19:20 +0100 (CET) Received: from [192.168.133.14] (nat3-102.ghnet.pl [91.150.222.102]) by smtp.semihalf.com (Postfix) with ESMTPSA id 1EBF2C427A; Sat, 20 Feb 2010 19:19:20 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Rafal Jaworowski In-Reply-To: <201002201613.o1KGDiiK053065@svn.freebsd.org> Date: Sat, 20 Feb 2010 19:17:20 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201002201613.o1KGDiiK053065@svn.freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1077) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204126 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 18:17:34 -0000 On 2010-02-20, at 17:13, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sat Feb 20 16:13:43 2010 > New Revision: 204126 > URL: http://svn.freebsd.org/changeset/base/204126 >=20 > Log: > Merge r198724 to Book-E. casuword() non-atomically read the current = value > of its argument before atomically replacing it, which could = occasionally > return the wrong value on an SMP system. This resulted in user mutex > operations hanging when using threaded applications. Have you got a particular test case when this was breaking, so I can = test? > Modified: > head/sys/powerpc/booke/copyinout.c >=20 > Modified: head/sys/powerpc/booke/copyinout.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/powerpc/booke/copyinout.c Sat Feb 20 16:12:37 2010 = (r204125) > +++ head/sys/powerpc/booke/copyinout.c Sat Feb 20 16:13:43 2010 = (r204126) > @@ -295,8 +295,19 @@ casuword(volatile u_long *addr, u_long o > return (EFAULT); > } >=20 > - val =3D *addr; > - (void) atomic_cmpset_32((volatile uint32_t *)addr, old, new); > + __asm __volatile ( > + "1:\tlwarx %0, 0, %2\n\t" /* load old value */ > + "cmplw %3, %0\n\t" /* compare */ > + "bne 2f\n\t" /* exit if not equal */ > + "stwcx. %4, 0, %2\n\t" /* attempt to store */ > + "bne- 1b\n\t" /* spin if failed */ > + "b 3f\n\t" /* we've succeeded */ > + "2:\n\t" > + "stwcx. %0, 0, %2\n\t" /* clear reservation = (74xx) */ The 74xx comment reference is somewhat confusing as the clear = reservation operation is pretty uniform accross 32-bit PowerPC I guess, = and not 74xx specific. Rafal From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 18:24:27 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE84D106566C; Sat, 20 Feb 2010 18:24:27 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id 7BB9C8FC17; Sat, 20 Feb 2010 18:24:27 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0KY500F00KGQVB00@smtpauth2.wiscmail.wisc.edu>; Sat, 20 Feb 2010 12:24:26 -0600 (CST) Received: from comporellon.tachypleus.net (adsl-76-233-146-74.dsl.mdsnwi.sbcglobal.net [76.233.146.74]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0KY5006A9KGOGA30@smtpauth2.wiscmail.wisc.edu>; Sat, 20 Feb 2010 12:24:25 -0600 (CST) Date: Sat, 20 Feb 2010 12:24:24 -0600 From: Nathan Whitehorn In-reply-to: To: Rafal Jaworowski Message-id: <4B8028D8.7090402@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.233.146.74 X-Spam-PmxInfo: Server=avs-9, Version=5.5.5.374460, Antispam-Engine: 2.7.1.369594, Antispam-Data: 2010.2.20.180925, SenderIP=76.233.146.74 References: <201002201613.o1KGDiiK053065@svn.freebsd.org> User-Agent: Thunderbird 2.0.0.23 (X11/20100206) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r204126 - head/sys/powerpc/booke X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 18:24:27 -0000 Rafal Jaworowski wrote: > On 2010-02-20, at 17:13, Nathan Whitehorn wrote: > > >> Author: nwhitehorn >> Date: Sat Feb 20 16:13:43 2010 >> New Revision: 204126 >> URL: http://svn.freebsd.org/changeset/base/204126 >> >> Log: >> Merge r198724 to Book-E. casuword() non-atomically read the current value >> of its argument before atomically replacing it, which could occasionally >> return the wrong value on an SMP system. This resulted in user mutex >> operations hanging when using threaded applications. >> > > Have you got a particular test case when this was breaking, so I can test? > This typically shows up with heavy lock contention on umtx operations. I discovered this because running csup died for me 100% of the time on my Xserve, by hanging forever in some umtx code. This change explicitly preserves the semantics of casuword -- it is just the code for atomic_cmpset_32 copied from atomic.h, but returning the value loading with lwarx, instead of replacing it with a success code. This closes a race between val = *addr and atomic_cmpset. With the old code, another CPU could change the value at addr between val = *addr and atomic_cmpset, causing casuword to return the wrong value. >> Modified: >> head/sys/powerpc/booke/copyinout.c >> >> Modified: head/sys/powerpc/booke/copyinout.c >> ============================================================================== >> --- head/sys/powerpc/booke/copyinout.c Sat Feb 20 16:12:37 2010 (r204125) >> +++ head/sys/powerpc/booke/copyinout.c Sat Feb 20 16:13:43 2010 (r204126) >> @@ -295,8 +295,19 @@ casuword(volatile u_long *addr, u_long o >> return (EFAULT); >> } >> >> - val = *addr; >> - (void) atomic_cmpset_32((volatile uint32_t *)addr, old, new); >> + __asm __volatile ( >> + "1:\tlwarx %0, 0, %2\n\t" /* load old value */ >> + "cmplw %3, %0\n\t" /* compare */ >> + "bne 2f\n\t" /* exit if not equal */ >> + "stwcx. %4, 0, %2\n\t" /* attempt to store */ >> + "bne- 1b\n\t" /* spin if failed */ >> + "b 3f\n\t" /* we've succeeded */ >> + "2:\n\t" >> + "stwcx. %0, 0, %2\n\t" /* clear reservation (74xx) */ >> > > The 74xx comment reference is somewhat confusing as the clear reservation operation is pretty uniform accross 32-bit PowerPC I guess, and not 74xx specific. > That's true. It should also be updated in atomic.h. -Nathan From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 19:30:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 505AA106568D; Sat, 20 Feb 2010 19:30:05 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F2888FC08; Sat, 20 Feb 2010 19:30: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 o1KJU55m096841; Sat, 20 Feb 2010 19:30:05 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KJU5Ce096839; Sat, 20 Feb 2010 19:30:05 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201002201930.o1KJU5Ce096839@svn.freebsd.org> From: Alan Cox Date: Sat, 20 Feb 2010 19:30: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: r204139 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 19:30:05 -0000 Author: alc Date: Sat Feb 20 19:30:04 2010 New Revision: 204139 URL: http://svn.freebsd.org/changeset/base/204139 Log: Eliminate an unused declaration. Modified: head/sys/sys/systm.h Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Sat Feb 20 17:29:27 2010 (r204138) +++ head/sys/sys/systm.h Sat Feb 20 19:30:04 2010 (r204139) @@ -52,8 +52,6 @@ extern char version[]; /* system versio extern char copyright[]; /* system copyright */ extern int kstack_pages; /* number of kernel stack pages */ -extern int nswap; /* size of swap space */ - extern u_long pagesizes[]; /* supported page sizes */ extern long physmem; /* physical memory */ extern long realmem; /* 'real' memory */ From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 19:59:53 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22E6C106566C; Sat, 20 Feb 2010 19:59:53 +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 086178FC13; Sat, 20 Feb 2010 19:59: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 o1KJxqKI003515; Sat, 20 Feb 2010 19:59:52 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KJxq3n003511; Sat, 20 Feb 2010 19:59:52 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201002201959.o1KJxq3n003511@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 20 Feb 2010 19:59: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: r204140 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 19:59:53 -0000 Author: bz Date: Sat Feb 20 19:59:52 2010 New Revision: 204140 URL: http://svn.freebsd.org/changeset/base/204140 Log: Split up ip_drain() into an outer lock and iterator part and a "locked" version that will only handle a single network stack instance. The latter is called directly from ip_destroy(). Hook up an ip_destroy() function to release resources from the legacy IP network layer upon virtual network stack teardown. Sponsored by: ISPsystem Reviewed by: rwatson MFC After: 5 days Modified: head/sys/netinet/in_proto.c head/sys/netinet/ip_input.c head/sys/netinet/ip_var.h Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Sat Feb 20 19:30:04 2010 (r204139) +++ head/sys/netinet/in_proto.c Sat Feb 20 19:59:52 2010 (r204140) @@ -114,6 +114,9 @@ struct protosw inetsw[] = { .pr_domain = &inetdomain, .pr_protocol = IPPROTO_IP, .pr_init = ip_init, +#ifdef VIMAGE + .pr_destroy = ip_destroy, +#endif .pr_slowtimo = ip_slowtimo, .pr_drain = ip_drain, .pr_usrreqs = &nousrreqs Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Sat Feb 20 19:30:04 2010 (r204139) +++ head/sys/netinet/ip_input.c Sat Feb 20 19:59:52 2010 (r204140) @@ -199,6 +199,7 @@ static struct mtx ipqlock; static void maxnipq_update(void); static void ipq_zone_change(void *); +static void ip_drain_locked(void); SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, fragpackets, CTLFLAG_RD, &VNET_NAME(nipq), 0, @@ -368,6 +369,22 @@ ip_init(void) netisr_register(&ip_nh); } +#ifdef VIMAGE +void +ip_destroy(void) +{ + + /* Cleanup in_ifaddr hash table; should be empty. */ + hashdestroy(V_in_ifaddrhashtbl, M_IFADDR, V_in_ifaddrhmask); + + IPQ_LOCK(); + ip_drain_locked(); + IPQ_UNLOCK(); + + uma_zdestroy(V_ipq_zone); +} +#endif + void ip_fini(void *xtp) { @@ -1237,23 +1254,32 @@ ip_slowtimo(void) /* * Drain off all datagram fragments. */ +static void +ip_drain_locked(void) +{ + int i; + + IPQ_LOCK_ASSERT(); + + for (i = 0; i < IPREASS_NHASH; i++) { + while(!TAILQ_EMPTY(&V_ipq[i])) { + IPSTAT_ADD(ips_fragdropped, + TAILQ_FIRST(&V_ipq[i])->ipq_nfrags); + ip_freef(&V_ipq[i], TAILQ_FIRST(&V_ipq[i])); + } + } +} + void ip_drain(void) { VNET_ITERATOR_DECL(vnet_iter); - int i; VNET_LIST_RLOCK_NOSLEEP(); IPQ_LOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - for (i = 0; i < IPREASS_NHASH; i++) { - while(!TAILQ_EMPTY(&V_ipq[i])) { - IPSTAT_ADD(ips_fragdropped, - TAILQ_FIRST(&V_ipq[i])->ipq_nfrags); - ip_freef(&V_ipq[i], TAILQ_FIRST(&V_ipq[i])); - } - } + ip_drain_locked(); CURVNET_RESTORE(); } IPQ_UNLOCK(); Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Sat Feb 20 19:30:04 2010 (r204139) +++ head/sys/netinet/ip_var.h Sat Feb 20 19:59:52 2010 (r204140) @@ -212,6 +212,9 @@ int ip_fragment(struct ip *ip, struct mb u_long if_hwassist_flags, int sw_csum); void ip_forward(struct mbuf *m, int srcrt); void ip_init(void); +#ifdef VIMAGE +void ip_destroy(void); +#endif extern int (*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *, struct ip_moptions *); From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 20:30:41 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53D71106566C; Sat, 20 Feb 2010 20:30:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 433E68FC0A; Sat, 20 Feb 2010 20: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 o1KKUeMi010353; Sat, 20 Feb 2010 20:30:40 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KKUekS010349; Sat, 20 Feb 2010 20:30:40 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201002202030.o1KKUekS010349@svn.freebsd.org> From: Michael Tuexen Date: Sat, 20 Feb 2010 20:30: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: r204141 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 20:30:41 -0000 Author: tuexen Date: Sat Feb 20 20:30:40 2010 New Revision: 204141 URL: http://svn.freebsd.org/changeset/base/204141 Log: Fix handling of SHUTDOWN-ACK chunk in COOKIE_WAIT and COOKIE_ECHOED. MFC after: 1 week Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Feb 20 19:59:52 2010 (r204140) +++ head/sys/netinet/sctp_input.c Sat Feb 20 20:30:40 2010 (r204141) @@ -918,7 +918,8 @@ sctp_handle_shutdown(struct sctp_shutdow static void sctp_handle_shutdown_ack(struct sctp_shutdown_ack_chunk *cp, - struct sctp_tcb *stcb, struct sctp_nets *net) + struct sctp_tcb *stcb, + struct sctp_nets *net) { struct sctp_association *asoc; @@ -934,6 +935,13 @@ sctp_handle_shutdown_ack(struct sctp_shu asoc = &stcb->asoc; /* process according to association state */ + if ((SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_WAIT) || + (SCTP_GET_STATE(asoc) == SCTP_STATE_COOKIE_ECHOED)) { + /* unexpected SHUTDOWN-ACK... do OOTB handling... */ + sctp_send_shutdown_complete(stcb, net, 1); + SCTP_TCB_UNLOCK(stcb); + return; + } if ((SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_SENT) && (SCTP_GET_STATE(asoc) != SCTP_STATE_SHUTDOWN_ACK_SENT)) { /* unexpected SHUTDOWN-ACK... so ignore... */ @@ -975,7 +983,7 @@ sctp_handle_shutdown_ack(struct sctp_shu /* stop the timer */ sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_9); /* send SHUTDOWN-COMPLETE */ - sctp_send_shutdown_complete(stcb, net); + sctp_send_shutdown_complete(stcb, net, 0); /* notify upper layer protocol */ if (stcb->sctp_socket) { sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Feb 20 19:59:52 2010 (r204140) +++ head/sys/netinet/sctp_output.c Sat Feb 20 20:30:40 2010 (r204141) @@ -10622,27 +10622,37 @@ sctp_send_abort_tcb(struct sctp_tcb *stc void sctp_send_shutdown_complete(struct sctp_tcb *stcb, - struct sctp_nets *net) + struct sctp_nets *net, + int reflect_vtag) { /* formulate and SEND a SHUTDOWN-COMPLETE */ struct mbuf *m_shutdown_comp; struct sctp_shutdown_complete_chunk *shutdown_complete; + uint32_t vtag; + uint8_t flags; m_shutdown_comp = sctp_get_mbuf_for_msg(sizeof(struct sctp_chunkhdr), 0, M_DONTWAIT, 1, MT_HEADER); if (m_shutdown_comp == NULL) { /* no mbuf's */ return; } + if (reflect_vtag) { + flags = SCTP_HAD_NO_TCB; + vtag = stcb->asoc.my_vtag; + } else { + flags = 0; + vtag = stcb->asoc.peer_vtag; + } shutdown_complete = mtod(m_shutdown_comp, struct sctp_shutdown_complete_chunk *); shutdown_complete->ch.chunk_type = SCTP_SHUTDOWN_COMPLETE; - shutdown_complete->ch.chunk_flags = 0; + shutdown_complete->ch.chunk_flags = flags; shutdown_complete->ch.chunk_length = htons(sizeof(struct sctp_shutdown_complete_chunk)); SCTP_BUF_LEN(m_shutdown_comp) = sizeof(struct sctp_shutdown_complete_chunk); (void)sctp_lowlevel_chunk_output(stcb->sctp_ep, stcb, net, (struct sockaddr *)&net->ro._l_addr, m_shutdown_comp, 0, NULL, 0, 1, 0, NULL, 0, stcb->sctp_ep->sctp_lport, stcb->rport, - htonl(stcb->asoc.peer_vtag), + htonl(vtag), net->port, SCTP_SO_NOT_LOCKED, NULL); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); return; Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Sat Feb 20 19:59:52 2010 (r204140) +++ head/sys/netinet/sctp_output.h Sat Feb 20 20:30:40 2010 (r204141) @@ -111,7 +111,7 @@ void sctp_send_shutdown(struct sctp_tcb void sctp_send_shutdown_ack(struct sctp_tcb *, struct sctp_nets *); -void sctp_send_shutdown_complete(struct sctp_tcb *, struct sctp_nets *); +void sctp_send_shutdown_complete(struct sctp_tcb *, struct sctp_nets *, int); void sctp_send_shutdown_complete2(struct mbuf *, int, struct sctphdr *, From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 21:43:36 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7593D1065670; Sat, 20 Feb 2010 21:43:36 +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 661828FC17; Sat, 20 Feb 2010 21:43: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 o1KLhall026515; Sat, 20 Feb 2010 21:43:36 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KLhaZD026513; Sat, 20 Feb 2010 21:43:36 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201002202143.o1KLhaZD026513@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 20 Feb 2010 21:43: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: r204142 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 21:43:36 -0000 Author: bz Date: Sat Feb 20 21:43:36 2010 New Revision: 204142 URL: http://svn.freebsd.org/changeset/base/204142 Log: Enhance a panic string to contain more useful debugging information. Sponsored by: ISPsystem Reviewed by: rwatson MFC after: 5 days Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sat Feb 20 20:30:40 2010 (r204141) +++ head/sys/net/if.c Sat Feb 20 21:43:36 2010 (r204142) @@ -809,7 +809,8 @@ if_detach_internal(struct ifnet *ifp, in IFNET_WUNLOCK(); if (!found) { if (vmove) - panic("interface not in it's own ifnet list"); + panic("%s: ifp=%p not on the ifnet tailq %p", + __func__, ifp, &V_ifnet); else return; /* XXX this should panic as well? */ } From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 21:45:04 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE035106578C; Sat, 20 Feb 2010 21:45:04 +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 CE3CE8FC14; Sat, 20 Feb 2010 21:45: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 o1KLj4Mp026893; Sat, 20 Feb 2010 21:45:04 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KLj4Jp026891; Sat, 20 Feb 2010 21:45:04 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201002202145.o1KLj4Jp026891@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 20 Feb 2010 21:45: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: r204143 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 21:45:05 -0000 Author: bz Date: Sat Feb 20 21:45:04 2010 New Revision: 204143 URL: http://svn.freebsd.org/changeset/base/204143 Log: Upon virtual network stack teardown properly release the TCP syncache resources. Sponsored by: ISPsystem Reviewed by: rwatson MFC After: 5 days Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sat Feb 20 21:43:36 2010 (r204142) +++ head/sys/netinet/tcp_syncache.c Sat Feb 20 21:45:04 2010 (r204143) @@ -278,11 +278,33 @@ syncache_init(void) void syncache_destroy(void) { + struct syncache_head *sch; + struct syncache *sc, *nsc; + int i; + + /* Cleanup hash buckets: stop timers, free entries, destroy locks. */ + for (i = 0; i < V_tcp_syncache.hashsize; i++) { + + sch = &V_tcp_syncache.hashbase[i]; + callout_drain(&sch->sch_timer); + + SCH_LOCK(sch); + TAILQ_FOREACH_SAFE(sc, &sch->sch_bucket, sc_hash, nsc) + syncache_drop(sc, sch); + SCH_UNLOCK(sch); + KASSERT(TAILQ_EMPTY(&sch->sch_bucket), + ("%s: sch->sch_bucket not empty", __func__)); + KASSERT(sch->sch_length == 0, ("%s: sch->sch_length %d not 0", + __func__, sch->sch_length)); + mtx_destroy(&sch->sch_mtx); + } - /* XXX walk the cache, free remaining objects, stop timers */ + KASSERT(V_tcp_syncache.cache_count == 0, ("%s: cache_count %d not 0", + __func__, V_tcp_syncache.cache_count)); + /* Free the allocated global resources. */ uma_zdestroy(V_tcp_syncache.zone); - FREE(V_tcp_syncache.hashbase, M_SYNCACHE); + free(V_tcp_syncache.hashbase, M_SYNCACHE); } #endif From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 22:01:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2C4D106566C; Sat, 20 Feb 2010 22:01:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88DA28FC08; Sat, 20 Feb 2010 22:01: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 o1KM1Og9030498; Sat, 20 Feb 2010 22:01:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KM1O24030495; Sat, 20 Feb 2010 22:01:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002202201.o1KM1O24030495@svn.freebsd.org> From: Marius Strobl Date: Sat, 20 Feb 2010 22:01: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: r204144 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 22:01:24 -0000 Author: marius Date: Sat Feb 20 22:01:24 2010 New Revision: 204144 URL: http://svn.freebsd.org/changeset/base/204144 Log: Add support for BCM54K2 found in combination with Apple K2 GMAC. Submitted by: Andreas Tobler Obtained from: OpenBSD MFC after: 1 week Modified: head/sys/dev/mii/brgphy.c head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/brgphy.c ============================================================================== --- head/sys/dev/mii/brgphy.c Sat Feb 20 21:45:04 2010 (r204143) +++ head/sys/dev/mii/brgphy.c Sat Feb 20 22:01:24 2010 (r204144) @@ -104,6 +104,7 @@ static void brgphy_reset(struct mii_soft static void brgphy_enable_loopback(struct mii_softc *); static void bcm5401_load_dspcode(struct mii_softc *); static void bcm5411_load_dspcode(struct mii_softc *); +static void bcm54k2_load_dspcode(struct mii_softc *); static void brgphy_fixup_5704_a0_bug(struct mii_softc *); static void brgphy_fixup_adc_bug(struct mii_softc *); static void brgphy_fixup_adjust_trim(struct mii_softc *); @@ -117,6 +118,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(xxBROADCOM, BCM5400), MII_PHY_DESC(xxBROADCOM, BCM5401), MII_PHY_DESC(xxBROADCOM, BCM5411), + MII_PHY_DESC(xxBROADCOM, BCM54K2), MII_PHY_DESC(xxBROADCOM, BCM5701), MII_PHY_DESC(xxBROADCOM, BCM5703), MII_PHY_DESC(xxBROADCOM, BCM5704), @@ -415,6 +417,9 @@ brgphy_service(struct mii_softc *sc, str case MII_MODEL_xxBROADCOM_BCM5411: bcm5411_load_dspcode(sc); break; + case MII_MODEL_xxBROADCOM_BCM54K2: + bcm54k2_load_dspcode(sc); + break; } break; case MII_OUI_xxBROADCOM_ALT1: @@ -730,6 +735,24 @@ bcm5411_load_dspcode(struct mii_softc *s PHY_WRITE(sc, dspcode[i].reg, dspcode[i].val); } +void +bcm54k2_load_dspcode(struct mii_softc *sc) +{ + static const struct { + int reg; + uint16_t val; + } dspcode[] = { + { 4, 0x01e1 }, + { 9, 0x0300 }, + { 0, 0 }, + }; + int i; + + for (i = 0; dspcode[i].reg != 0; i++) + PHY_WRITE(sc, dspcode[i].reg, dspcode[i].val); + +} + static void brgphy_fixup_5704_a0_bug(struct mii_softc *sc) { @@ -932,6 +955,9 @@ brgphy_reset(struct mii_softc *sc) case MII_MODEL_xxBROADCOM_BCM5411: bcm5411_load_dspcode(sc); break; + case MII_MODEL_xxBROADCOM_BCM54K2: + bcm54k2_load_dspcode(sc); + break; } break; case MII_OUI_xxBROADCOM_ALT1: Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Sat Feb 20 21:45:04 2010 (r204143) +++ head/sys/dev/mii/miidevs Sat Feb 20 22:01:24 2010 (r204144) @@ -145,6 +145,7 @@ model xxBROADCOM BCM5703 0x0016 BCM5703 model xxBROADCOM BCM5704 0x0019 BCM5704 10/100/1000baseTX PHY model xxBROADCOM BCM5705 0x001a BCM5705 10/100/1000baseTX PHY model xxBROADCOM BCM5750 0x0018 BCM5750 10/100/1000baseTX PHY +model xxBROADCOM BCM54K2 0x002e BCM54K2 10/100/1000baseTX PHY model xxBROADCOM BCM5714 0x0034 BCM5714 10/100/1000baseTX PHY model xxBROADCOM BCM5780 0x0035 BCM5780 10/100/1000baseTX PHY model xxBROADCOM BCM5708C 0x0036 BCM5708C 10/100/1000baseTX PHY From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 22:09:49 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 349421065670; Sat, 20 Feb 2010 22:09: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 19EF38FC14; Sat, 20 Feb 2010 22:09: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 o1KM9mbg032345; Sat, 20 Feb 2010 22:09:48 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KM9mNe032343; Sat, 20 Feb 2010 22:09:48 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201002202209.o1KM9mNe032343@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 20 Feb 2010 22:09: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: r204145 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 22:09:49 -0000 Author: bz Date: Sat Feb 20 22:09:48 2010 New Revision: 204145 URL: http://svn.freebsd.org/changeset/base/204145 Log: Start to implement ifnet DDB support: - 'show ifnets' prints a list of ifnet *s per virtual network stack, - 'show ifnet ' prints fields matching the given ifp. We do not yet print the complete set of fields and might want to factor this out to an extra if_debug.c file in case this grows a lot[1]. We may also want to grow 'show ifnet ' support[1]. Sponsored by: ISPsystem Suggested by: rwatson [1] Reviewed by: rwatson MFC after: 5 days Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sat Feb 20 22:01:24 2010 (r204144) +++ head/sys/net/if.c Sat Feb 20 22:09:48 2010 (r204145) @@ -34,6 +34,7 @@ #include "opt_inet6.h" #include "opt_inet.h" #include "opt_carp.h" +#include "opt_ddb.h" #include #include @@ -62,6 +63,10 @@ #include #include +#ifdef DDB +#include +#endif + #include #include #include @@ -3331,3 +3336,79 @@ if_deregister_com_alloc(u_char type) if_com_alloc[type] = NULL; if_com_free[type] = NULL; } + +#ifdef DDB +static void +if_show_ifnet(struct ifnet *ifp) +{ + + if (ifp == NULL) + return; + db_printf("%s:\n", ifp->if_xname); +#define IF_DB_PRINTF(f, e) db_printf(" %s = " f "\n", #e, ifp->e); + IF_DB_PRINTF("%s", if_dname); + IF_DB_PRINTF("%d", if_dunit); + IF_DB_PRINTF("%s", if_description); + IF_DB_PRINTF("%u", if_index); + IF_DB_PRINTF("%u", if_refcount); + IF_DB_PRINTF("%d", if_index_reserved); + IF_DB_PRINTF("%p", if_softc); + IF_DB_PRINTF("%p", if_l2com); + IF_DB_PRINTF("%p", if_vnet); + IF_DB_PRINTF("%p", if_home_vnet); + IF_DB_PRINTF("%p", if_addr); + IF_DB_PRINTF("%p", if_llsoftc); + IF_DB_PRINTF("%p", if_label); + IF_DB_PRINTF("%u", if_pcount); + IF_DB_PRINTF("0x%08x", if_flags); + IF_DB_PRINTF("0x%08x", if_drv_flags); + IF_DB_PRINTF("0x%08x", if_capabilities); + IF_DB_PRINTF("0x%08x", if_capenable); + IF_DB_PRINTF("%p", if_snd.ifq_head); + IF_DB_PRINTF("%p", if_snd.ifq_tail); + IF_DB_PRINTF("%d", if_snd.ifq_len); + IF_DB_PRINTF("%d", if_snd.ifq_maxlen); + IF_DB_PRINTF("%d", if_snd.ifq_drops); + IF_DB_PRINTF("%p", if_snd.ifq_drv_head); + IF_DB_PRINTF("%p", if_snd.ifq_drv_tail); + IF_DB_PRINTF("%d", if_snd.ifq_drv_len); + IF_DB_PRINTF("%d", if_snd.ifq_drv_maxlen); + IF_DB_PRINTF("%d", if_snd.altq_type); + IF_DB_PRINTF("%x", if_snd.altq_flags); +#undef IF_DB_PRINTF +} + +DB_SHOW_COMMAND(ifnet, db_show_ifnet) +{ + + if (!have_addr) { + db_printf("usage: show ifnet \n"); + return; + } + + if_show_ifnet((struct ifnet *)addr); +} + +DB_SHOW_COMMAND(ifnets, db_show_ifnets) +{ + VNET_ITERATOR_DECL(vnet_iter); + struct ifnet *ifp; + u_short idx; + + VNET_FOREACH(vnet_iter) { + CURVNET_SET_QUIET(vnet_iter); +#ifdef VIMAGE + db_printf("vnet=%p\n", curvnet); +#endif + for (idx = 1; idx <= V_if_index; idx++) { + ifp = V_ifindex_table[idx].ife_ifnet; + if (ifp == NULL) + continue; + db_printf( "%20s ifp=%p\n", ifp->if_xname, ifp); + if (db_pager_quit) + break; + } + CURVNET_RESTORE(); + } +} +#endif From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 22:24:25 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 453D01065670; Sat, 20 Feb 2010 22:24: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 1BC7A8FC17; Sat, 20 Feb 2010 22:24: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 o1KMOPWv035658; Sat, 20 Feb 2010 22:24:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KMOOfb035656; Sat, 20 Feb 2010 22:24:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002202224.o1KMOOfb035656@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 20 Feb 2010 22:24: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: r204146 - head/sys/dev/msk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 22:24:25 -0000 Author: yongari Date: Sat Feb 20 22:24:24 2010 New Revision: 204146 URL: http://svn.freebsd.org/changeset/base/204146 Log: Correct inversed programming of ethernet hardware address on big-endian architecture. Submitted by: C. Jayachandran (initial version) Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Sat Feb 20 22:09:48 2010 (r204145) +++ head/sys/dev/msk/if_msk.c Sat Feb 20 22:24:24 2010 (r204146) @@ -3713,10 +3713,10 @@ msk_init_locked(struct msk_if_softc *sc_ struct msk_softc *sc; struct ifnet *ifp; struct mii_data *mii; - uint16_t eaddr[ETHER_ADDR_LEN / 2]; + uint8_t *eaddr; uint16_t gmac; uint32_t reg; - int error, i; + int error; MSK_IF_LOCK_ASSERT(sc_if); @@ -3785,14 +3785,20 @@ msk_init_locked(struct msk_if_softc *sc_ GMAC_WRITE_2(sc, sc_if->msk_port, GM_SERIAL_MODE, gmac); /* Set station address. */ - bcopy(IF_LLADDR(ifp), eaddr, ETHER_ADDR_LEN); - for (i = 0; i < ETHER_ADDR_LEN /2; i++) - GMAC_WRITE_2(sc, sc_if->msk_port, GM_SRC_ADDR_1L + i * 4, - eaddr[i]); - for (i = 0; i < ETHER_ADDR_LEN /2; i++) - GMAC_WRITE_2(sc, sc_if->msk_port, GM_SRC_ADDR_2L + i * 4, - eaddr[i]); - + eaddr = IF_LLADDR(ifp); + GMAC_WRITE_2(sc, sc_if->msk_port, GM_SRC_ADDR_1L, + eaddr[0] | (eaddr[1] << 8)); + GMAC_WRITE_2(sc, sc_if->msk_port, GM_SRC_ADDR_1M, + eaddr[2] | (eaddr[3] << 8)); + GMAC_WRITE_2(sc, sc_if->msk_port, GM_SRC_ADDR_1H, + eaddr[4] | (eaddr[5] << 8)); + GMAC_WRITE_2(sc, sc_if->msk_port, GM_SRC_ADDR_2L, + eaddr[0] | (eaddr[1] << 8)); + GMAC_WRITE_2(sc, sc_if->msk_port, GM_SRC_ADDR_2M, + eaddr[2] | (eaddr[3] << 8)); + GMAC_WRITE_2(sc, sc_if->msk_port, GM_SRC_ADDR_2H, + eaddr[4] | (eaddr[5] << 8)); + /* Disable interrupts for counter overflows. */ GMAC_WRITE_2(sc, sc_if->msk_port, GM_TX_IRQ_MSK, 0); GMAC_WRITE_2(sc, sc_if->msk_port, GM_RX_IRQ_MSK, 0); From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 22:29:28 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2B4C1065670; Sat, 20 Feb 2010 22:29:28 +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 D2DE48FC14; Sat, 20 Feb 2010 22:29: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 o1KMTSfj036805; Sat, 20 Feb 2010 22:29:28 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KMTSpW036802; Sat, 20 Feb 2010 22:29:28 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201002202229.o1KMTSpW036802@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 20 Feb 2010 22:29: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: r204147 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 22:29:29 -0000 Author: bz Date: Sat Feb 20 22:29:28 2010 New Revision: 204147 URL: http://svn.freebsd.org/changeset/base/204147 Log: Set curvnet earlier so that it also covers calls to sodisconnect(), which before were possibly panicing the system in ULP code in the VIMAGE case. Submitted by: Igor (igor ispsystem.com) MFC after: 5 days Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sat Feb 20 22:24:24 2010 (r204146) +++ head/sys/kern/uipc_socket.c Sat Feb 20 22:29:28 2010 (r204147) @@ -773,6 +773,8 @@ soconnect(struct socket *so, struct sock if (so->so_options & SO_ACCEPTCONN) return (EOPNOTSUPP); + + CURVNET_SET(so->so_vnet); /* * If protocol is connection-based, can only connect once. * Otherwise, if connected, try to disconnect first. This allows @@ -788,10 +790,9 @@ soconnect(struct socket *so, struct sock * biting us. */ so->so_error = 0; - CURVNET_SET(so->so_vnet); error = (*so->so_proto->pr_usrreqs->pru_connect)(so, nam, td); - CURVNET_RESTORE(); } + CURVNET_RESTORE(); return (error); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 22:47:22 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23494106566C; Sat, 20 Feb 2010 22:47:22 +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 EDE298FC08; Sat, 20 Feb 2010 22:47: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 o1KMlKea040833; Sat, 20 Feb 2010 22:47:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KMlKPb040830; Sat, 20 Feb 2010 22:47:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002202247.o1KMlKPb040830@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 20 Feb 2010 22:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204149 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 22:47:22 -0000 Author: yongari Date: Sat Feb 20 22:47:20 2010 New Revision: 204149 URL: http://svn.freebsd.org/changeset/base/204149 Log: Add TSO support on VLANs. Intentionally separated IFCAP_VLAN_HWTSO from IFCAP_VLAN_HWTAGGING. I think some hardwares may be able to TSO over VLAN without VLAN hardware tagging. Driver changes and userland support will follow. Reviewed by: thompsa Modified: head/sys/net/if.h head/sys/net/if_vlan.c Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Sat Feb 20 22:43:12 2010 (r204148) +++ head/sys/net/if.h Sat Feb 20 22:47:20 2010 (r204149) @@ -218,6 +218,7 @@ struct if_data { #define IFCAP_TOE6 0x08000 /* interface can offload TCP6 */ #define IFCAP_VLAN_HWFILTER 0x10000 /* interface hw can filter vlan tag */ #define IFCAP_POLLING_NOCOUNT 0x20000 /* polling ticks cannot be fragmented */ +#define IFCAP_VLAN_HWTSO 0x40000 /* can do IFCAP_TSO on VLANs */ #define IFCAP_HWCSUM (IFCAP_RXCSUM | IFCAP_TXCSUM) #define IFCAP_TSO (IFCAP_TSO4 | IFCAP_TSO6) Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Sat Feb 20 22:43:12 2010 (r204148) +++ head/sys/net/if_vlan.c Sat Feb 20 22:47:20 2010 (r204149) @@ -1322,11 +1322,26 @@ vlan_capabilities(struct ifvlan *ifv) if (p->if_capenable & IFCAP_VLAN_HWCSUM && p->if_capenable & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable = p->if_capenable & IFCAP_HWCSUM; - ifp->if_hwassist = p->if_hwassist; + ifp->if_hwassist = p->if_hwassist & (CSUM_IP | CSUM_TCP | + CSUM_UDP | CSUM_SCTP | CSUM_IP_FRAGS | CSUM_FRAGMENT); } else { ifp->if_capenable = 0; ifp->if_hwassist = 0; } + /* + * If the parent interface can do TSO on VLANs then + * propagate the hardware-assisted flag. TSO on VLANs + * does not necessarily require hardware VLAN tagging. + */ + if (p->if_capabilities & IFCAP_VLAN_HWTSO) + ifp->if_capabilities |= p->if_capabilities & IFCAP_TSO; + if (p->if_capenable & IFCAP_VLAN_HWTSO) { + ifp->if_capenable |= p->if_capenable & IFCAP_TSO; + ifp->if_hwassist |= p->if_hwassist & CSUM_TSO; + } else { + ifp->if_capenable &= ~(p->if_capenable & IFCAP_TSO); + ifp->if_hwassist &= ~(p->if_hwassist & CSUM_TSO); + } } static void From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 23:01:09 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61E951065676; Sat, 20 Feb 2010 23:01:09 +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 518BC8FC08; Sat, 20 Feb 2010 23:01: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 o1KN19Du044010; Sat, 20 Feb 2010 23:01:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KN197B044006; Sat, 20 Feb 2010 23:01:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002202301.o1KN197B044006@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 20 Feb 2010 23:01: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: r204150 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 23:01:09 -0000 Author: yongari Date: Sat Feb 20 23:01:09 2010 New Revision: 204150 URL: http://svn.freebsd.org/changeset/base/204150 Log: Add TSO support on VLAN in fconfig(8). Reviewed by: thompsa Modified: head/sbin/ifconfig/ifconfig.8 head/sbin/ifconfig/ifconfig.c head/sbin/ifconfig/ifvlan.c Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Sat Feb 20 22:47:20 2010 (r204149) +++ head/sbin/ifconfig/ifconfig.8 Sat Feb 20 23:01:09 2010 (r204150) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd January 26, 2010 +.Dd February 20, 2010 .Dt IFCONFIG 8 .Os .Sh NAME @@ -408,20 +408,20 @@ they support in their capabilities. is a synonym for enabling all available WOL mechanisms. To disable WOL use .Fl wol . -.It Cm vlanmtu , vlanhwtag, vlanhwfilter +.It Cm vlanmtu , vlanhwtag, vlanhwfilter, vlanhwtso If the driver offers user-configurable VLAN support, enable -reception of extended frames, tag processing in hardware, or -frame filtering in hardware, +reception of extended frames, tag processing in hardware, +frame filtering in hardware, or TSO on VLAN, respectively. Note that this must be issued on a physical interface associated with .Xr vlan 4 , not on a .Xr vlan 4 interface itself. -.It Fl vlanmtu , vlanhwtag, vlanhwfilter +.It Fl vlanmtu , vlanhwtag, vlanhwfilter, vlanhwtso If the driver offers user-configurable VLAN support, disable -reception of extended frames, tag processing in hardware, or -frame filtering in hardware, +reception of extended frames, tag processing in hardware, +frame filtering in hardware, or TSO on VLAN, respectively. .It Cm vnet Ar jail Move the interface to the Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Sat Feb 20 22:47:20 2010 (r204149) +++ head/sbin/ifconfig/ifconfig.c Sat Feb 20 23:01:09 2010 (r204150) @@ -881,7 +881,7 @@ unsetifdescr(const char *val, int value, #define IFCAPBITS \ "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ -"\21VLAN_HWFILTER" +"\21VLAN_HWFILTER\23VLAN_HWTSO" /* * Print the status of the interface. If an address family was Modified: head/sbin/ifconfig/ifvlan.c ============================================================================== --- head/sbin/ifconfig/ifvlan.c Sat Feb 20 22:47:20 2010 (r204149) +++ head/sbin/ifconfig/ifvlan.c Sat Feb 20 23:01:09 2010 (r204150) @@ -181,6 +181,8 @@ static struct cmd vlan_cmds[] = { DEF_CMD("-vlanhwtag", -IFCAP_VLAN_HWTAGGING, setifcap), DEF_CMD("vlanhwfilter", IFCAP_VLAN_HWFILTER, setifcap), DEF_CMD("-vlanhwfilter", -IFCAP_VLAN_HWFILTER, setifcap), + DEF_CMD("-vlanhwtso", -IFCAP_VLAN_HWTSO, setifcap), + DEF_CMD("vlanhwtso", IFCAP_VLAN_HWTSO, setifcap), }; static struct afswtch af_vlan = { .af_name = "af_vlan", From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 23:21:07 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F1BC106566C; Sat, 20 Feb 2010 23:21:07 +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 3F0848FC0A; Sat, 20 Feb 2010 23:21: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 o1KNL7TB048427; Sat, 20 Feb 2010 23:21:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KNL7wB048425; Sat, 20 Feb 2010 23:21:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201002202321.o1KNL7wB048425@svn.freebsd.org> From: Pyun YongHyeon Date: Sat, 20 Feb 2010 23:21: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: r204151 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 23:21:07 -0000 Author: yongari Date: Sat Feb 20 23:21:06 2010 New Revision: 204151 URL: http://svn.freebsd.org/changeset/base/204151 Log: Add TSO support on VLAN. Controller requires VLAN hardware tagging to make TSO work on VLAN. So if VLAN hardware tagging is disabled explicitly clear TSO on VLAN. While I'm here remove duplicated VLAN_CAPABILITIES call. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Sat Feb 20 23:01:09 2010 (r204150) +++ head/sys/dev/bge/if_bge.c Sat Feb 20 23:21:06 2010 (r204151) @@ -2816,7 +2816,7 @@ bge_attach(device_t dev) IFCAP_VLAN_MTU; if ((sc->bge_flags & BGE_FLAG_TSO) != 0) { ifp->if_hwassist |= CSUM_TSO; - ifp->if_capabilities |= IFCAP_TSO4; + ifp->if_capabilities |= IFCAP_TSO4 | IFCAP_VLAN_HWTSO; } #ifdef IFCAP_VLAN_HWCSUM ifp->if_capabilities |= IFCAP_VLAN_HWCSUM; @@ -4526,9 +4526,6 @@ bge_ioctl(struct ifnet *ifp, u_long comm ifp->if_hwassist |= BGE_CSUM_FEATURES; else ifp->if_hwassist &= ~BGE_CSUM_FEATURES; -#ifdef VLAN_CAPABILITIES - VLAN_CAPABILITIES(ifp); -#endif } if ((mask & IFCAP_TSO4) != 0 && @@ -4546,16 +4543,21 @@ bge_ioctl(struct ifnet *ifp, u_long comm bge_init(sc); } - if (mask & IFCAP_VLAN_HWTAGGING) { + if ((mask & IFCAP_VLAN_HWTSO) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTSO) != 0) + ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + if ((ifp->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) + ifp->if_capenable &= ~IFCAP_VLAN_HWTSO; BGE_LOCK(sc); bge_setvlan(sc); BGE_UNLOCK(sc); + } #ifdef VLAN_CAPABILITIES - VLAN_CAPABILITIES(ifp); + VLAN_CAPABILITIES(ifp); #endif - } - break; default: error = ether_ioctl(ifp, command, data); From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 23:24:20 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10A1A1065672; Sat, 20 Feb 2010 23:24:20 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2D7E8FC12; Sat, 20 Feb 2010 23: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 o1KNOJgY049182; Sat, 20 Feb 2010 23:24:19 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KNOJYf049161; Sat, 20 Feb 2010 23:24:19 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002202324.o1KNOJYf049161@svn.freebsd.org> From: Marius Strobl Date: Sat, 20 Feb 2010 23: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: r204152 - in head/sys: boot/sparc64/loader sparc64/include sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 23:24:20 -0000 Author: marius Date: Sat Feb 20 23:24:19 2010 New Revision: 204152 URL: http://svn.freebsd.org/changeset/base/204152 Log: Some machines can not only consist of CPUs running at different speeds but also of different types, f.e. Sun Fire V890 can be equipped with a mix of UltraSPARC IV and IV+ CPUs, requiring different MMU initialization and different workarounds for model specific errata. Therefore move the CPU implementation number from a global variable to the per-CPU data. Functions which are called before the latter is available are passed the implementation number as a parameter now. Modified: head/sys/boot/sparc64/loader/main.c head/sys/sparc64/include/cache.h head/sys/sparc64/include/cpu.h head/sys/sparc64/include/md_var.h head/sys/sparc64/include/pcpu.h head/sys/sparc64/include/pmap.h head/sys/sparc64/include/smp.h head/sys/sparc64/include/ver.h head/sys/sparc64/sparc64/cache.c head/sys/sparc64/sparc64/cheetah.c head/sys/sparc64/sparc64/identcpu.c head/sys/sparc64/sparc64/iommu.c head/sys/sparc64/sparc64/machdep.c head/sys/sparc64/sparc64/mp_locore.S head/sys/sparc64/sparc64/mp_machdep.c head/sys/sparc64/sparc64/nexus.c head/sys/sparc64/sparc64/pmap.c head/sys/sparc64/sparc64/spitfire.c head/sys/sparc64/sparc64/tick.c head/sys/sparc64/sparc64/trap.c Modified: head/sys/boot/sparc64/loader/main.c ============================================================================== --- head/sys/boot/sparc64/loader/main.c Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/boot/sparc64/loader/main.c Sat Feb 20 23:24:19 2010 (r204152) @@ -137,7 +137,7 @@ struct tlb_entry *dtlb_store; struct tlb_entry *itlb_store; u_int dtlb_slot; u_int itlb_slot; -int cpu_impl; +static int cpu_impl; static u_int dtlb_slot_max; static u_int itlb_slot_max; Modified: head/sys/sparc64/include/cache.h ============================================================================== --- head/sys/sparc64/include/cache.h Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/include/cache.h Sat Feb 20 23:24:19 2010 (r204152) @@ -91,7 +91,7 @@ struct cacheinfo { struct pcpu; -typedef void cache_enable_t(void); +typedef void cache_enable_t(u_int cpu_impl); typedef void cache_flush_t(void); typedef void dcache_page_inval_t(vm_paddr_t pa); typedef void icache_page_inval_t(vm_paddr_t pa); Modified: head/sys/sparc64/include/cpu.h ============================================================================== --- head/sys/sparc64/include/cpu.h Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/include/cpu.h Sat Feb 20 23:24:19 2010 (r204152) @@ -52,7 +52,7 @@ extern char btext[]; extern char etext[]; -void cheetah_init(void); +void cheetah_init(u_int cpu_impl); void cpu_halt(void); void cpu_reset(void); void fork_trampoline(void); Modified: head/sys/sparc64/include/md_var.h ============================================================================== --- head/sys/sparc64/include/md_var.h Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/include/md_var.h Sat Feb 20 23:24:19 2010 (r204152) @@ -47,8 +47,8 @@ extern vm_paddr_t kstack0_phys; struct pcpu; struct md_utrap; -const char *cpu_cpuid_prop(void); -uint32_t cpu_get_mid(void); +const char *cpu_cpuid_prop(u_int cpu_impl); +uint32_t cpu_get_mid(u_int cpu_impl); void cpu_identify(u_long vers, u_int clock, u_int id); void cpu_setregs(struct pcpu *pc); int is_physical_memory(vm_paddr_t addr); Modified: head/sys/sparc64/include/pcpu.h ============================================================================== --- head/sys/sparc64/include/pcpu.h Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/include/pcpu.h Sat Feb 20 23:24:19 2010 (r204152) @@ -54,6 +54,7 @@ struct pmap; u_long pc_tickref; \ u_long pc_tickadj; \ u_int pc_clock; \ + u_int pc_impl; \ u_int pc_mid; \ u_int pc_node; \ u_int pc_tlb_ctx; \ Modified: head/sys/sparc64/include/pmap.h ============================================================================== --- head/sys/sparc64/include/pmap.h Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/include/pmap.h Sat Feb 20 23:24:19 2010 (r204152) @@ -80,7 +80,7 @@ struct pmap { #define pmap_page_get_memattr(m) VM_MEMATTR_DEFAULT #define pmap_page_set_memattr(m, ma) (void)0 -void pmap_bootstrap(void); +void pmap_bootstrap(u_int cpu_impl); vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kenter(vm_offset_t va, vm_page_t m); void pmap_kremove(vm_offset_t); Modified: head/sys/sparc64/include/smp.h ============================================================================== --- head/sys/sparc64/include/smp.h Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/include/smp.h Sat Feb 20 23:24:19 2010 (r204152) @@ -94,7 +94,7 @@ void cpu_mp_shutdown(void); typedef void cpu_ipi_selected_t(u_int, u_long, u_long, u_long); extern cpu_ipi_selected_t *cpu_ipi_selected; -void mp_init(void); +void mp_init(u_int cpu_impl); extern struct mtx ipi_mtx; extern struct ipi_cache_args ipi_cache_args; Modified: head/sys/sparc64/include/ver.h ============================================================================== --- head/sys/sparc64/include/ver.h Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/include/ver.h Sat Feb 20 23:24:19 2010 (r204152) @@ -43,24 +43,28 @@ #ifndef LOCORE -#define VER_MANUF_MASK (((1L<> VER_MANUF_SHIFT) -#define VER_IMPL(ver) \ +#define VER_IMPL(ver) \ (((ver) & VER_IMPL_MASK) >> VER_IMPL_SHIFT) -#define VER_MASK(ver) \ +#define VER_MASK(ver) \ (((ver) & VER_MASK_MASK) >> VER_MASK_SHIFT) -#define VER_MAXTL(ver) \ +#define VER_MAXTL(ver) \ (((ver) & VER_MAXTL_MASK) >> VER_MAXTL_SHIFT) -#define VER_MAXWIN(ver) \ +#define VER_MAXWIN(ver) \ (((ver) & VER_MAXWIN_MASK) >> VER_MAXWIN_SHIFT) -extern int cpu_impl; extern char sparc64_model[]; #endif /* !LOCORE */ Modified: head/sys/sparc64/sparc64/cache.c ============================================================================== --- head/sys/sparc64/sparc64/cache.c Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/sparc64/cache.c Sat Feb 20 23:24:19 2010 (r204152) @@ -130,7 +130,7 @@ cache_init(struct pcpu *pcpu) if ((set & ~(1UL << (ffs(set) - 1))) != 0) panic("cache_init: E$ set size not a power of 2"); - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) { + if (pcpu->pc_impl >= CPU_IMPL_ULTRASPARCIII) { cache_enable = cheetah_cache_enable; cache_flush = cheetah_cache_flush; dcache_page_inval = cheetah_dcache_page_inval; Modified: head/sys/sparc64/sparc64/cheetah.c ============================================================================== --- head/sys/sparc64/sparc64/cheetah.c Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/sparc64/cheetah.c Sat Feb 20 23:24:19 2010 (r204152) @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); * CPU-specific initialization */ void -cheetah_init(void) +cheetah_init(u_int cpu_impl) { register_t s; @@ -119,7 +119,7 @@ cheetah_init(void) * Enable level 1 caches. */ void -cheetah_cache_enable(void) +cheetah_cache_enable(u_int cpu_impl) { u_long lsu; Modified: head/sys/sparc64/sparc64/identcpu.c ============================================================================== --- head/sys/sparc64/sparc64/identcpu.c Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/sparc64/identcpu.c Sat Feb 20 23:24:19 2010 (r204152) @@ -15,7 +15,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -34,8 +33,6 @@ static u_int cpu_freq; SYSCTL_UINT(_hw_freq, OID_AUTO, cpu, CTLFLAG_RD, &cpu_freq, 0, "CPU clock frequency"); -int cpu_impl; - void cpu_identify(u_long vers, u_int freq, u_int id) { Modified: head/sys/sparc64/sparc64/iommu.c ============================================================================== --- head/sys/sparc64/sparc64/iommu.c Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/sparc64/iommu.c Sat Feb 20 23:24:19 2010 (r204152) @@ -130,6 +130,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -377,7 +378,7 @@ iommu_init(const char *name, struct iomm printf("%s: PROM IOTSB size: %d (%d entries)\n", name, obptsbsize, obptsbentries); if ((is->is_flags & IOMMU_PRESERVE_PROM) != 0 && - !(cpu_impl == CPU_IMPL_ULTRASPARCIIi && obptsbsize == 7)) { + !(PCPU_GET(impl) == CPU_IMPL_ULTRASPARCIIi && obptsbsize == 7)) { if (obptsbentries > tsbentries) panic("%s: PROM IOTSB entries exceed kernel", __func__); Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/sparc64/machdep.c Sat Feb 20 23:24:19 2010 (r204152) @@ -146,7 +146,7 @@ static int cpu_use_vis = 1; cpu_block_copy_t *cpu_block_copy; cpu_block_zero_t *cpu_block_zero; -static phandle_t find_bsp(phandle_t node, uint32_t bspid); +static phandle_t find_bsp(phandle_t node, uint32_t bspid, u_int cpu_impl); void sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec); static void sparc64_shutdown_final(void *dummy, int howto); @@ -241,7 +241,7 @@ spinlock_exit(void) } static phandle_t -find_bsp(phandle_t node, uint32_t bspid) +find_bsp(phandle_t node, uint32_t bspid, u_int cpu_impl) { char type[sizeof("cpu")]; phandle_t child; @@ -250,7 +250,7 @@ find_bsp(phandle_t node, uint32_t bspid) for (; node != 0; node = OF_peer(node)) { child = OF_child(node); if (child > 0) { - child = find_bsp(child, bspid); + child = find_bsp(child, bspid, cpu_impl); if (child > 0) return (child); } else { @@ -259,7 +259,7 @@ find_bsp(phandle_t node, uint32_t bspid) continue; if (strcmp(type, "cpu") != 0) continue; - if (OF_getprop(node, cpu_cpuid_prop(), &cpuid, + if (OF_getprop(node, cpu_cpuid_prop(cpu_impl), &cpuid, sizeof(cpuid)) <= 0) continue; if (cpuid == bspid) @@ -270,7 +270,7 @@ find_bsp(phandle_t node, uint32_t bspid) } const char * -cpu_cpuid_prop(void) +cpu_cpuid_prop(u_int cpu_impl) { switch (cpu_impl) { @@ -294,7 +294,7 @@ cpu_cpuid_prop(void) } uint32_t -cpu_get_mid(void) +cpu_get_mid(u_int cpu_impl) { switch (cpu_impl) { @@ -328,6 +328,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l vm_offset_t va; caddr_t kmdp; phandle_t root; + u_int cpu_impl; end = 0; kmdp = NULL; @@ -342,12 +343,12 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * Do CPU-specific Initialization. */ if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) - cheetah_init(); + cheetah_init(cpu_impl); /* * Clear (S)TICK timer (including NPT). */ - tick_clear(); + tick_clear(cpu_impl); /* * UltraSparc II[e,i] based systems come up with the tick interrupt @@ -357,7 +358,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * enabled, causing an interrupt storm on startup since they are not * handled. */ - tick_stop(); + tick_stop(cpu_impl); /* * Set up Open Firmware entry points. @@ -399,7 +400,8 @@ sparc64_init(caddr_t mdp, u_long o1, u_l pc = (struct pcpu *)(pcpu0 + (PCPU_PAGES * PAGE_SIZE)) - 1; pcpu_init(pc, 0, sizeof(struct pcpu)); pc->pc_addr = (vm_offset_t)pcpu0; - pc->pc_mid = cpu_get_mid(); + pc->pc_impl = cpu_impl; + pc->pc_mid = cpu_get_mid(cpu_impl); pc->pc_tlb_ctx = TLB_CTX_USER_MIN; pc->pc_tlb_ctx_min = TLB_CTX_USER_MIN; pc->pc_tlb_ctx_max = TLB_CTX_USER_MAX; @@ -409,7 +411,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l * BSP is in the device tree in the first place). */ root = OF_peer(0); - pc->pc_node = find_bsp(root, pc->pc_mid); + pc->pc_node = find_bsp(root, pc->pc_mid, cpu_impl); if (pc->pc_node == 0) OF_exit(); if (OF_getprop(pc->pc_node, "clock-frequency", &pc->pc_clock, @@ -475,7 +477,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l panic("sparc64_init: cannot determine number of iTLB slots"); cache_init(pc); - cache_enable(); + cache_enable(cpu_impl); uma_set_align(pc->pc_cache.dc_linesize - 1); cpu_block_copy = bcopy; @@ -501,13 +503,13 @@ sparc64_init(caddr_t mdp, u_long o1, u_l } #ifdef SMP - mp_init(); + mp_init(cpu_impl); #endif /* * Initialize virtual memory and calculate physmem. */ - pmap_bootstrap(); + pmap_bootstrap(cpu_impl); /* * Initialize tunables. Modified: head/sys/sparc64/sparc64/mp_locore.S ============================================================================== --- head/sys/sparc64/sparc64/mp_locore.S Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/sparc64/mp_locore.S Sat Feb 20 23:24:19 2010 (r204152) @@ -202,17 +202,17 @@ ENTRY(mp_startup) cmp %l1, CPU_IMPL_ULTRASPARCIII bl %icc, 3f nop - mov CPU_STICKSYNC, %l1 + mov CPU_STICKSYNC, %l2 membar #StoreLoad - stw %l1, [%l0 + CSA_STATE] + stw %l2, [%l0 + CSA_STATE] -2: ldx [%l0 + CSA_STICK], %l1 - brz %l1, 2b +2: ldx [%l0 + CSA_STICK], %l2 + brz %l2, 2b nop - wr %l1, 0, %asr24 + wr %l2, 0, %asr24 3: call cpu_get_mid - nop + mov %l1, %o0 /* * Inform the boot processor we have inited. Modified: head/sys/sparc64/sparc64/mp_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/mp_machdep.c Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/sparc64/mp_machdep.c Sat Feb 20 23:24:19 2010 (r204152) @@ -119,11 +119,11 @@ static u_int cpuid_to_mid[MAXCPU]; static int isjbus; static volatile u_int shutdown_cpus; -static void ap_count(phandle_t node, u_int mid); -static void ap_start(phandle_t node, u_int mid); +static void ap_count(phandle_t node, u_int mid, u_int cpu_impl); +static void ap_start(phandle_t node, u_int mid, u_int cpu_impl); static void cpu_mp_unleash(void *v); static void foreach_ap(phandle_t node, void (*func)(phandle_t node, - u_int mid)); + u_int mid, u_int cpu_impl)); static void spitfire_ipi_send(u_int mid, u_long d0, u_long d1, u_long d2); static void sun4u_startcpu(phandle_t cpu, void *func, u_long arg); @@ -137,7 +137,7 @@ CTASSERT(MAXCPU <= sizeof(u_int) * NBBY) CTASSERT(MAXCPU <= sizeof(int) * NBBY); void -mp_init(void) +mp_init(u_int cpu_impl) { struct tte *tp; int i; @@ -171,11 +171,13 @@ mp_init(void) } static void -foreach_ap(phandle_t node, void (*func)(phandle_t node, u_int mid)) +foreach_ap(phandle_t node, void (*func)(phandle_t node, u_int mid, + u_int cpu_impl)) { char type[sizeof("cpu")]; phandle_t child; u_int cpuid; + uint32_t cpu_impl; /* There's no need to traverse the whole OFW tree twice. */ if (mp_maxid > 0 && mp_ncpus >= mp_maxid + 1) @@ -191,12 +193,17 @@ foreach_ap(phandle_t node, void (*func)( continue; if (strcmp(type, "cpu") != 0) continue; - if (OF_getprop(node, cpu_cpuid_prop(), &cpuid, - sizeof(cpuid)) <= 0) - panic("%s: can't get module ID", __func__); + if (OF_getprop(node, "implementation#", &cpu_impl, + sizeof(cpu_impl)) <= 0) + panic("%s: couldn't determine CPU " + "implementation", __func__); + if (OF_getprop(node, cpu_cpuid_prop(cpu_impl), &cpuid, + sizeof(cpuid)) <= 0) + panic("%s: couldn't determine CPU module ID", + __func__); if (cpuid == PCPU_GET(mid)) continue; - (*func)(node, cpuid); + (*func)(node, cpuid, cpu_impl); } } } @@ -216,7 +223,7 @@ cpu_mp_setmaxid() } static void -ap_count(phandle_t node __unused, u_int mid __unused) +ap_count(phandle_t node __unused, u_int mid __unused, u_int cpu_impl __unused) { mp_maxid++; @@ -283,20 +290,20 @@ cpu_mp_start(void) } static void -ap_start(phandle_t node, u_int mid) +ap_start(phandle_t node, u_int mid, u_int cpu_impl) { volatile struct cpu_start_args *csa; struct pcpu *pc; register_t s; vm_offset_t va; - u_int clock; u_int cpuid; + uint32_t clock; if (mp_ncpus > MAXCPU) return; if (OF_getprop(node, "clock-frequency", &clock, sizeof(clock)) <= 0) - panic("%s: can't get clock", __func__); + panic("%s: couldn't determine CPU frequency", __func__); if (clock != PCPU_GET(clock)) hardclock_use_stick = 1; @@ -329,6 +336,7 @@ ap_start(phandle_t node, u_int mid) dpcpu_init((void *)kmem_alloc(kernel_map, DPCPU_SIZE), cpuid); pc->pc_addr = va; pc->pc_clock = clock; + pc->pc_impl = cpu_impl; pc->pc_mid = mid; pc->pc_node = node; @@ -401,9 +409,9 @@ cpu_mp_bootstrap(struct pcpu *pc) volatile struct cpu_start_args *csa; csa = &cpu_start_args; - if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) - cheetah_init(); - cache_enable(); + if (pc->pc_impl >= CPU_IMPL_ULTRASPARCIII) + cheetah_init(pc->pc_impl); + cache_enable(pc->pc_impl); pmap_map_tsb(); /* * Flush all non-locked TLB entries possibly left over by the Modified: head/sys/sparc64/sparc64/nexus.c ============================================================================== --- head/sys/sparc64/sparc64/nexus.c Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/sparc64/nexus.c Sat Feb 20 23:24:19 2010 (r204152) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -522,7 +523,7 @@ nexus_setup_dinfo(device_t dev, phandle_ nintr = OF_getprop_alloc(node, "interrupts", sizeof(*intr), (void **)&intr); if (nintr > 0) { - if (OF_getprop(node, cpu_impl < CPU_IMPL_ULTRASPARCIII ? + if (OF_getprop(node, PCPU_GET(impl) < CPU_IMPL_ULTRASPARCIII ? "upa-portid" : "portid", &ign, sizeof(ign)) <= 0) { device_printf(dev, "<%s>: could not determine portid\n", ndi->ndi_obdinfo.obd_name); Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/sparc64/pmap.c Sat Feb 20 23:24:19 2010 (r204152) @@ -278,7 +278,7 @@ om_cmp(const void *a, const void *b) * Bootstrap the system enough to run with virtual memory. */ void -pmap_bootstrap(void) +pmap_bootstrap(u_int cpu_impl) { struct pmap *pm; struct tte *tp; @@ -1543,7 +1543,7 @@ pmap_copy_tte(pmap_t src_pmap, pmap_t ds void pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, - vm_size_t len, vm_offset_t src_addr) + vm_size_t len, vm_offset_t src_addr) { struct tte *tp; vm_offset_t va; Modified: head/sys/sparc64/sparc64/spitfire.c ============================================================================== --- head/sys/sparc64/sparc64/spitfire.c Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/sparc64/spitfire.c Sat Feb 20 23:24:19 2010 (r204152) @@ -56,7 +56,7 @@ PMAP_STATS_VAR(spitfire_icache_npage_inv * Enable the level 1 caches. */ void -spitfire_cache_enable(void) +spitfire_cache_enable(u_int cpu_impl __unused) { u_long lsu; Modified: head/sys/sparc64/sparc64/tick.c ============================================================================== --- head/sys/sparc64/sparc64/tick.c Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/sparc64/tick.c Sat Feb 20 23:24:19 2010 (r204152) @@ -120,7 +120,7 @@ cpu_initclocks(void) */ } else { clock = PCPU_GET(clock); - intr_setup(PIL_TICK, cpu_impl < CPU_IMPL_ULTRASPARCIII ? + intr_setup(PIL_TICK, PCPU_GET(impl) < CPU_IMPL_ULTRASPARCIII ? tick_hardclock_bbwar : tick_hardclock, -1, NULL, NULL); set_cputicker(tick_cputicks, clock, 0); } @@ -322,7 +322,7 @@ tick_start(void) } void -tick_clear(void) +tick_clear(u_int cpu_impl) { if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) @@ -331,7 +331,7 @@ tick_clear(void) } void -tick_stop(void) +tick_stop(u_int cpu_impl) { if (cpu_impl >= CPU_IMPL_ULTRASPARCIII) Modified: head/sys/sparc64/sparc64/trap.c ============================================================================== --- head/sys/sparc64/sparc64/trap.c Sat Feb 20 23:21:06 2010 (r204151) +++ head/sys/sparc64/sparc64/trap.c Sat Feb 20 23:24:19 2010 (r204152) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -391,7 +392,7 @@ trap(struct trapframe *tf) if (tf->tf_tpc > (u_long)fas_nofault_begin && tf->tf_tpc < (u_long)fas_nofault_end) { cache_flush(); - cache_enable(); + cache_enable(PCPU_GET(impl)); tf->tf_tpc = (u_long)fas_fault; tf->tf_tnpc = tf->tf_tpc + 4; error = 0; From owner-svn-src-head@FreeBSD.ORG Sat Feb 20 23:42:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70944106568B; Sat, 20 Feb 2010 23:42:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FC2D8FC13; Sat, 20 Feb 2010 23:42: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 o1KNgOUT053258; Sat, 20 Feb 2010 23:42:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KNgORa053256; Sat, 20 Feb 2010 23:42:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201002202342.o1KNgORa053256@svn.freebsd.org> From: Marius Strobl Date: Sat, 20 Feb 2010 23:42: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: r204153 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 23:42:24 -0000 Author: marius Date: Sat Feb 20 23:42:24 2010 New Revision: 204153 URL: http://svn.freebsd.org/changeset/base/204153 Log: Starting with UltraSPARC IV CPUs the CPU caches are described with different OFW properties. Modified: head/sys/sparc64/sparc64/cache.c Modified: head/sys/sparc64/sparc64/cache.c ============================================================================== --- head/sys/sparc64/sparc64/cache.c Sat Feb 20 23:24:19 2010 (r204152) +++ head/sys/sparc64/sparc64/cache.c Sat Feb 20 23:42:24 2010 (r204153) @@ -43,6 +43,7 @@ */ /*- * Copyright (c) 2001 by Thomas Moestl . + * Copyright (c) 2008, 2010 Marius Strobl * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -89,32 +90,49 @@ icache_page_inval_t *icache_page_inval; #define OF_GET(h, n, v) OF_getprop((h), (n), &(v), sizeof(v)) +static u_int cache_new_prop(u_int cpu_impl); + +static u_int +cache_new_prop(u_int cpu_impl) +{ + + switch (cpu_impl) { + case CPU_IMPL_ULTRASPARCIV: + case CPU_IMPL_ULTRASPARCIVp: + return (1); + default: + return (0); + } +} + /* - * Fill in the cache parameters using the cpu node. + * Fill in the cache parameters using the CPU node. */ void cache_init(struct pcpu *pcpu) { u_long set; + u_int use_new_prop; - if (OF_GET(pcpu->pc_node, "icache-size", - pcpu->pc_cache.ic_size) == -1 || - OF_GET(pcpu->pc_node, "icache-line-size", - pcpu->pc_cache.ic_linesize) == -1 || - OF_GET(pcpu->pc_node, "icache-associativity", - pcpu->pc_cache.ic_assoc) == -1 || - OF_GET(pcpu->pc_node, "dcache-size", - pcpu->pc_cache.dc_size) == -1 || - OF_GET(pcpu->pc_node, "dcache-line-size", - pcpu->pc_cache.dc_linesize) == -1 || - OF_GET(pcpu->pc_node, "dcache-associativity", - pcpu->pc_cache.dc_assoc) == -1 || - OF_GET(pcpu->pc_node, "ecache-size", - pcpu->pc_cache.ec_size) == -1 || - OF_GET(pcpu->pc_node, "ecache-line-size", - pcpu->pc_cache.ec_linesize) == -1 || - OF_GET(pcpu->pc_node, "ecache-associativity", - pcpu->pc_cache.ec_assoc) == -1) + use_new_prop = cache_new_prop(pcpu->pc_impl); + if (OF_GET(pcpu->pc_node, !use_new_prop ? "icache-size" : + "l1-icache-size", pcpu->pc_cache.ic_size) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "icache-line-size" : + "l1-icache-line-size", pcpu->pc_cache.ic_linesize) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "icache-associativity" : + "l1-icache-associativity", pcpu->pc_cache.ic_assoc) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "dcache-size" : + "l1-dcache-size", pcpu->pc_cache.dc_size) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "dcache-line-size" : + "l1-dcache-line-size", pcpu->pc_cache.dc_linesize) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "dcache-associativity" : + "l1-dcache-associativity", pcpu->pc_cache.dc_assoc) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "ecache-size" : + "l2-cache-size", pcpu->pc_cache.ec_size) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "ecache-line-size" : + "l2-cache-line-size", pcpu->pc_cache.ec_linesize) == -1 || + OF_GET(pcpu->pc_node, !use_new_prop ? "ecache-associativity" : + "l2-cache-associativity", pcpu->pc_cache.ec_assoc) == -1) panic("cache_init: could not retrieve cache parameters"); set = pcpu->pc_cache.ic_size / pcpu->pc_cache.ic_assoc;